FHIR Chat · Slice by Reference target profile · shorthand

Stream: shorthand

Topic: Slice by Reference target profile


view this post on Zulip Elliot Silver (Feb 05 2022 at 01:02):

Does anyone have an example of slicing by the profile of a reference target? I want to say something like my patient profile can have any generalPractitioner references, but at least one must be of my Practitioner profile. I don't want to say only Reference(myPractitioner) or only Reference(Organization | PractionerRole | myPratictitioner).

view this post on Zulip Elliot Silver (Feb 05 2022 at 01:08):

Is this even permitted since, based on previous discussions, slices need to be disjoint, and a slice that matches Practitioner would also match MyPractitioner (although the reverse is not true).

view this post on Zulip Oliver Egger (Feb 05 2022 at 07:06):

might be also a topic to raise on the #conformance stream. as you pointed out , you can't use slicing as the slices need to be disjoint. what you could do, is to add a constraint, that a least one of the resolved references conforms to your profile.

view this post on Zulip Chris Moesel (Feb 07 2022 at 14:01):

If I'm understanding what you want, it seems to me that you can use a slice. While it's true that slices must be disjoint, don't you only need one slice here? You would slice by #profile, leave the slicing #open, and then define just one slice for the myPractitioner profile. Other practitioners not conforming to the profile would just fall into the open part of the slicing, right? Or am I misunderstanding something?

view this post on Zulip Chris Moesel (Feb 07 2022 at 14:28):

I just wrote a minimal Patient profile using a single slice for a Practitioner profile, along w/ examples to demonstrate its use. I ran it through SUSHI and the IG Publisher and it has no errors. If you comment out the line in PatientBob that adds DrSue to the general practitioners, however, there is an error -- showing that it does properly require at least one of the MyPractitioner profile.

The relevant bit is:

Profile: MyPatient
Parent: Patient
Description: "Profile of Patient requiring at least one MyPractioner"
* generalPractitioner ^slicing.discriminator.type = #profile
* generalPractitioner ^slicing.discriminator.path = "$this.resolve()"
* generalPractitioner ^slicing.ordered = false
* generalPractitioner ^slicing.rules = #open
* generalPractitioner 1..*
* generalPractitioner contains mygp 1..*
* generalPractitioner[mygp] only Reference(MyPractitioner)

The full FSH definitions to demonstrate this use case is on FSHSchool here: https://fshschool.org/FSHOnline/#/share/3ruI0lp

view this post on Zulip Elliot Silver (Feb 07 2022 at 18:28):

@Chris Moesel Thanks. I realized about midnight last night that the disjoint slices thing was probably a red herring. But I still couldn't find an example of slicing by profile--which looks far simpler than what I was trying.


Last updated: Apr 12 2022 at 19:14 UTC