Organization Firely

FHIR Packages Technical blog

avatar   mharthoorn  

Today we released Simplifier's public package server. The package functionality is in public beta and not yet in use in our official toolchain. It is, however, already build into our technical tool Torinox. A command line tool with a broad range of FHIR utilities. In this news post, I will explain how packages can be used and demonstrate this with Torinox.

Technical details

Since this week, Torinox is a FHIR package client. This means that it can download and install packages for you. That doesn't sound very complex, but behind the curtain a lot of stuff happens. Most of the complexity is hidden. But since you're interested, we'll go into a bit more detail!

Let's look at the use case where you are working on a FHIR profile project. You want to derive from a profile in your regional infrastructure. In the past, you would have to download each profile, extension, valueset and more separately, or you would get a zip and put them inside your project. That is already cumbersome, but it gets worse if a new version of those profiles is published. It is even more hassle if those regional profiles in turn are based on a national infrastructure that may be changed.

This is something tools should fix for you without you having to worry about the logistics. Just tell the tool to upgrade your package and everything is updated automatically. If there is an updated reference to the national infrastructure in that package, it will be resolved as well.

Torinox

One of those tools can be Torinox: our command line tool. We implemented a package client in Torinox. Eventually, we will make sure that all our tools work with packages. We even expect that most, if not all, tooling in the FHIR ecosystem will work based on packages. For a start, a command line tool is a good way to prove the concept. To install Torinox, follow these instructions.

Step 1. Installing a package

Let's say you are working in a folder with FHIR profile files, which you can see as a FHIR profile project. If you need other profiles, you can install a package with Torinox. This will download and install a specific version, that you choose, on your computer. It will store the package in a global FHIR package cache.

It will also create a package.json file in your current folder that keeps track of all the dependencies of your project. If you already have a package.json, a new reference will be added. The name of this file was chosen carefully: it's also the file name of a package manifest. It means that your folder is ready to become a package itself.

Step 2. Restoring your dependencies.

Just installing a package is often not enough. Because an installed package might very well have dependencies on its own. Torinox will install these dependencies as well. There is an extra step: calculate all the direct and indirect dependencies in your project. This is what we call 'restoring'.

Restoring creates an extra file that holds a complete list of all dependencies. It makes sure that each reference is only there once, and it checks if each dependency is installed once. This is especially handy if you get a project from someone else. You just have this small 'package.json' file with the references you put in, and the restore will install everything and make sure all dependencies are accessible in your project. Now you are ready to use packages for snapshot generation and validation.

Watch

Watch this console demo to see how installing and restoring packages work. It makes it easier to try it out yourself! Perhaps we will even see a package that you created in Simplifier in the next few days. You can see the latest packages here: https://simplifier.net/packages.

Core Packages

Since the FHIR core packages are still work in progress, we created a temporary set of core packages:

  Simplifier.Core.STU3.DataTypes
  Simplifier.Core.STU3.ValueSets
  Simplifier.Core.STU3.CodeSystems
  Simplifier.Core.STU3.Extensions
  Simplifier.Core.STU3.Profiles

And a meta package that contains them all, so you only need 1 reference in your project:

  Simplifier.Core.STU3

You can use this package to get a reference to the STU3 specification.

Try out

To give you something to try out for yourself, we created two demo projects with a package in Simplifier.

The first project is Demo.National.PatientCare. This package has a dependency on the FHIR core profiles. Here you can see the dependencies. We copied one Patient Profile in it from the German base profile set.

The second project is the Demo.Regional.PatientCare package. This one has one dependency on Demo.National.PatientCare. But you can see it has also inherited a bunch of indirect dependencies. In this project package, we put one Patient Profile from the nNGM project.

If you install this package on your computer and then do a restore,

  > fhir install demo.regional.patientcare
  > fhir restore
  

you will also have the Demo.National.PatientCare package installed and all core packages mentioned above.

If you would now try to validate a Patient from the Koeln project, you will see it resolves all the relevant Patient Profiles.

  > fhir get https://stu3.simplifier.net/open/Patient/484c4d0e-53f2-4e19-a5dd-09f9dcf74ae6
  > fhir validate

In the end, the validation will not be successful because we did not bring in all the other profiles, like for example the national regional humanname profile, into the demo project packages. Once the main projects on Simplifier have their own packages, you can try it more realistically with those packages!

Other news from Firely
Michel Rutten
Introducing the new FHIR NPM package manager!
Martijn Harthoorn
We just released the Simplifier Package Server Public Beta. Now you can really version and publish your profiles. Get started by experiment with a published set of profiles from others by installing a package!
Martijn Harthoorn
The technical details on how to use packages. Watch the demo to see how Torinox can be used to install and restore a package.
Michel Rutten
Forge release 19.4 for STU3 is now available. In this update, we have redesigned the main user interface to include a new Folder Explorer and Extension selection dialog.
Michel Rutten
Forge 19.3 represents a hotfix release with bug fixes for some issues reported by our customers.
Michel Rutten
Forge release 19.2 introduces a couple of new features. This update also restores connectivity to Simplifier, which was broken.
Martijn Harthoorn
The Simplifier team has been working on a command line tool (called Torinox) to make common operations on FHIR resources easier.
Michel Rutten
The Forge 19.1 release solves a couple of annoying issues reported the community. We strongly all users to recommend to install this update.
Michel Rutten
Blog article about Forge release 18.6 for FHIR STU3 where we discuss new features and changes, underlying architectural changes and the general application roadmap.
Martijn Harthoorn
Release notes of Simplifier for release 18.2, 18,3 and 19.1