Stream: implementers
Topic: choice[x] field sized
Nick George (Dec 13 2019 at 22:07):
What do we think about the size of fields like http://hl7.org/fhir/devicemetricobservation.html effectiveDateTime, where
effective[x] has min size 0,
effective[x]:effectiveDateTime has min size 1
(and no other types are allowed)
it sort of seems to me like those should agree that the field must be populated. Does that seem reasonable?
Grahame Grieve (Dec 13 2019 at 23:02):
yes. in fact, that would no longer build like that
Grahame Grieve (Dec 13 2019 at 23:05):
no. I lie. but it won't from now on
Grahame Grieve (Dec 13 2019 at 23:05):
well, at least, after my next release
Nick George (Dec 13 2019 at 23:29):
Cool. Another one:
Seems like http://hl7.org/fhir/extension-composition-section-subject.html is rendering the content as 0..1 even though Extension.value[x] is 1..1
Nick George (Dec 13 2019 at 23:30):
(true of all extensions, that's just an example)
Grahame Grieve (Dec 16 2019 at 03:08):
I think that's correct
Nick George (Dec 16 2019 at 15:31):
hmm why wouldn't it render as 1..1 in the snapshot/differential if the extension value is 1..1?
Lloyd McKenzie (Dec 16 2019 at 15:45):
What value being 1..1 says is that "if the extension is present, it must have a value". It's not saying "the extension must exist". That would be expressed by the cardinality of the extension, not the cardinality of extension.value.
Nick George (Dec 16 2019 at 16:15):
hmm, to be clear, I'm talking about http://hl7.org/fhir/extension-composition-section-subject.html
Nick George (Dec 16 2019 at 16:17):
so you're saying that the 0..1 on the definition of the extension indicates there means that there are between 0 and 1 instances of that extension? on what? isn't that something that would be expressed by a profile?
Lloyd McKenzie (Dec 16 2019 at 16:53):
0..1 on the element that references the extension would define the extension as optional. If you make the definition of the extension 1..1, then that says that "if a profile references this extension, they have to make it mandatory (min=1)".
Nick George (Dec 16 2019 at 16:55):
hmm. Ok,just to be 100% clear, which of those categories is the 0..1 here http://hl7.org/fhir/extension-composition-section-subject.html?
Nick George (Dec 16 2019 at 16:56):
that says, "A profile can include this extension without it being mandatory"?
Lloyd McKenzie (Dec 16 2019 at 17:13):
Right. If the base definition of the extension is 0..1, then it can be included without it being mandatory. However, a profile can tighten up its reference and choose to make it mandatory in that particular location for that particular profile if it wishes.
Nick George (Dec 16 2019 at 17:26):
Ok, fair enough. Feels a bit odd to place a universal restriction on use of an extension, instead of leaving it up to the individual profile to define usage, but thanks for explaining.
Lloyd McKenzie (Dec 16 2019 at 17:29):
It's more common to constrain the upper cardinality - to indicate whether an extension is allowed to repeat or not. Constraining the minimum cardinality across all contexts is unusual. Essentially it's saying "if you're going to use this, it must always be present", and that's not something that is often true.
Nick George (Dec 16 2019 at 17:29):
ah that makes sense
Grahame Grieve (Dec 16 2019 at 19:40):
in fact, I don't think I've seen minimum = 1 on an extension
Grahame Grieve (Dec 16 2019 at 19:40):
but repeating or not... that's common
Lloyd McKenzie (Dec 16 2019 at 22:00):
I have a couple of times where I thought it was legit, but I can't remember the use-cases off the top of my head.
Last updated: Apr 12 2022 at 19:14 UTC