- Created by David hay on May 22, 2015
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
Version 1 Next »
By the end of the last post, we had created a resource on the server. We used a Condition in the example, but it doesn’t really matter what it was (provided it was one that was linked to a patient). The question then becomes – “How can we look at those resources?” – and the answer is that there are a number of different ways.
If you have a bowser plugin like Postman, and are familiar with the FHIR RESTful query syntax, then you can issue the appropriate query syntax directly. But many aren’t that familiar (and don’t want to be), so clinFHIR offers a simpler way.
Load the Resource builder, select the patient you have been entering data against, and take a look in the upper left hand corner. You’ll see 2 buttons labelled ‘Resources’ and ‘New’. Click the ‘Resources’ button.
What you’ll get is a list of all the different resource types that this patient has, and the number of instances. There should be at least one of the type that you have entered. Click it.
Alongside the first list is now a list of the specific resource instances of that type – eg if you clicked the ‘Condition’ resource type, you’ll see a list of all the Condition resources for this patient. A couple of things:
- Under the hood, clinFHIR uses a special operation called Fetch Patient Record to return these resources. It’s possible that the server is not including the resource type you used and it isn’t in the list. Let us know (via the support group) if this happens to you.
- Each entry in the list is using the resource narrative as the display. This can result in some really ugly displays. Try to ignore that – we’ll fix it before too long.
Select one of the resource instances – perhaps the one you created earlier. To the right of the screen are 3 tabs.
- The JSON tab shows the rsource in JSON format
- The XML tab shows the resource in XML format
- The 3rd tab – References is much more interesting.
As we’ve discussed before, FHIR is all about references between resources creating a ‘web’ of interconnected resources. The references tab allows you to visualize these references – albeit in a simple way. Select the tab.
There are 3 columns in the tab.
- ‘Inward references’ shows the resources that have a reference to the one you just selected (chances are it’s empty)
- ‘Focal resource’ is the one you just selected
- ‘Outward resources’ shows resources that are references from the selected one – you should see at least the patient resource in there.
Now click on a resource in the ‘Outward references’ column – maybe the Patient resource. That will cause it to become the focal resource and all the columns adjust themselves accordingly (and the XML & JSON tabs will update as well). In this way you can browse amongst the resources to see how they are interconnected – which can be fun!
A few caveats:
- Because this works by pulling all of the resources into memory, it will likely fall over if there are too many of them (or at least become very slow). It might be advisable to use a new patient if you want a more complex web in resources (or a ‘graph’ of resources, if you are geeky)
- When the resource is not one directly linked to a patient (like a Medication resource), clinFHIR has to go grab it from the server – this can take a few seconds, and explains why sometimes there will be a delay and then a resource just pops into view.
- For various reasons, the app can get a bit confused – especially if you are creating a new resource and then immediately viewing them. It’s quite safe to re-start the app and see if that solves the problem.
If you do need to use a new patient, then it’s quite simple. When you load the Resource Builder (after re-loading clinFHIR) then you get a list of all the patients that have had data entered against them. (Actually it’s a bit more complex than that – and an area that requires some tidying – but don’t worry about that for now.
This list is actually in a tab labelled ‘Previous patients’ – and there’s another labelled ‘Select by Name’. If you select that tab, then you can select a different patient by name – try smith. You can then enter data against that patient in the same way as you have so far – and the next time you use clinFHIR, the patient will be in the initial list.
But wait, there’s more!
You can actually create your own patient using a trick. Select any patient to start with, and then from the Resource Builder select the ‘Patient’ resource type. Enter the data you want and save the new patient. From the gear menu, select the option ‘Select new patient’. This will return you to the patient selection screen, from where you can select – and subsequently use – your new patient! (or just reload clinFHIR – the effect will be the same).
So to summarise where we have got to in this ‘not-so-mini’ tutorial, we’ve used clinFHIR to create new resources, and to browse the resources we’ve created. However, we’ve only used the ‘standard’ resources so far, so we really need to start thinking about profiling – creating and using profiles of the base resources, as that is really the main power of FHIR.
But before we do that, there’s one last thing we should cover in the ‘Create Resource’ component of clinFHIR. Because FHIR is all about connecting resources together, it’s quite possible to be in the middle of creating a resource, and then needing to link to a resource that doesn’t exist yet. A great example is creating a MedicationStatement. This needs to reference a Medication resource, but chances are you don’t have the Medication resource you need.
The solution is the ability to park a ‘work in progress’ resource, and we’ll look at that in the next post.
- No labels
Add Comment