FHIR Chat · How to reference multiple IGs · shorthand

Stream: shorthand

Topic: How to reference multiple IGs


view this post on Zulip Vikas Sinha (Aug 06 2021 at 17:20):

I am new to FSH and have not been able to find any documentation to fix the issue I am currently encountering. Basically, for my custom IG I need to reference both the core FHIR v4 and US Core v3 specifications. I included the 2 dependencies in my package.json file as shown below. I need this so that I can extend my Patient resource using the USCore Patient profile but for other resources like Encounter I want to extend the core FHIR profile.

"dependencies": {
"hl7.fhir.r4.core": "4.0.1",
"hl7.fhir.us.core": "3.1.0"
},
In my FSH file for Patient I have referenced the URL of the USCore Patient profile (see below)

Profile: RWDPatient
Parent: http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient
Id: RWDPatient

Now when I trigger the SUSHI script it returns the Error "Parent http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient not found for RWDPatient"

Am I missing any step? What is the correct way of implementing my requirement?
Appreciate any help to resolve my issue.

view this post on Zulip Jean Duteau (Aug 06 2021 at 17:37):

you say that you've put the dependencies in your "package.json" file, but I'm not sure what file that is since there is no package.json file that the publisher or sushi looks at (as far as I know). You want to declare your dependencies in the sushi-config.yaml file:

fhirVersion: 4.0.1
dependencies:
  hl7.fhir.us.core: 4.0.1
  hl7.fhir.us.core: 3.1.0

view this post on Zulip Josh Mandel (Aug 06 2021 at 17:51):

Isn't that an invalid "dependencies" object, since it has two values associated with the same key? https://yaml.org/spec/1.2/spec.html#mapping says:

a mapping node is an unordered set of key: value node pairs, with the restriction that each of the keys is unique

view this post on Zulip Vikas Sinha (Aug 06 2021 at 18:45):

Thanks Jean. I was able to make it run using the following update to the sushi-config.yaml file. I corrected the package name for core fhir specification. In addition, SUSHI made me add the URI and version as I have mentioned below

dependencies:
hl7.fhir.r4.core:
uri: http://my-fhir-ig.org/ImplementationGuide/123
version: 4.0.1
hl7.fhir.us.core: 3.1.0

view this post on Zulip Jean Duteau (Aug 06 2021 at 22:29):

Josh Mandel said:

Isn't that an invalid "dependencies" object, since it has two values associated with the same key? https://yaml.org/spec/1.2/spec.html#mapping says:

a mapping node is an unordered set of key: value node pairs, with the restriction that each of the keys is unique

Yeah, I made a copy and paste error. One of those should be the base fhir dependency and the other US-Core.

view this post on Zulip Jean Duteau (Aug 06 2021 at 22:32):

Vikas Sinha said:

Thanks Jean. I was able to make it run using the following update to the sushi-config.yaml file. I corrected the package name for core fhir specification. In addition, SUSHI made me add the URI and version as I have mentioned below

dependencies:
hl7.fhir.r4.core:
uri: http://my-fhir-ig.org/ImplementationGuide/123
version: 4.0.1
hl7.fhir.us.core: 3.1.0

I'm not sure that what you put is correct. The uri for fhir.r4.core defintely shouldn't be there. You should look at the documentation at https://fshschool.org/docs/sushi/configuration/

Here is the recommended configuration:

id: fhir.us.example
canonical: http://hl7.org/fhir/us/example
name: ExampleIG
title: "HL7 FHIR Implementation Guide: Example IG Release 1 - US Realm | STU1"
description: An example IG that exercises many of the fields in a SUSHI configuration
status: draft
license: CC0-1.0
version: 0.1.0
fhirVersion: 4.0.1
copyrightYear: 2020+
releaseLabel: ci-build
publisher:
  name: HL7 International - US Realm Steering Committee
  url: http://www.hl7.org/Special/committees/usrealm/index.cfm
  email: usrsc@lists.HL7.org
dependencies:
  hl7.fhir.us.core: 3.1.0

view this post on Zulip Lloyd McKenzie (Aug 07 2021 at 02:39):

@Vikas Sinha be aware that having multiple profiles with the same canonical URL but different versions SHOULD be supported, but you may run into issues as it's not well tested. So be on the lookout and holler if you find any.

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

I can confirm, SUSHI has not been tested well for this use case. If you declare a parent profile for which two versions exist in the dependencies, I think that the selection of which one to use will be arbitrary. I'm not even sure if SUSHI will correctly work when you specify the version you want using a canonical form. I agree w/ Lloyd that it should work -- but I'm not sure that it does work. This may be an area in which we need to improve SUSHI.


Last updated: Apr 12 2022 at 19:14 UTC