FHIR Chat · dependency on package without IG · shorthand

Stream: shorthand

Topic: dependency on package without IG


view this post on Zulip Sebastiaan Raap (Dec 10 2021 at 19:11):

Hi , just to check: I'm trying to use the nictiz.fhir.nl.r4.zib2020: 0.1.0-beta1 in my sushi project. There's no IG in this package, so I can't use this in my project can I?

view this post on Zulip Chris Moesel (Dec 10 2021 at 21:11):

Yes, you can still use it in a SUSHI project, but there are a few things you will need to do.

  1. Update SUSHI to v2.2.2 since it addresses a bug with downloading dependencies.
  2. Update your dependency in sushi-config.yaml to include an IG canonical URL since the package doesn't specify one.
  3. Use Firely Terminal to "bake" the dependency in your FHIR cache since it is not distributed w/ the profile snapshots (which SUSHI needs).

view this post on Zulip Chris Moesel (Dec 10 2021 at 21:11):

Re 2 above, you can do something like this:

dependencies:
  nictiz.fhir.nl.r4.zib2020:
    uri: http://nictiz.nl/fhir
    version: 0.1.0-beta1

view this post on Zulip Chris Moesel (Dec 10 2021 at 21:16):

Re 3 above, you'll need the Firely Terminal 2.5.0 beta. You should use the fhir bake command to populate the snapshots.

view this post on Zulip Sebastiaan Raap (Dec 11 2021 at 14:45):

thanks, added the package to my fhir cache, but didn't bake it yet. thanks again.

view this post on Zulip Sebastiaan Raap (Dec 13 2021 at 13:09):

when I download package de.gkvsv.eRezeptAbrechnungsdaten or nictiz.fhir.nl.r4.zib2020 from simplifier, there is no "url" or "canonical" present in the package.json. It differs from other packages on simplifier like hl7.fhir.uv.sdc , that package.json does contain url and canonical.

view this post on Zulip Sebastiaan Raap (Dec 13 2021 at 13:12):

I've added url to the nictiz.fhir.nl.r4.zib2020 package.json and everything works like a charm. But shouldn't url (and maybe canonical) always be present in package.json when downloaded from the package registry?

view this post on Zulip Chris Moesel (Dec 13 2021 at 13:14):

I'm not sure if it is required or not. That might be a good question for @Martijn Harthoorn.

view this post on Zulip Matthijs van der Wielen (Dec 14 2021 at 07:42):

According to the NPM package spec both canonical and url are optional in the package manifest. https://confluence.hl7.org/display/FHIR/NPM+Package+Specification
And after a quick search on Simplifier, which is the backbone for the registry, most packages do not contain a canonical or a url in the package manifest.

view this post on Zulip Hank Lenzi (Dec 14 2021 at 10:03):

Hello --I was just wondering...Where does sushi pull the resource IG template from? Suppose I wanted to create an extension to a published IG that's not at hl7.fhir.org, but that was already an extension of Patient resources (suppose a national "Core" project). Where would I configure that in? What would I write in shushi-yaml.org? TIA

view this post on Zulip Grahame Grieve (Dec 14 2021 at 10:42):

are you asking about the template, or the core content of the profiles?

view this post on Zulip Hank Lenzi (Dec 14 2021 at 12:42):

Hello Grahame - The question is: when I did the fish exercises, I extended a Patient profile. I suppose sushi pulls this from hl7.fhir.org Right? Now, if I were to extended somebody else's Patient profile (say, a national "core" project), where would I set that on the fsh files? In "dependency"?
(I guess the answer would be core content of the profiles).

view this post on Zulip Hank Lenzi (Dec 14 2021 at 12:44):

