Viewing resource instances in clinFHIR

One thing you need to do quite frequently in the FHIR world is to look at resource instances (whether in XML or JSON), and this can be quite complex.

A little trick I use quite frequently is to use the clinFHIR scenario builder to create a hierarchical “tree view” of the resource, which I find easier to review than the raw format.

To do this, follow these steps.

Load clinFHIR and select the Scenario Builder (It doesn’t really matter which server you choose as we’re not going to be saving the resource to a server, but it’s probably a good idea to choose one that matches the FHIR version of your resource, especially if you are importing an XML bundle). This is because scenarios are saved on the local machine.

Next create a new scenario.

On the nav bar at the top of the screen, select the option ‘Import resource’. This will open a dialog into which you paste your resource. You have a couple of options here.

  • You can past in a single JSON resource (preferred approach)
  • You can paste in a bundle containing the resource/s in either XML or JSON format. If you do paste in XML, then clinFHIR will use the ‘Bundle’ endpoint of the current conformance server to save the bundle as XML, and then read it back as JSON – which is why the server FHIR version should match the resource.

Then click the ‘Import’ button which will appear to the upper right. All going well, the resource/resources will be imported into the scenario. You will get issues if the resource/bundle is mal-formed, but otherwise it seems to work OK. It should also be able to maintain resource reference. Do note that it doesn’t validate the resource instance…

Now that the resource has been imported, you can view them in the right pane. Select the resource in the middle pane (eg the graph view) and then select the ‘Current resource views’ tab in the right pane.

Screen Shot 2017-06-15 at 1.34.15 pm

There are a number of view options here

The Tree view is the hierarchical view I referred to above: here’s an example of a Questionnaire:

Screen Shot 2017-06-15 at 1.30.02 pm

The Text view shows the contents of the text element (if any)

The Json view shows the raw JSON

Screen Shot 2017-06-15 at 1.30.48 pm

The Summary view shows incoming & outgoing references.

Note that, in theory, you are able to modify the resource using the ‘Structure & Reference’ tab -including saving to the FHIR server – as you can any other resource. I have come across some issues with more complex resources though (ironically the Questionnaire resource) – so your mileage may vary. Do let me know if you have issues & I see what I can do to resolve them.

You can import as many resources into a scenario as you wish – again, it’s best to make them all the same FHIR version, though clinFHIR won’t enforce that.

 

About David Hay
I'm an independent contractor working with a number of Organizations in the health IT space. I'm an HL7 Fellow, Chair Emeritus of HL7 New Zealand and a co-chair of the FHIR Management Group. I have a keen interest in health IT, especially health interoperability with HL7 and the FHIR standard. I'm the author of a FHIR training and design tool - clinFHIR - which is sponsored by InterSystems Ltd.

Leave a Reply

Discover more from Hay on FHIR

Subscribe now to keep reading and get access to the full archive.

Continue reading