An interesting use case for FHIR is maintaining a list of a patients medications – i.e. the medications that they should be taking on a regular basis. Most EMR (Electronic Medical Record) systems will maintain such a list.
Each medication will have it’s own properties (such as drug name, dosage, how often to take, period of use and so forth), but for the purposes of this post we’ll focus on how to maintain the list on a day to day basis – including changes to the list – and consider the details of representing a single medication in a later post.
Knowing this list when treating a patient is, of course, of critical importance in healthcare as ‘medication related incidents’ – ranging from minor drug reactions through hospital admission and even death is a common cause of injury to the patient, as well as massive costs to the health system.
It is also important to know the history of changes to the list – i.e. when medications have been changed/stopped and new ones added, who made the change and the reasons why these changes have occurred. In some jurisdictions, this is called ‘reconciling’ the list from different sources of medication information such as dispense and administration information.
To represent this in FHIR, we’re going to need a number of resources.
Obviously we’ll need those that describe each medication. This is the MedicationPrescription resource that records the details of how a single medication should be taken. It includes references to the medication resource (representing the drug), the patient and the prescriber.
To represent the list that is active at any one time, we have a number of options.
Option 1: Query the MedicationPrescription resources for a patient
Each MedicationPrescription resource has a ‘status’ property whose value can be active, paused, completed or nullified. One option then is to get a list of all MedicationPrescription resources that have an active status like this:
GET /Patient/100/MedicationPrescription?status=active
(This uses the compartment feature to retrieve active MedicationPrescription resources for the patient with the ID of 100).
This would certainly work – but it becomes difficult to track changes over time – especially the reason for change.
Option 2: The document
Another option would be to place the medications in a FHIR document. We could have a section for the initial list of drugs and another section for the changed list of drugs. The advantage of this approach is that we can record the name of the person making the change, dates, locations etc. The disadvantage is that it’s a somewhat complex approach – requiring submitters and consumers to create and read documents.
Option 3: The List
There is a third approach that allows us to record these other data items as well as the actual list of medications – the List resource. This resource has been specifically created to maintain lists like this, and offers the following properties:
- The type of list (we’ll use the LOINC code for ‘history of medication use’ to be consistent with CCDA). This is the code property, and is a codeableConcept datatype
- The subject of the list – which will be a reference to the Patient resource
- The source of the list. In this case it will be a reference to the Practitioner who created the list. The cool thing here is that when the list changes, we’ll create a new version of the list setting the source property to the Practitioner who changed it.
- The date the list (or this version of the list) was created.
- The mode of the list. In our scenario we’ll set this to ‘working’ as we intend it to be the on-going master list but there are other values that can be of use – eg ‘snapshot’ at a point in time which we may want to use in a referral for example.
Then there are any number of entries in the list. Each entry represents a single medication in the list, and has the following properties:
- A reference to the medicationPrescription.
- A flag for the entry. This allows us to indicate the nature of any change to the item between versions of the list – which is incredibly useful in reconciliation situations, or in Use Cases like representing the changes in medication when a patient is discharged from hospital. For example, one of the options could be ‘ceased’ to indicate that the patient was taking the medication on admission, but it was stopped while in hospital.
- The deleted property. This allows us to explicitly state that this item is no longer active – it has been discontinued. In our case when we stop a medication we will also set the flag and the status in the
One thing that is missing in the entry is the reason for any change. For this we’ll add an extension to the entry element with a datatype of CodeableConcept and we’ll define a set of common reasons why a change occurred. In the example the extension is defined in a profile located at profile/mlomChangeReason
Putting all this together, the following example shows a medication list with two items:
- Atenolol – which has been stopped due to an allergic reaction.
- Labetolol – which was started in it’s place.
so the patient is actually only taking Labetolol. If you wanted the details of each prescription, you would get it from the reference in the list.
The list was created by Dr Welby on November 1st, 2011 for Mr I. Amanexample.
<?xml version="1.0" encoding="utf-16"?>
<!-- An example showinf a single item in the list - atenolol. As it is cancelled (due to an
allergic reaction), we know that the patient is not taking any medicines (as far as we know)-->
<List xmlns="http://hl7.org/fhir">
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<ul>
<li>Atenolol 50mg at night was stopped due to an allergis reaction</li>
<li>Labetolol 50mg at night was started as a replacement</li>
</ul>
</div>
</text>
<!-- This is the list Code - udentifying it as a list of medications -->
<code>
<coding>
<system value="http://loinc.org"/>
<code value="10160-0"/>
<display value="History of Medication Use"/>
</coding>
<text value="Medication List"/>
</code>
<!-- The patient the list refers to -->
<subject>
<reference value="Patient/example"/>
<display value="Mr I Amanexample"/>
</subject>
<!-- who created the list -->
<source>
<reference value="Practitioner/100"/>
<display value="Dr Welby"/>
</source>
<date value="2013-11-01"/>
<mode value='working'/>
<!-- The first medication entry -->
<entry>
<!-- The reason for change -->
<extension>
<url value="profile/mlomChangeReason"/>
<valueCodeableConcept>
<coding>
<system value="urn:oid:1.2.3.4"/>
<code value="ar"/>
<display value="Allergic Reaction"/>
</coding>
<text value="Developed a rash shortly after starting"/>
</valueCodeableConcept>
</extension>
<!-- Indicates this is a concelled medication -->
<flag>
<coding>
<system value="urn:oid:1.2.36.1.2001.1001.101.104.16592"/>
<code value="03"/>
<display value="Cancelled"/>
</coding>
</flag>
<!-- So any consumner of this resource knows it is a cancelled med. The deleted property is a code with
a fixed set of values, whereaes the flag is a codeableConcept, and the meaning depends on the terminology used.
Every FHIR consumer MUST understand what a deleted property means...-->
<deleted value="true"/>
<date value="2013-11-01"/>
<item>
<!-- The reference is to the actual prescription resource. This will have details of dose, prescriber etc. -->
<reference value="MedicationPrescription/100"/>
<display value="Atelolol 50mg at night"/>
</item>
</entry>
<entry>
<flag>
<coding>
<system value="urn:oid:1.2.36.1.2001.1001.101.104.16592"/>
<code value="04"/>
<display value="Prescribed"/>
</coding>
<text value="Started"/>
</flag>
<deleted value="true"/>
<date value="2013-11-01"/>
<!-- The reference is to the actual prescription resource. This will have details of dose, prescriber etc. -->
<item>
<reference value="MedicationPrescription/101"/>
<display value="Labetolol 10mg at night"/>
</item>
</entry>
</List>
We can retrieve this list as follows:
GET /Patient/100/List?code=10160-0
Notes:
- This is actually a query in FHIR, so would return a bundle containing the List resource – and there should only ever be one that matches for a patient.
In the next post, we’ll look at how we can record changes to the medication list, using the versioning mechanism in FHIR, as well as updates to the medicationPrescription resources as well.
Recent Comments