Stream: implementers
Topic: Cardinality constrain but retain array
Shamil Nizamov (Sep 26 2018 at 18:51):
Is that possible or do we need a special symbol to indicate that when 0..* or 1..* cardinality is constrained to 0..1/1..1 the array representation in JSON still should be preserved?
Chris Moesel (Sep 26 2018 at 20:21):
My understanding is that if it's an array (i.e., max is '*'
) in the base resource, then it's always represented as an array in instances, even if the instance conforms to a profile that narrows it to max 1
. Although not explicitly stated for this exact use case, I think the general spirit is reflected in 2.6.2.2:
An item that may repeat is represented as an array even in the case that it doesn't repeat so that the process of parsing the resource is the same either way
Lloyd McKenzie (Sep 26 2018 at 20:43):
Correct. If it's an array in the base spec, it's always an array, even if the maximum repetitions is constrained to 1
Michel Rutten (Sep 26 2018 at 21:51):
FYI this aspect is explicitly captured by ElementDefinition.base.max:
http://hl7.org/fhir/elementdefinition-definitions.html#ElementDefinition.base.max
Shamil Nizamov (Sep 27 2018 at 15:05):
Great, thank you all.
Last updated: Apr 12 2022 at 19:14 UTC