Organization Firely

Torinox: FHIR command line tool ready for use

avatar   mharthoorn  

This week we published Torinox, our command line FHIR utility. It can help you with all kinds of FHIR operations:

  • Helping you with resources on disk
  • Getting resources from and to a FHIR server
  • Bundling resources and splitting bundles
  • Installing or creating FHIR packages
  • Synchronizing Simplifier projects with local folders
  • Converting XML to JSON and vice versa

You can choose to work in Windows with Powershell or the classic command prompt. Torinox also works under Linux and a lot of other operating systems.

Get started

To start using Torinox, follow these steps:

  1. Install dotnet core 2.1 SDK.
  2. Run dotnet tool install -g torinox
  3. Run fhir -? for information

Getting resources from a server

To get a resource from a server, first you have to define the server once. In this example we will use the publicly available Vonk server:

    > fhir server add vonk https://vonk.fire.ly

Now that you have your server alias, you can start communicating with it. A first step is doing a simple read operation:

    > fhir read vonk Patient/example

This will get a patient from the server with id 'example'. If that one does not exist, you can of course try another one. To give you the freedom to do with this resource what you want (save, upload it to another server, validate it...), we keep it on an internal stack, for you to use on your next operation. Let's do a simple show.

    > fhir show

This command will show the contents of the most recent resource.

Saving resources

There are several ways to save a resource. The resource from the previous example can be saved by typing:

    > fhir save

Once you saved a resource, it's dropped from the stack. You can be more specific by providing a file name. The extension you provide (xml, json) will be honored in the serialization. So by typing:

    > fhir save patient1.json

the resource would be saved in JSON format.

Bundling

A frequently requested operation is putting a set of resources in a bundle. Let's see how we can do that with Torinox: Let's get all patients on our test server who's name is Chalmers (in the official FHIR spec examples there are several!)

    > fhir search vonk Patient name=Chalmers

Note that all FHIR query parameters work here. So if you don't get enough results, you can just do a generic search: get the first 20 patients from the server, without any discrimination:

    > fhir search vonk Patient _count=20

You should have at least 20 patients now on your local stack. So lets bundle and save them.

    > fhir bundle
    
    > fhir save bundle.xml

That wasn't too complex, was it? You now have 20 patients in a bundle in an xml file in your current folder.

Other operations

Torinox has a lot more to offer, posting FHIR resources on a FHIR server, installing FHIR packages, synchronizing a local folder with Simplifier projects or creating your own FHIR package. We'll talk about packages in a next blog post. But Torinox should be simple enough to figure out most operations yourself.

Questions

The tool is very new so it's a bit rough around the edges. Any feedback is welcome. Good luck using it. For any questions, or suggestions, just use the feedback button in Simplifier.

Other news from Firely
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
Michel Rutten
New Forge STU3 release 18.6 available for download from simplifier.net.
Martijn Harthoorn
Logo's, Avatars, Import console, skipping unchanged files, reference tab improvements, Full sync from github, organization scope and nationality and more...
Michel Rutten
A Forge STU3 hotfix is available that solves an annoying issue reported the community.
Michel Rutten
Forge 18.2 for STU3 is available for download from https://fire.ly/forge/. This update provides a couple of stability and feature improvements.
Michel Rutten
There is a new Forge 18.1 release for STU3 available for download from https://fire.ly/forge/. This update introduces our new Firely company identity and also provides a couple of improvements.
Lilian
At the DevDays 2017, we launched our new product: the Profiling Academy. The Profiling Academy is available for all Simplifier users (free to join) and is meant for anyone willing to learn more about FHIR profiling. We aim to share our knowledge in a way that is easy to digest for all levels of FHIR users: beginner, moderate and advanced.