Just to make myself clear. I'd like to extend this: https://registry.fhir.org/package/BRCore-01.00.00%7C1.0.0
(or simplifier: https://simplifier.net/BR-Core ) I've copied all CodeSystems and ValueSets to [root]/input/resources

view this post on Zulip Hank Lenzi (Dec 14 2021 at 12:49):

(deleted)

view this post on Zulip Chris Moesel (Dec 14 2021 at 13:44):

@Hank Lenzi - If you want use resources from another IG, then you need to declare it as a dependency in sushi-config.yaml. You can find some documentation on dependency configuration here: https://fshschool.org/docs/sushi/configuration/#dependencies

If you want to depend on the BRCore-01.00.00 IG you linked to above, you need to use the long-form dependency declaration since that IG does not contain an ImplementationGuide resource (which is where we would normally pull the IG URL from). For example, something like this:

dependencies:
  brcore-01.00.00:
    uri: http://www.saude.gov.br/fhir/r4
    version: 1.0.0

Unfortunately, you still run into one more problem, which is that the IG doesn't come packaged with snapshots -- yet SUSHI requires snapshots in order to process the resources correctly. So... you will need to download the latest Firely.Terminal 2.5.0 Beta and use its fhir bake command to populate the snapshots in your FHIR cache.

view this post on Zulip Chris Moesel (Dec 14 2021 at 13:47):

Thanks for the confirmation and clarification, @Matthijs van der Wielen. SUSHI requires some URI associated w/ the dependency because it generates an ImplementationGuide resource, for which dependsOn.uri is required. It's still not clear what that value should be for packages that have no IG resource, but I usually just use the root of the canonical URLs I see in most of the package contents.

view this post on Zulip Chris Moesel (Dec 14 2021 at 13:52):

BTW -- the issue about dependsOn.uri being required has recently come up in another thread and Grahame was going to investigate how it should work.

view this post on Zulip Hank Lenzi (Dec 14 2021 at 13:53):

Hi Chris --- Thanks.
For the following site: https://br-core.gointerop.com/fhir
which implements br-core, would this be the correct url on the dependency?

view this post on Zulip Chris Moesel (Dec 14 2021 at 13:56):

To be honest, I'm not sure how much it matters. The IG Publisher will probably complain that it does not point to an ImplementationGuide resource, but since BR Core does not have an ImplementationGuide resource, it is impossible to point to it! I usually just put the base canonical URL I see across many resources in the IG -- but it's probably fine to put a URL like the one you suggested as well. Hopefully we'll have more clarity on this after @Grahame Grieve investigates what to do w/ dependsOn.uri for packages without an IG resource.

view this post on Zulip Hank Lenzi (Dec 14 2021 at 17:26):

Seems complicated. Meanwhile, we're investigating a new path: fed JSON files to GoFish and then feed that into FSH. Takes some tweaking. Not sure on the outcome yet, though.

view this post on Zulip Chris Moesel (Dec 14 2021 at 18:24):

I think it depends on what you're after. There is value in formally declared dependencies and references -- but if that's not what you need, I suppose there are other approaches!

Re: the need to use Firely.Terminal and fhir bake, I plan on documenting that better soon so that it doesn't seem quite so complicated!

view this post on Zulip Grahame Grieve (Dec 14 2021 at 19:55):

I think it's an issue for committee - the design requires that IGs depend on packages that declare themselves as IGs - I don't think I can override that in the tools somehow

view this post on Zulip Hank Lenzi (Dec 14 2021 at 22:48):

Our hack, to circumvent these situations (groups that release stuff with no IGs) is to process the resources via GoFish, thn tweak the FSH files in order to regenerate+extend whatever it is we are doing (we're attempting a Covid-19 notification composition, following the data dictionaries from the official documentation for notification guides (non-FHIR) from the Brazilian Ministry of Health. It's been an interesting afternoon in experimenting with that. Sushi remains a bit mysterious to me.

view this post on Zulip Kippi Bordowitz (Mar 28 2022 at 13:18):

@Chris Moesel
I read the whole thread but I want to make sure I understand before I commit to all the work necessary.
This is how our dependencies are declared:
image.png
But sushi still asks for snapshots from ILCore. Does this mean I too have to fhir bake the project? If so, is there any way of getting the tool w/o installing dotnet? I never needed it so far and it feels a bit much for a single tiny command...

view this post on Zulip Chris Moesel (Mar 28 2022 at 15:36):

Hi @Kippi Bordowitz -- There are a couple of things going on here.

First, if you are using SUSHI 2.3.0, then you no longer need to specify the URL in your dependencies (even for packages without an IG resource). So you can simplify your dependencies to:

dependencies:
  il.core.fhir.r4: 0.6.0
  hl7.fhir.us.core: 4.1.0

There are more details in the SUSHI 2.3.0 Release Notes.

Second, SUSHI does require dependencies to contain the snapshot elements. If you get an error that SUSHI can't process a parent because it does not have a snapshot, you'll need to get its snapshot into the FHIR cache. Using Firely Terminal with fhir bake is the easiest approach for most users (see doc here).

If you do not want to install Firely Terminal (and its dotNET requirement), then you can manually update your FHIR cache. These are the basic steps for that:

  1. Download the package with snapshots by going to the version of the package you want on simplifier (example: il.core.fhir.r4 0.6.0, then click Download --> Download Snapshots).
  2. Extract the downloaded tgz file. The extraction will have a folder named package with all of the important files in it.
  3. Create the dependency's folder in your FHIR cache. In your case, this means creating the folder: ~/.fhir/packages/il.core.fhir.r4#0.6.0/. If that folder already exists, just delete its contents.
  4. Copy all the files from the extracted tgz's package folder to the relevant folder in the FHIR cache (that you just created or cleaned).
  5. Run SUSHI again and verify it now works.

view this post on Zulip Kippi Bordowitz (Mar 28 2022 at 15:46):

@Chris Moesel thanks!
As I happen to be the person who also maintains the ILCore simplifier - could you tell me how one goes about making sure the package actually has the snapshots?

view this post on Zulip Kippi Bordowitz (Mar 28 2022 at 15:49):

More important - how do I find my FHIR cache folder? I googled it but found nothing...
I'm on windows

view this post on Zulip Elliot Silver (Mar 28 2022 at 15:53):

Simplifier doesn't create snapshots in their packages. You can run through the process @Chris Moesel describes, upload the resulting profiles to Simplifier, and repackage those; or, you can build use IG publisher to build profiles that have snapshots, upload the resulting profiles to Simplifier, and package those.

Your FHIR cache is in ~/.fhir on Mac, I forget where it is on other platforms.

view this post on Zulip Kippi Bordowitz (Mar 28 2022 at 15:57):

found it! c:\users\<username>\.fhir\packages

view this post on Zulip Chris Moesel (Mar 28 2022 at 15:57):

Right, as @Elliot Silver noted, packages created by Simplifier do not contain snapshots (by default). You can manually force a download w/ snapshots (as I described above), but that's not available via an API (which is why it is a manual process).

Regarding the FHIR cache, if you can find your user home directory (wherever that is in Windows), it should contain a .fhir folder within it. It's possible that Windows hides that folder from normal views; I'm not sure.

view this post on Zulip Chris Moesel (Mar 28 2022 at 15:57):

Oh. You found it. Perfect!

view this post on Zulip Kippi Bordowitz (Mar 28 2022 at 16:19):

@Chris Moesel , @Elliot Silver - Great success. Thanks a lot you guys!

view this post on Zulip Ward Weistra (Apr 04 2022 at 18:06):

@Kippi Bordowitz @Elliot Silver

Simplifier doesn't create snapshots in their packages.

Actually, we are introducing a new, configurable package publication pipeline in Simplifier, which also includes the option to generation snapshots as part of the process.
Please reach out to me if you'd like to beta test this.


Last updated: Apr 12 2022 at 19:14 UTC