Site icon Hay on FHIR

A simple app to help using the Mapping Language

So I’ve just been at the FHIR devdays in Amsterdam which was really interesting (of course – attending a devdays is a ‘must do if possible’ for FHIR implementers). One of the presentations I attended was on the FHIR mapping language – more specifically an implementation of the FHIR mapping language by Firely and Healex   (currently in a ‘technical preview’ state).

I’ve always been interested in the mapping language, and its ability to create portable mapping files – allowing specialists to create the mapping instructions, which can then be used by any compliant engine, as the following image illustrates:

Note that there is no requirement that either input or output should be FHIR resources (though they commonly will be). Note also that I’m using the term ’message’ to indicate the input and output – not a Message in the FHIR sense

So, there’s 2 main steps to setting this up:

There’s a reference implementation available from the FHIR community which you can download and use, but I’ve had difficulty using it, as it is a command line tool with a number of switches that I’ve found it complex to set up and use.

What the firely folk have done though is to move all that complexity behind a couple of FHIR operations, meaning that you don’t need a local setup – which is super cool! And they’ve created documentation and samples that is always useful when you’re starting out…

This approach nicely ties in with the idea of ‘server types’ that I use in clinFHIR, and I think reflects an ecosystem approach. Currently we have:

And so now we have the Mapping server that can perform transformations using the mapping engine.

The firely approach uses 2 operations.

Creating the StructureMap, and setting up the Mapping server to execute the transforms does involve a number of steps.

 

Once the map is created and converted, sample data can be executed against it.

To make this process a bit easier, I’ve created a simple application that allows the maps and samples to be edited in a browser, then converted and executed against the mapping server. You can select the servers to use – though currently only Vonk supports the required operations.

Note that this is a sandbox – there is no guarantee of availability, nor that the maps you create will be saved indefinitely – in fact it’s almost certain that it will be cleared from time to time. There’s a download / upload built into the tool – make sure you use it for anything you want to save! (e.g. when you show off your work to a colleague…). For the same reason, don’t use real data. Planning on simplifier integration as well…

The application can be accessed here, and there’s more detailed documentation here.

Here’s an example of the main UI, showing a sample file to the left and the map to the right.

and here’s the output – in this case represented as a graph of resources, though there are other views available, as well as validation and FHIRPath (using the excellent javascript library). You can also send the output directly to a FHIR server if you wish to save the resources directly.

This is very much a work in progress (even over the holiday break 🙂 so there will be bugs!). If you do have a play and have issues / ideas then use the FHIR chat to discuss them.

I’ll write some follow up posts in the new year discussing some real maps, but in the meantime hope you all have a great break over the festive season!

 

Exit mobile version