FHIR Chat · Query · shorthand

Stream: shorthand

Topic: Query


view this post on Zulip Shovan Roy (May 30 2020 at 08:39):

Hi @Chris Moesel

I am new to Sushi and just able to write my first Observation resource using Sushi. This is amazing !!. loving it :slight_smile:
just have few queries about resource profiling using sushi:

  1. How can I add copyright information in a resource?
  2. How can I declare a profile as abstract?

Thanks,
Shovan

view this post on Zulip Jose Costa Teixeira (May 30 2020 at 09:20):

Shovan Roy said:

  1. How can I add copyright information in a resource?
  2. How can I declare a profile as abstract?
* ^copyright = "Mine"
* ^abstract = true

view this post on Zulip Jose Costa Teixeira (May 30 2020 at 09:31):

(i'm curious about the abstract though - are you trying to make logical models?)

view this post on Zulip David Hay (May 30 2020 at 20:54):

Of course, in the spirit of the community the first should be

* ^copyright = "Ours"

:)

view this post on Zulip Shovan Roy (May 31 2020 at 23:35):

thanks a lot @Jose Costa Teixeira , @David Hay I was able to populate both the 'abstract' and 'copyright' in my resource as per your guideline.

I was just wondering if there is any way by which I can add common elements like 'copyright', 'publisher' in a single place and all resources can inherit them other than duplicating these in individual resource? can this go as an input in "ImplementationGuide-fhir.fsh.json" file?

view this post on Zulip Shovan Roy (May 31 2020 at 23:42):

Jose Costa Teixeira said:

