Blog

Automating your FHIR workflow with Firely Terminal

Firely Terminal is the new name for our FHIR command line tool Torinox. And with this name change we also released exiting new features and an overview video of this nifty, cross-platform automation tool.

For a full overview of the core features of Firely Terminal, and the new ValueSet expansion and powerful FQL querying, watch the video or continue reading below! To directly get started, go to the installation instructions or the Firely Terminal documentation.

Firely Terminal is a tool for working with FHIR on the command line. It is built on our open-source Firely .NET SDK and works on any operating system: Linux, Mac or Windows. It is the most powerful tool for automating anything in your FHIR development process, like synchronizing with Simplifier.net projects, talking to FHIR APIs and validating FHIR specifications and examples.

Below we will expand on the video and end with a future outlook.

Intro to Firely Terminal (0:16)

The first things to use are:

  • fhir help: This will provide you with all the commands and how to use them. And this can also be used to learn more about any other subcommand, for example with fhir help search.
  • fhir stack: Firely Terminal works in most cases with an internal ‘stack’ of resources, like an internal memory of resources we are working with. The fhir stack command will show you what’s currently on there. In the beginning this will be empty, but you can add one or more files to it with fhir push (for example, fhir push Patient.json or fhir push StuctureDefinition-*.xml) and fhir show displays the first resource on the list.

Using Firely terminal as a FHIR client (0:51)

For starters, Firely Terminal can function as a command-line based FHIR client, sending resources to FHIR servers and back via their FHIR API.

  • fhir search allows you to search a FHIR server for resources matching your criteria, for example:
    fhir search https://server.fire.ly Patient name=Chalmers
  • fhir read, fhir post and fhir put perform the client operations you’d expect on the server and resource of your choice.

Synchronization with Simplifier.net FHIR projects (2:37)

Firely Terminal is also a great way to easily synchronize a local folder with a public or private Simplifier.net project. Useful for when you want to work on them with Forge or have created a bunch of resources with FHIR Shorthand.

  • fhir login logs you in and gives you secure access on the command-line to your private projects and resources.
  • fhir projects lists all projects you have access to.
  • fhir sync allows you to send your local files to a Simplifier.net project (with --up) or the other way around (with --down). With fullsync also the files that do not exist on the server will be removed from your local folder, so use that one with care.

If your project now contains a package.json file, which contains your project dependencies and is automatically created by Simplifier.net, we can install those dependencies locally too with fhir restore. If you don’t have a package.json yet, just fhir install any FHIR packages (from the Implementation Guides and projects you are building on top of) and Firely Terminal will download them to your cache so your project can refer to them.

Validation and (un)packing bundles (4:41)

Now you have resources from your Simplifier.net project on your local machine we have something to work with!

Snapshot generation (7:37)

Not every tool is able to take all the rules FHIR profiles layer on top of each other to create a resulting FHIR data model, the snapshot. Firely Terminal makes snapshot generation just a single command: fhir snapshot.

Filtering and file format conversion (9:15)

  • fhir filter is a way to take only a few specific resources from you FHIR project, based on the powerful Firely Query Language.
  • Taking these resources of interest, you can save them to XML or JSON with fhir save. This also allows you to quickly convert a bunch of XML files to JSON and back.

ValueSet expansion (and saving back to Simplifier.net) (11:27)

New in the latest release, available for all our paying customers: Filling the ValueSet expansion part with the actual terms that are part of it:

  • fhir expand takes your ValueSet, finds the CodeSystem it refers to (as long as the CodeSystem is ‘complete’, having all codes directly in it) and updates the ValueSet to have all its codes.

Querying with the Firely Query Language (13:20)

Firely has expanded FHIRPath to a SQL like query language that allows you to quickly query over many FHIR resources: the Firely Query Language.

  • With fhir query you can run a FQL statement on your entire project and its dependencies. For example:
    fhir query 'using scope from StructureDefinition select name, url' --output json

What’s next?

Automation with Firely Terminal

Firely Terminal opens up a world of FHIR automation to the community and is already used by large customers to validate and generate snapshots on every release or even every commit. But more is coming! Soon we will add:

  • Support for full Quality Control: In Simplifier.net we have just released Quality Control, which allows our users to run FHIR validation and their own custom business rules validation with the click of one button. Immensely powerful, but what if you could run this on the command-line every time you made a change? Coming soon.
  • And continuing from that: What if you could run Quality Control and any other Firely Terminal feature on every commit and Pull Request in Git? You would know for each contribution whether the resources are still correct and whether your examples still conform to your spec. Soon we will make a template available for putting Firely Terminal in Github Actions or any other Git automation flow.

Get started with Firely Terminal right now and let us know how it helps your FHIR automation!

Post a comment

Your email address will not be published. Required fields are marked *