By: Amos (Kippi) Bordowitz
FHIR® packages and snapshots
Unlocking the true power of FHIR profiling means also understanding the relationship between FHIR packages and snapshots and putting them to good use. Let’s talk about these now.
Packages
FHIR packages are a way to group and distribute related FHIR resources, such as profiles, extensions, value sets, and code systems. They allow you to share a set of resources with others in a way that is easy to install and manage.
A FHIR package is a ZIP archive that contains a set of FHIR resources and metadata about the package. The package can be uploaded to a FHIR server or shared with others through a URL.
FHIR packages can be used to distribute resources that are specific to a particular implementation or that are used by multiple implementations. They can be created using FHIR Shorthand (FSH) and then compiled using SUSHI.
FHIR packages are a useful way to share resources across different implementations, as they allow you to group and distribute resources in a way that is easy to install and manage. They can be used to share resources that are specific to a particular implementation or that are used by multiple implementations.
Snapshots
FHIR snapshots are a way to capture the current state of a FHIR structure definition at a particular point in time. They can be used to ensure that the structure definition does not change over time, which can be important for maintaining interoperability and compatibility.
To create a FHIR snapshot, you will need to have a FHIR structure definition that you want to snapshot. This can be a profile, extension, or logical model that you have defined in FHIR Shorthand (FSH). You will also need to have a FHIR implementation guide (IG) that includes the structure definition.
Once you have these, you can use the FHIR IG publisher to create the snapshot. The IG publisher is a tool that takes a set of FHIR structure definitions and generates a complete IG, including the snapshots of the structure definitions.
To use the IG publisher, you will need to install it and then run it on your FSH project. The exact steps for doing this will depend on the version of the IG publisher you are using and your operating system. You can find detailed instructions for using the IG publisher in the FHIR documentation.
Installing packages
The FHIR community chose to use the Node Package Manager (NPM) standard as the basis for FHIR package management. The current FHIR Package standard is a subset of the NPM standard.
The FHIR Package Registry is a platform that allows you to browse through and access a wide range of resources developed by the FHIR community. It includes a search function to help you find specific resources and provides options for referencing, downloading, and installing them. On each package page, there is a widget on the right side that offers two easy ways to install FHIR Packages, via either NPM or the Firely terminal. You can simply click the button to copy the installation command to your clipboard and use it on your favorite command-line terminal.
Here is an example of using either method to install the latest version of the ILCore package, version 0.10.1:
NPM:
npm –registry https://packages.simplifier.net install il.core.fhir.r4@0.10.1
Fierly terminal (you must first install the command line terminal):
fhir install il.core.fhir.r4 0.10.1
Creating packages with or without snapshots
FHIR® Shorthand
To create a FHIR package with snapshots in FSH, you will need to use the -s or –snapshot flag when running the sushi command. This flag tells the SUSHI compiler to include snapshot logic in the generated output.
For example, the following command will create a FHIR package with snapshots:
sushi -s path/to/fsh-project
To create a FHIR package without snapshots in FSH, simply omit the -s flag:
sushi path/to/fsh-project
Note that the sushi-config.yaml file in your FSH project may also contain a snapshot field, which can be set to true or false to specify whether snapshots should be generated. This field is optional, and the value specified in the sushi command will take precedence over the value in the sushi-config.yaml file.
IG-publisher
The HL7® IG-Publisher tool automatically generates packages with snapshots.
Simplifier.net
Simplifier.net is a website that provides a platform for creating, managing, and publishing FHIR (Fast Healthcare Interoperability Resources) resources. Users can create and edit FHIR profiles, extensions, value sets, and other resources using a web-based interface, and can also use the site to publish their resources for others to use.
In simplifier you may upload either regular JSON files containing only the differential (diff) between the and the Profiles and the Base Resources on which they are based, or, full snapshots. No matter what version has been uploaded, simplifier knows how to produce snapshots for you. When you find a package which you want to use, simply click on “Download”, located on the top-right corner, then pick “Download snapshots” from the drop-down menu.
Want to know more?
Read about Package dependencies here.
Follow us on LinkedIn–