FHIR Chat · Slicing help ? · shorthand

Stream: shorthand

Topic: Slicing help ?


view this post on Zulip Janaka Peiris (Aug 25 2021 at 13:16):

I need to slice Reference.identifier into 4 slices. SUSHI does not give any validation error on this, but IG Publisher does:

Generating Snapshots                                                             (00:36.0602)
Unable to generate snapshot for http://hl7.no/fhir/StructureDefinition/no-domain-vitalsignsobservation-subjectreference: Attempt to a slice an element that does not repeat: Reference.identifier/Reference.identifier from http://hl7.org/fhir/StructureDefinition/Reference in http://hl7.no/fhir/StructureDefinition/no-domain-vitalsignsobservation-subjectreference, at element Reference.identifier (slice = FNR, DNR, HNR, FHN)

FSH:

* identifier ^slicing.discriminator.type = #value
* identifier ^slicing.discriminator.path = "system"
* identifier ^slicing.rules = #open
* identifier contains
    FNR 0..1 and
    DNR 0..1 and
    HNR 0..1 and
    FHN 0..1

What changes are needed in FSH ?

view this post on Zulip Chris Moesel (Aug 25 2021 at 13:39):

In some cases around slicing, SUSHI has a more hands-off approach and allows you to specify some things that may not be technically correct/allowed. It's my understanding that FHIR only allows you to slice lists (upper cardinality > 1) or choice elements (elements ending in [x]). This is likely why the IG publisher is complaining, because Reference.identifier is neither a list nor a choice. I think I recall some conversations where others have asked for single-cardinality non-choice elements to be supported, so you could try to do some searching to find those threads if you want to add your voice to them.

Depending on what you want to do and where you need to do it, you may have a few choices:

  • Do the slicing in the profiles where the reference is used (although this only works if the reference path itself is a list -- and I'm not sure that happens much with references).
  • Create a different profile on Reference for each identifier type you want to support and then constrain the reference uses to only allow those profiles (but then you're not allowing other, non-conforming reference types).
  • Use invariants to specify whatever conformance rules you were going to try to specify in the slices.

view this post on Zulip Corey Spears (Aug 25 2021 at 15:01):

Just for reference (in case it might be helpful to anyone), there was another discussion about slicing non-repeating non-polymorphic elements: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/Slicing.20non-repeating.20elements

view this post on Zulip Chris Moesel (Aug 25 2021 at 16:01):

Ah yes, that's the one I was thinking of. Thanks, @Corey Spears!


Last updated: Apr 12 2022 at 19:14 UTC