So a little while back I wrote about an app I developed during the WGM Connectathon to send an HL7 v2 message to a converter app, and display the response (a FHIR Bundle) in a number of visualizations after validating it using the community supplied validation tool (actually, exposed by the reference servers via the $validate operation). It occurred to me that this visualization might be of use to implementers who are developing query applications – such as the CSIRO Primary Care project for example, so I pulled it out into a separate application.
The app is available here (I’ll hook it up to the main clinFHIR launch page at some point), and this is what the main screen looks like.
In the navbar at the top are the currently configured servers (set by clinFHIR in the usual way). The Conformance server is used for validation (via the $validate operation) , while the Data server is where bundles can be stored (we’ll come to that in a minute).
To the left is where bundles can be supplied. There are 2 options, each in a separate tab.
- You can paste a bundle directly into the visualizer (click the ‘Import Bundle’ link and paste the bundle into the dialog that is displayed). Both XML and Json can be supplied. If you supply an identifier in the dialog, then the bundle will be saved on the Data Server and the identifier will appear in the bundle list (where all the ‘Document n’ entries are in the screen shot). As it’s saved on a public server, it can be selected any time – by any user of the app. (A good time to emphasise that there should be no real data in the bundle). This option is most useful when you already have a bundle from somewhere, and want to take a look at it.
- You can also specify a query to run that returns a Bundle when selected. The query will be saved in the list, and is local to the browser – i.e. it won’t be available to other users / browsers. This is particularly useful when developing a query endpoint as you can specify the query to run, and then execute it whenever you want and view the results. (Note that the endpoint must support CORS as the query is from the browser)
However you specify the bundle, it is validated by the Conformance Server (It’s up to you to make sure the FHIR version of the Bundle and the conformance server are the same), and then a number of visualizations are presented which can be selected from the ‘visualizations’ tab.
The screen shot above shows the raw Json of the bundle (even if you supplied XML).
The ‘Bundle visualizations’ tab displays the individual entries in the bundle as shown in the screen show below.
The entries are in a list and show the resource type, fullUrl and number of validation errors (in the badge to the right).
Selecting an entry shows a number of sub views about that entry to the right
- The Json of the entry element
- A tree view of the resource
- A graph of the resources that have a reference to or from the resource in the entry. The number in the graph is the number of validation errors.
- The validation errors found for that resource
The graph tab shows a graph of all the resources in the bundle, as shown below:
This can get quite complex for large bundles (which is why there is the other resource centered graph described above). Selecting a resource in the graph will display the Json of the entry containing the resource to the right.
The top Validation tab shows all results for the entire bundle.
If you want to use profiled resources rather than core ones, then there are a number of pre-requisites you need to meet (there are of the Validation routines – not the app).
- The profile (StructureDefinition) that the resource instance should be conformant to must be on the conformance server – as must be all the Extension definitions (also StructureDefinitions) that it references.
- The resource instance being validated must have a reference to the profile in its meta element (using the profile item).
Reach out in the clinFHIR chat (or comment here) if you have any questions/comments.
