Site icon Hay on FHIR

Building a set of resources in FHIR

One of the primary goals for clinFHIR is to help people who are new to the standard understand how it works – and increasingly these are clinicians whose interest is less in the technology and more about how FHIR can be used to represent the clinical information they wish to exchange.

While the current app does allow this, it has been aimed more at the people actually developing the resources than the casual user, and so can be time consuming to develop sets of resource instances that represent real world scenarios.

The component described by this post (called a simple builder – though a better name is needed!) is intended to allow someone completely new to FHIR to build sets of resources that represent clinical scenarios, to help them understand how the resources can be linked together – rather like Lego is used to build a complete model.

Before we get into the details – there are a number of caveats with the current version.

The intention (if there is interest) is to remove the limitations – it’d be great to store the resources individually on the server for example, and support profiles, logical models and resource updating. It just takes time 🙂 ).

Let’s work with an example – representing a patient’s medication list, which is something we’ve talked about before. The resources that we’ll need include:

To start the builder, load clinFHIR and log in (You can easily create an account based on your email address). Select the servers to use (I generally use the HAPI STU-3 servers for data & Conformance and Grahames server for terminology). Click the ‘gear’ icon to the upper right and select the builder from the menu that appears. The builder will open in a new page.

Here’s what the front screen looks like:

At the top of the screen is a navbar with the name of the current FHIR servers in use, some Library commands (that we’ll talk about later) and an icon for the user to the upper right – it is display only at this stage.

There are 3 main panes:

Create a new set by clicking on the ‘New Set’ at the top of the left pane. You’ll be prompted for a name for the set, and a description of its purpose. After saving, the new set will appear in the left hand list. (btw – in testing, I noted that sometimes it doesn’t appear but does after the page is refreshed. I’ll fix that eventually…)

To add a new resource, click on the ‘Add Resource’ button at the top of the middle pane. The right pane then shows a drop-down of all the resource types defined in FHIR. Select the one you want (say, Patient) and then enter a textual description of the resource (name, date of birth, gender etc.) into the text box that appears.

Finally, click the ‘Add’ button to add the resource to the set. After a brief delay (while the app retrieves the resource definition from the Conformance server) the details of that resource type will be displayed, including a tree view of the resource structure.

Repeat the process for all the resources identified above. You should end up with a display similar to the screen shot above.

To ‘wire up’ the references between the resources, you select the resource that the reference is from, then the source element within that resource, and finally the target resource. You’ll notice that when you select an element that is a reference type, the app will show a list of all the types of resource that that element can reference, plus a list of all the resources in the set that match any of those types.

For example, select the List resource, then the subject element. You’ll see to the right of the tree:

Here’s a screen shot:

And that’s all there is to it! If you select the graph view in the middle pane, you’ll see a line drawn between the referenced resources (from source to target). The graph updates in real time as you create the references, which is kind of fun! Here’s what the Medication list looks like after all the references have been established:

To remove a resource, select the Resource Summary tab in the right pane, which will show all the resources that are linked to/from this resource. There’s an ‘X’ icon against each reference that will remove that reference.

If you want to enter the data for an actual element, select the element in the Structure pane. This will show the data element types that can be used for that element, and clicking on the datatype will display a dialog where the value can be entered. This is much the same as in the clinFHIR resource builder, though in a modal dialog. Note that not all datatypes are currently supported.

If the datatype is coded and there is a ValueSet binding (which should always be there) then you can browse the ValueSet – again, much like clinFHIR.

Here’s a sample screen shot:

And a reminder of the caveat around entering structured data – this doesn’t work all that well for more complex resource types (like care plan) – with deeply nested structures. It really  only works properly for elements directly off the root of the resource. This is a work in progress.

The sets you create (and you can have as many as you want) are saved locally (in the browser) as you make updates so there’s no explicit ‘save’ option needed. You switch between different sets simply by selecting the set in the left pane.

To save the sets you create to the FHIR server (actually the Data Server) you use the ‘Library’ function. We’ll talk about that – and creating proper FHIR Documents – in the next post.

Exit mobile version