(i'm curious about the abstract though - are you trying to make logical models?)

@Jose Costa Teixeira In my IG, I'm creating a base profile for all resource types used and marking them as 'abstract'. Adding all common stuff as per our project requirement in the base profile. All profiles in the project are meant to extend that base profile of that resource type. Implementing inheritance of profiles.

view this post on Zulip Nick Freiter (Jun 01 2020 at 12:35):

I was just wondering if there is any way by which I can add common elements like 'copyright', 'publisher' in a single place and all resources can inherit them other than duplicating these in individual resource? can this go as an input in "ImplementationGuide-fhir.fsh.json" file?

This is possible with the use of RuleSets. RuleSets act as a group of rules that can be applied to resources. As an example:

RuleSet: USCoreMetadata
* ^version = "3.1.0"
* ^status = #active
* ^experimental = false
* ^publisher = "HL7 US Realm Steering Committee"
* ^contact.telecom.system = #url
* ^contact.telecom.value = "http://www.healthit.gov"
* ^jurisdiction.coding = COUNTRY#US "United States of America"

Profile: MyUSCorePatientProfile
Parent: Patient
Mixins: USCoreMetadata
* deceased[x] only deceasedBoolean
// More profile rules

The rules defined on the USCoreMetadata RuleSet will be applied to the MyUSCorePatientProfile profile, and if you had more profiles, you could apply the same metadata to all those profiles in a similar way. I took this example from the documentation on RuleSets found here http://build.fhir.org/ig/HL7/fhir-shorthand/branches/master/reference.html#defining-rule-sets.

view this post on Zulip Grahame Grieve (Jun 01 2020 at 12:36):

also, you can just define these in the IG and tell the IG publisher to fix the values in everything

view this post on Zulip Grahame Grieve (Jun 01 2020 at 12:36):

that's not a shorthand feature

view this post on Zulip Chris Moesel (Jun 01 2020 at 15:28):

To use the approach Grahame is referring to, you need to be able to control specific values in the IG resource. You can't do this with SUSHI 0.12.x, but it is possible with SUSHI 0.13.x-beta.2. We're gathering one more round of feedback on the beta before we make it an official release.

If you use the beta, then in the config.yaml, you'll want to set the relevant parameters (e.g., copyright) and then set the corresponding apply-[x] parameter, like so:

# not showing all the other config.yaml properties;
# only showing those relevant to this conversation.
copyright: Ours
parameters:
  apply-copyright: true

See the parameter documentation for all of the supported apply-[x] parameters.

NOTE: If you have an existing SUSHI 0.12.x project, the first time you run 0.13.0-beta.2, it will generate a config.yaml for you -- then you can add the properties as shown above to it.

view this post on Zulip Shovan Roy (Jun 01 2020 at 21:50):

awesome @Chris Moesel let me explore sushi 013.0 beta

view this post on Zulip Shovan Roy (Jun 03 2020 at 23:26):

Hi @Chris Moesel I have used the copyright in the config.yml and I can see that the generated ig has them populated. Though I don't see them populated in the other resources (under profile folder) generated from the corresponding fsh file. shall I use the RuleSet for that purpose?

Also, this could be too much of ask :slight_smile: I was wondering if there anyway by which I can generate fsh file out of existing profile json files?

view this post on Zulip Chris Moesel (Jun 03 2020 at 23:32):

Hi @Shovan Roy, if you also use the apply-copyright parameter in config.yaml (as shown in my earlier post), then the copyright should be applied to all your definitions by the IG Publisher. Note that the raw FSH-generated profiles won't have them, but when you run your IG through the IG Publisher, the final versions of those profiles will have the copyright. It gets applied by the IG Publisher, not by SUSHI. I haven't tested it, but my understanding is that this should work.

view this post on Zulip Chris Moesel (Jun 03 2020 at 23:36):

I was wondering if there anyway by which I can generate fsh file out of existing profile json files?

Someone created a proof-of-concept tool for this called FSH Food at the January Connectathon, but it hasn't been updated since February -- so it's buggy and not up to date w/ the latest FHIR Shorthand features. We're not sure if FSH Food will progress any further so we're considering picking up the effort for a SD --> FSH converter. Stay tuned (although it will probably take a little while).

view this post on Zulip Shovan Roy (Jun 03 2020 at 23:42):

Chris Moesel said:

Hi Shovan Roy, if you also use the apply-copyright parameter in config.yaml (as shown in my earlier post), then the copyright should be applied to all your definitions by the IG Publisher. Note that the raw FSH-generated profiles won't have them, but when you run your IG through the IG Publisher, the final versions of those profiles will have the copyright. It gets applied by the IG Publisher, not by SUSHI. I haven't tested it, but my understanding is that this should work.

@Chris Moesel yes, I have used that configuration. Here is a snippet from the config.yaml
dependencies:
hl7.fhir.au.base: current
parameters:
show-inherited-invariants: false
apply-copyright: true
apply-jurisdiction: true
apply-publisher: true
apply-version: true
releaselabel: qa-preview

and I can see this coming up in the IG as :{
"code": "apply-copyright",
"value": "true"
},
But when I check the individual resource, I don't see them. probably I will do some more review of what's happening or anything missing in my setup and take some advice from Grahame on this.

view this post on Zulip Chris Moesel (Jun 03 2020 at 23:45):

Are you looking at the profiles after running the IG Publisher on them?

view this post on Zulip Shovan Roy (Jun 03 2020 at 23:46):

yes

view this post on Zulip Shovan Roy (Jun 03 2020 at 23:47):

let me do a clean build after removing everything and see what happens. I will keep you posted with the outcome .. thanks very much @Chris Moesel

view this post on Zulip Joshua Reynolds (Jun 04 2020 at 19:33):

Hi @Chris Moesel

I am also fairly new to FSH, but I have a lot of experience with FHIR and I attended the FSH track at the connectathon. I am demoing the capabilities of FSH to other members of my company so that we can start using it across all of the IGs we create.

My question is similar to https://chat.fhir.org/#narrow/stream/215610-shorthand/topic/Query/near/199363176, is it possible to use RuleSets to define a set of rules for an Example in order to reuse common attributes across examples?

For example:
if every Example Patient had

  • extension[us-core-race].extension[ombCategory].url = "ombCategory"
  • extension[us-core-race].extension[ombCategory].valueCoding = Race#2106-3 "White"
  • extension[us-core-race].extension[text].url = "text"
  • extension[us-core-race].extension[text].valueString = "White"

view this post on Zulip Nick Freiter (Jun 04 2020 at 19:44):

@Joshua Reynolds that seems like a good use case for RuleSets. Here is how what you are describing might look in FSH:

Alias: Race = https://www.hl7.org/fhir/us/core/ValueSet-omb-race-category.html

RuleSet: PatientRace
* extension[us-core-race].extension[ombCategory].url = "ombCategory"
* extension[us-core-race].extension[ombCategory].valueCoding = Race#2106-3 "White"
* extension[us-core-race].extension[text].url = "text"
* extension[us-core-race].extension[text].valueString = "White"

Instance: P1
InstanceOf: http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
Mixins: PatientRace
* name.given = "James"
* name.family = "Cod"

Instance: P2
InstanceOf: http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
Mixins: PatientRace
* name.given = "Bill"
* name.family = "Reef"

On any Instance I make of a Patient, I can add Mixins: PatientRace to add the rules listed in that RuleSet to my FSH definition.

view this post on Zulip Joshua Reynolds (Jun 04 2020 at 19:46):

Awesome!
I did not fully understand how that would look when applied to an Example, but this clears it all up.
Thank you very much @Nick Freiter

view this post on Zulip Joshua Reynolds (Jun 04 2020 at 20:35):

image.png
image.png
I am getting a "Cannot resolve element from path: extension[us-core-race].extension[text].url"
I had the IG building and just copied the rules and put them into a RuleSet.
Does the RuleSet need to know about the us-core-patient Profile?

view this post on Zulip Mark Kramer (Jun 04 2020 at 20:41):

The other way to do this is to create a rule set, then mix in that rule set in every profile. It still requires touching each profile, but it is one line in each profile.

view this post on Zulip Joshua Reynolds (Jun 04 2020 at 20:49):

I'm sorry I must have missed something I just walked through it deleting each extension and adding it to the RuleSet and it is working.

view this post on Zulip Shovan Roy (Jul 31 2020 at 01:24):

Hi All,

I need some guidance on slicing using sushi. I'm trying to draft a profile using sushi. The profile extends the international vital-sign body weight(http://hl7.org/fhir/StructureDefinition/bodyweight). My objective is to include additional SNOMED based slice on Observation.code.coding in the derived vital sign profile.
I'am trying to do that by adding the following in the .fsh file (Parent: observation-bodyweight)
/* code.coding contains
/ bodyWeightSNOMED-CT 0..1 MS
/* code.coding[bodyWeightSNOMED-CT] = SCT#27113001
I'm facing issues with it. as per my understanding it is failing since the vital sign profiles are not sliced based on pattern but sushi is trying add a pattern by using the above code. Please suggest me how I can achieve this.
Error: Internal error: Could not match any discriminators ([code, system]) for slice Observation.code.coding:bodyWeightSNOMED-CT in profile http://build.fhir.org/ig/hl7au/au-fhir-childhealth/StructureDefinition/ncdhc-observation-vitalsign-bodyweight - None of the discriminator [code, system] have fixed value, binding or existence assertions

view this post on Zulip Shovan Roy (Aug 01 2020 at 01:05):

@Chris Moesel any suggestion for me?

view this post on Zulip Chris Moesel (Aug 03 2020 at 12:59):

Hi @Shovan Roy. I apologize for the delay, when I read this the first time, I did not have time to look into it. But then, after it was marked "read", I forgot to look at it again. I wish Zulip had a way to re-mark something as "unread"!

Your hunch is correct. The parent profile (http://hl7.org/fhir/StructureDefinition/bodyweight) slices coding using the value discriminator type and two paths (both system and code). That being the case, any additional slices need to follow that approach, meaning:

  1. They must fix system and code independently (not via a pattern[x] on a parent path)
  2. They must fix them using fixed[x] (since the discriminator type is value, not pattern)

The following FSH worked for me using SUSHI 0.15.0:

Alias: SCT = http://snomed.info/sct
Alias: LOINC = http://loinc.org
Alias: OBSCAT = http://terminology.hl7.org/CodeSystem/observation-category

Profile: MyWeightProfile
Parent: http://hl7.org/fhir/StructureDefinition/bodyweight
* code.coding contains bodyWeightSNOMED-CT 0..1 MS
* code.coding[bodyWeightSNOMED-CT].system = SCT (exactly)     // discriminator requires fixed[x]
* code.coding[bodyWeightSNOMED-CT].code = #27113001 (exactly) // discriminator requires fixed[x]

Instance: MyWeightInstance
InstanceOf: MyWeightProfile
* code.coding[BodyWeightCode] = LOINC#29463-7
* code.coding[bodyWeightSNOMED-CT] = SCT#27113001
* category = OBSCAT#vital-signs
* status = #final
* subject = Reference(Patient/example)
* effectiveDateTime = 2020-08-01T00:00:00.000-05:00
* valueQuantity = 100 '[lb_av]'
* valueQuantity.unit = "lbs"

view this post on Zulip David Hay (Aug 03 2020 at 17:45):

You know, 'how to' replies like this are gold! We should have a way to 'tag' them - or copy them somewhere so they can be more easily found. sort of an examples 'how to' annex in the spec or somewhere...

view this post on Zulip Shovan Roy (Aug 03 2020 at 21:53):

@Chris Moesel thank you so much. This works perfectly. This is 'exactly' what I was looking for :smile:
I love sushi !


Last updated: Apr 12 2022 at 19:14 UTC