FHIR Chat · slicing by profile · shorthand

Stream: shorthand

Topic: slicing by profile


view this post on Zulip Diana_Ovelgoenne (Apr 05 2022 at 10:43):

Since while ago I've been having the following definition for my slices on Observation.hasMember

  • hasMember ^slicing.discriminator.type = #profile
  • hasMember ^slicing.discriminator.path = "$this.resolve()"
  • hasMember ^slicing.rules = #open
  • hasMember ^slicing.ordered = false
  • hasMember contains
    profileA 0..1 and
    profileB 0..1 and
    profileC 0..*

  • hasMember[profileA] only Reference(ProfileAObservation)

  • hasMember[profileB] only Reference(ProfileBObservation)
  • hasMember[profileC] only Reference(ProfileCObservation)
    It hasn't given any errors till I updated Ig publisher to 1.1.114, the instances I create say Profile ParentObservation, Element matches more than one slice - ProfileAExample, ProfileBexample
    I defined inside the Instance this:
    ...

  • hasMember[0] = Reference(ProfileAExample)

  • hasMember[+] = Reference(ProfileBexample)
  • hasMember[+] = Reference(ProfileCexample)

What shall be the right syntaxis to avoid such error on ig publisher, from the sushi side I don't get any

view this post on Zulip Mint Thompson (Apr 05 2022 at 14:03):

I think that in order to avoid this error, each of your Observation profiles and instances need to be defined such that each instance conforms to exactly one of your Observation profiles. If there aren't a lot of rules on those profiles, it may be the case that your instances conform to more than one profile, which violates the slicing.

view this post on Zulip Moritz Kähler (Apr 12 2022 at 09:24):

Hi Thompson, I'm following up on the problem Diana mentioned.
The resource referenced in hasMember adheres only to one single profile.
I build this repository with minimal resources to reproduce the error here:
https://github.com/mkaehlershs/FhirSlicingOnProfiles
(Used: IG Publisher Version: v1.1.114)

A quick summery here:
There is one Profile, lets call it SDParentObservation profile that defines 3 slices on hasMember field.
Each of this slices is bound to a different profile( SDMember[one|two|three]Observation. Each profile uses a different fixed code.)
Full fsh code attached. Sample.fsh

The ParentObservationExample (instance for SDParentObservation profile) that contains only one member for sliceMemberOne causes following errors in qa report:

Path Severity Message
Observation.hasMember[0] (l36/c6) error Profil http://example.com/fhir/example/StructureDefinition/sd-parent-observation, Element matches more than one slice - sliceMemberOne, sliceMemberTwo
Observation.hasMember[0] (l36/c6) error Profil http://example.com/fhir/example/StructureDefinition/sd-parent-observation, Element matches more than one slice - sliceMemberOne, sliceMemberThree

But the referenced resource for sliceMemberOne uses a code that is different to the code defined in the profiles for sliceMemberTwo and sliceMemberThree.

Any Idea how to fix this?

view this post on Zulip Moritz Kähler (Apr 12 2022 at 09:54):

OK I found the problem. It is caused, because the SDMemberOne/Two/Three Observation profiles allow to not provide the common code slice.
When I changed the cardinality for commonCode from 0..1 to 1..* the error goes away.


Last updated: Apr 12 2022 at 19:14 UTC