Stream: tooling
Topic: Slicing 1..? element
Richard Townley-O'Neill (Oct 31 2019 at 05:56):
@Grahame Grieve @Michel Rutten
Medication.ingredient.item[x] is 1..1 and its type is a choice between CodeableConcept and Reference.
I want to bind the CodeableConcept to a value set and constrain the Reference to profiles of the original Substance and Medication.
Forge and the igPublisher pull in different directions here.
When I slice with Forge it displays itemCodeableConcept and itemReference as 0..1 in the Element Tree and its generated snapshot and says nothing in the differential. This is what I'm after.
The igPublisher will make itemCodeableConcept and itemReference 1..1, unless the differential explicitly say that they are 0..1.
But Forge will not let me record a cardinality of 0..1 in the xml.
What is the way forward?
Michel Rutten (Oct 31 2019 at 09:41):
@Richard Townley-O'Neill If a profile introduces a slice, then Forge always considers the base minimum cardinality to be equal to 0 (i.e. named slices do NOT inherit minimum cardinality from the slice entry). This is a special rule introduced specifically to allow the described use case, to allow you to slice a 1...1 choice type element. Minimum cardinality will only be included in the differential if the profile constrains the value (to something >0). Hope this helps.
Grahame Grieve (Oct 31 2019 at 11:21):
@Michel Rutten I don't believe that this is a rule documented in the specification?
Michel Rutten (Oct 31 2019 at 13:14):
Could be... I recall that we have discussed this specific aspect within FHIR-I (with you and @Lloyd McKenzie ), but that was probably one of those informal chats on Zulip.
This behavior seems to follow from functional requirements. For if named slices would inherit minimum cardinality from slice entry, similar to other constraints, then a slice group would not be able to define a set of mutually exclusive options (as the scenario above).
Grahame Grieve (Nov 13 2019 at 23:38):
can we talk about this at DevDays?
Last updated: Apr 12 2022 at 19:14 UTC