FHIR Chat · meta.profile requirement · shorthand

Stream: shorthand

Topic: meta.profile requirement


view this post on Zulip Saul Kravitz (Dec 02 2020 at 21:19):

In CarinBB we required meta.profile 1..*, but what we meant was that an instance of each profile must declare that it is an instance of that profile.

Since meta.profile is 1..* (not 1..1), how can I specify that ONE of the values is equal to the canonical URL for that profile?

view this post on Zulip Jose Costa Teixeira (Dec 02 2020 at 22:43):

I don't understand the question. You have a profile P1 and in there you declare that all instance resources shall have at least one meta-profile...

view this post on Zulip Jose Costa Teixeira (Dec 02 2020 at 22:44):

do you want to go beyond "at least one value" and require "at least this value once"?

view this post on Zulip Elliot Silver (Dec 02 2020 at 22:48):

I think he's looking for instances of the profile are required to declare that in meta.profile.

view this post on Zulip Elliot Silver (Dec 02 2020 at 22:53):

I'm assuming it ties back to https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/Requiring.20meta.2Eprofile.20be.20populated/near/210455639.

view this post on Zulip Gino Canessa (Dec 02 2020 at 22:57):

I'd guess the cleanest would be to use slicing (never thought I'd say those words together =). It will probably look something like:

Profile: TestProfile
Parent:  Meta
* profile ^slicing.discriminator.type = #value
* profile ^slicing.discriminator.path = "$this"
* profile ^slicing.rules = #open
* profile ^slicing.ordered = false
* profile ^slicing.description = "Slice based on value"
* profile contains supportedProfile 1..1 MS
* profile[supportedProfile] 1..1 MS
* profile[supportedProfile] = "http://example.org/profile"

Though I'm no expert, so it may not be 100%. Note that if you have examples with other values in there (likely), it will throw warnings about slices that don't match the slice discriminator - this is fine to add to ignorewarning.txt.

(also, we should add FSH to the list of langauges in Zulip)

view this post on Zulip Elliot Silver (Dec 02 2020 at 22:58):

Gino Canessa said:

(also, we should add FSH to the list of langauges in Zulip)

:+1:

view this post on Zulip Chris Moesel (Dec 03 2020 at 01:42):

I was going to suggest what @Gino Canessa has already suggested: the best way to say "one of the things in this array should look like this" is through slicing. The only modification I'd suggest to the FSH that Gino arleady supplied is that if the discriminator type is #value than the assignment rule (last line of code in the example) should use (exactly) so that it uses the value[x] constraint (rather than the pattern[x] constraint). Or, if you prefer, keep using = without (exactly) and change the discriminator type to #pattern.

view this post on Zulip Chris Moesel (Dec 03 2020 at 01:50):

(also, we should add FSH to the list of langauges in Zulip)

Based on this, it looks like Zulip uses Pygments -- but it's not clear if we can congifure our own language implementations for a Zulip instance. If someone can confirm that this is possible, we'd be glad to look into it!

view this post on Zulip Saul Kravitz (Dec 03 2020 at 14:01):

Thanks @Gino Canessa and @Chris Moesel .

As a comment on the FHIR Specification: This seems like a remarkably complicated way to express a simple requirement.

view this post on Zulip Chris Moesel (Dec 03 2020 at 14:35):

@Saul Kravitz -- at one point we were thinking of adding a "ginzu slicing" feature to FHIR Shorthand that would hide some of the complication in things like this. If we had ginzu slicing, then you would not need to specify any of the slicing rules in this specific use case (since it is a fairly common one); SUSHI would figure them out for you based on how you define the individual slices.

I don't know if we'll ever do ginzu slicing, but if it's something you'd like to see, then let us know so we can tabulate the votes. ;-)

view this post on Zulip Chris Moesel (Dec 03 2020 at 14:36):

Oh, by the way, I just realized, in Gino's example, you also don't need the line * profile[supportedProfile] 1..1 MS since the contains rule already specifies that information.

view this post on Zulip Saul Kravitz (Dec 03 2020 at 21:47):

Works beautifully -- thx.
https://build.fhir.org/ig/HL7/carin-bb/branches/v1.0.1/StructureDefinition-C4BB-ExplanationOfBenefit-Inpatient-Institutional.html#profile

view this post on Zulip Saul Kravitz (Dec 03 2020 at 22:15):

@Chris Moesel I don't know what ginzu slicing is, but... would it be worthwhile having a library of standard RuleSets (macros) that users could insert? Or even better parameterized Rulesets.

  • insert RequireProfile(Canonical(profilename))

Currently I had to do this in each profile, and I had to define the ruleset following what you guys told me like a monkey.

  • insert Metaprofile-supportedProfile-slice
  • meta.profile[supportedProfile] = Canonical(C4BBOrganization)

Last updated: Apr 12 2022 at 19:14 UTC