Firely Terminal is the new name for our FHIR command line tool Torinox. With this name change, we also released exciting 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. This includes 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 such as an internal memory of resources we are working with. The
fhir stackcommand 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.jsonor
fhir push StuctureDefinition-*.xml) and
fhir showdisplays 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. It sends resources to FHIR servers and back via their FHIR API.
fhir searchallows you to search a FHIR server for resources matching your criteria, for instance:
fhir search https://server.fire.ly Patient name=Chalmers
fhir putperform 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. This is useful when you want to work on them with Forge or have created a bunch of resources with FHIR Shorthand.
fhir loginlogs you in and gives you secure access on the command-line to your private projects and resources.
fhir projectslists all projects you have access to.
fhir syncallows you to send your local files to a Simplifier.net project (with
--up) or the other way around (with
fullsyncalso 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!
fhir validateis a killer feature. It allows you to validate any FHIR conformance resource or example instance against the FHIR rules and your own profiles. Right from the command line and exactly the same as the visual validation in the Forge FHIR editor, the Simplifier.net FHIR collaboration platform and the API based validation in Firely Server.
(For validating your entire project at once, see the future outlook below)
- Creating and unpacking FHIR bundles is made easy 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:
Filtering and file format conversion (9:15)
fhir filteris a way to take only a few specific resources from your 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. In addition, this 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 expandtakes 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.
fhir queryyou 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
Automation with Firely Terminal
Firely Terminal opens up a world of FHIR automation to the community. Large customers already use it to validate and generate snapshots on every release or even every commit. But, more is coming! We will soon add the following:
- 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. 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. We will soon 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!