FHIR Chat · Slicing mandatory elements · conformance

Stream: conformance

Topic: Slicing mandatory elements


view this post on Zulip Richard Townley-O'Neill (Aug 08 2019 at 05:01):

MedicationStatement.medication has cardinality 1..1 and is a choice between CodeableConcept and Reference.
In a profile we impose data type relevant constraints. So the element is sliced on type. The result of this is medication[x], medicationCodeableConcept and medicationReference all have cardinality 1..1. This makes it impossible to create a valid instance as one of the conditions will always fail.

view this post on Zulip Richard Townley-O'Neill (Aug 08 2019 at 05:03):

I think that it should be possible to usefully slice a 1..1 element by type.

view this post on Zulip Richard Townley-O'Neill (Aug 08 2019 at 05:04):

Is this a problem with the design of slicing?

view this post on Zulip Lloyd McKenzie (Aug 08 2019 at 05:37):

The min cardinality of the slices can be less than the minCardinality of the sliced element. If something yells at you about that, that's a problem with the tool

view this post on Zulip Richard Townley-O'Neill (Aug 08 2019 at 06:12):

Thanks @Lloyd McKenzie
I have it working.
When I explicitly set the min cardinality to 0 in each slice it behaves as I want.
The ig publisher when generating the snapshot treats the default minimum cardinality of each slice as the same as the minimum cardinality of the sliced element. Is that expected behaviour?

view this post on Zulip Richard Townley-O'Neill (Aug 08 2019 at 06:15):

@Brett Esler This is useful for the AU profile of MedicationStatement.

view this post on Zulip Lloyd McKenzie (Aug 08 2019 at 07:09):

It would be hard for it to know what the minimum should be.

view this post on Zulip Michel Rutten (Aug 08 2019 at 08:19):

Note: Forge allows this and always initialize the minimum cardinality of a newly created named slice to 0, regardless of the cardinality of the type sliced element.


Last updated: Apr 12 2022 at 19:14 UTC