Skip to main content
AMIA Annual Symposium Proceedings logoLink to AMIA Annual Symposium Proceedings
. 2014 Nov 14;2014:963–968.

Visualization of Patient Prescription History Data in Emergency Care

Selcuk Ozturk 1, Mehmet Kayaalp 1, Clement J McDonald 1
PMCID: PMC4419971  PMID: 25954404

Abstract

Interpreting patient’s medication history from long textual data can be unwieldy especially in emergency care. We developed a real-time software application that converts one-year-long patient prescription history data into a visually appealing and information-rich timeline chart. The chart can be digested by healthcare providers quickly; hence, it could be an invaluable clinical tool when the rapid response time is crucial as in stroke or severe trauma cases. Furthermore, the visual clarity of the displayed information may help providers minimize medication errors. The tool has been deployed at the emergency department of a trauma center. Due to its popularity, we developed another version of this tool. It provides more granular drug dispensation information, which clinical pharmacists find very useful in their routine medication-reconciliation efforts.

Introduction

Preventing Medication Errors, a report published by Institute of Medicine, drew the attention of the healthcare community, policy makers, and the general public to the gravity of serious clinical mistakes due to preventable medication errors.1 As recognized by the Joint Commission, taking an accurate and current medication history can be difficult to accomplish, especially when patients are severely ill, injured, disabled, extremely young, or unable to articulate themselves in English.2 These conditions occur more frequently in emergency rooms. In the case of a disaster, even a well-prepared emergency department can become overwhelmed.

We developed a software system that aims at helping clinicians obtain necessary patient medication history quickly and accurately both in disaster and in routine emergency care. Our effort is part of a joint enterprise called Bethesda Hospitals’ Emergency Preparedness Partnership (BHEPP).3 Other members of BHEPP include Clinical Center at National Institutes of Health (NIH), Suburban Hospital Johns Hopkins Medicine and Walter Reed National Military Medical Center. We developed and deployed our system at the Emergency Department (ED) of Suburban Hospital.

The system first receives patient registration information from the hospital’s Health Level 7 (HL7) messaging system and then queries the prescription history of the registered patient at Surescripts. Surescripts, in turn, searches that patient’s prescription history in the databases of its network of pharmacy benefit managers (PBMs).4 If the patient is found, we receive the full-year of prescription history of the patient. Our software system parses the list of prescription fulfillment activity, converts it into a visual timeline chart, and sends it to a printer in the ED. The entire process takes approximately 4 seconds.

Surescripts usually provides a short summary of the report, which lists each drug’s fulfillment count and the first and last fulfillment dates within the last twelve month period. However, some pharmacy benefit managers do not deliver NDC (National Drug Code) numbers with each drug name. In those cases, the summary reports become long lists of individual drug dispensations. In a high polypharmacy case of an elderly patient, drug history data can easily be 15-to 20-pages long. Such a long list of medication dispensation data is difficult to read and interpret. When quick emergency care response is required, decoding such a document can become a burden. Our system ameliorates this situation by grouping the drugs with the same name and dose together, making it an easily interpretable summary as it is done by Surescripts when drug NDC numbers are available.

Emergency care providers usually do not have time to read long drug lists containing various doses, dates, dispensation amounts and so on. Our system creates a timeline chart (see Figure 1). On the right column, drugs grouped by name and dose are ordered from the most to the least recent. The drugs that are currently in use are printed in boldface. The time flows from left to right as indicated with the dates on the horizontal axis at the top of the chart. With this chart, care providers can glean a year-long prescription history of the patient very quickly The example presented in Figure 1 was produced from a de-identified two-page, more than 100-line-long summary of drugs without NDC numbers.

Figure 1.

Figure 1.

Patient Prescription History Data on a Timeline Chart

Methods

Surescripts’ feed provides two types of HL7 message information: An RDS, pharmacy dispense message, and an ORU, unsolicited transmission of observation message.5 Our system processes the observation message to create the graphical timeline chart. In the input, each dispensation is represented in three subsequent OBX HL7 segments (see Figure 2). These segments contain tabular information about drug names, dosage forms, dispense dates, dispense units, prescription durations, prescribers, dispensing pharmacies, data entry types and information sources.

Figure 2.

Figure 2.

A Small Portion of De-identified Observation Message Representing a Single Dispensation

In addition to this detailed dispensation information, we receive a summary textual report that includes patient identifiers, including the name, the zip code, the date of birth, and the gender of the patient. This text also includes providers and pharmacy lists related to the dispensations.

We parse both sets of information using Perl scripts and compute the “drug use” intervals by adding the prescription duration days to the dispensation date of the drug. We truncate all intervals of recently dispensed drugs to the current date if they pass beyond the current date of information. We order the list of the drugs according to the “last drug use date,” i.e. the end date of the most recent interval for each drug. This way all medications currently in use come at the top of the list. The secondary ordering among equals is the total duration of use. If the secondary ordering does not break the tie for some, we order them alphabetically.

We also group medications with the same name but in different dosages (see LISINOPRIL TAB in Figure 1) and connect them together with a bracket emphasizing their relation to each other. Although the medications listed at the top are the current ones, we further emphasize the current medication by printing their labels in boldface.

After all information is parsed from input and the necessary computations are made, our Perl script translates this information into Postscript. Since Postscript is both a representation language of graphical information and a specialized programming language, it is capable of computing and adjusting a number of graphical parameters automatically. We first calculate the maximum width of the right-most column, where we list the medications, and then divide the remaining at the left into 365 (day) logical units. Postscript scales the width of the chart as well as all other visual elements accordingly.

Unfortunately, the input is not always clean or simple. For example, a refill usually does not occur on the same day that the patient is out of the current supply of medication. It is expected that the patient gets his/her refills a few days before the end of use day. However, what we frequently observe is multiple refills of the same drug within a couple of days. There may be different reasons for this type of noise, but apparently, the same dispensation information is passed to Surescripts from different sources, for example both by the pharmacy and by the pharmacy benefit managers, separately.

If the same label in the same form and dosage had been refilled within a couple of days with the same amount, and the duration of the medication is not short (e.g., 15-day or longer), we could assume that the second refill was a duplicate and draw the chart accordingly. Although we believe that our heuristic was quite good, we could not validate it for an extended period due to the lack of resources. In order not to take the associated liability, we decided not to continue with our heuristic plan. Instead, we decided to develop a visual representation of the data that reflects the incoming information as closely as possible.

Our problem was how to present to the provider overlapping dispensation information with clarity. We came up with a new version of the chart (see Figure 3). In this chart, each drug has a band allocated for printing the “drug use interval” lines. Now, we draw these intervals as a thin line through the mid-height of this band unless two or more intervals overlap. In that case, we shift the overlapping interval lines up and down by a few pixels in an alternating up and down pattern until the bound of the band is reached. Our implementation allows up to 9 concurrent intervals. When that level of multiplicity is reached, we put a footnote above the line, indicating that there are too many overlapping dispensations to plot. This way, each dispensation interval has a distinct beginning and end point and all overlaps are clearly visible.

Figure 3.

Figure 3.

Patient History Data with Overlapping Dispensation Information on a Timeline Chart

In this version, we also decided to include the prescriber and pharmacy information when available along with the dispensed quantity in the chart: The last three columns on the right in Figure 3 above. The letters and numbers in the prescriber and pharmacy column refer to the lists printed later in the report. In the course of a one-year history, the same drug may be prescribed by different physicians, dispensed by different pharmacies, and/or prescribed in different amounts. The columns located on the far right display only the most recent information about that particular prescription and dispensation.

Results

By using Perl and Postscript languages, we created information-rich visual timeline displays, which can be absorbed by a clinician almost at a glance saving time and facilitating care. A sample copy of a de-identified printout that the providers receive is displayed in its entirety in Figure 4.

Figure 4.

Figure 4.

Patient Prescription History Report

On the top of this page, we provide the timestamp of the information, patient name (redacted with Xs in Figure 4) and page number followed by a table containing patient identifiers, including name, address, gender, and date of birth. Before printing the standard disclaimer text, we provide a medication history date range. In this example, it ranges from 08/01/2018 to 07/31/2019. Due to the de-identification, the surrogate dates of this example lie in the future.

Starting about one-third of the way down the page, we draw a timeline corresponding to the date range. The direction of time from left to right is denoted by an arrow. At the tip of the arrow, the current full date (i.e., the date when the information is acquired) is provided. The timeline is divided into monthly portions and each tick mark is labeled with the first day of the corresponding month (Month/Day). Only the label of the New Year day tick mark contains the year information (i.e., 1/1/2019) to aid the provider for a quick temporal orientation in the chart.

Every other row is highlighted with a band for an easy read. To the right of medication labels, we inserted three columns. Both the prescriber and pharmacy columns are narrow, holding only one letter key to denote the prescriber reference or one digit key to denote the pharmacy reference. The last column is wider, to hold up to 3 digits denoting the most recently dispensed quantity. The pharmacy and prescriber tables with proper cross-reference keys are located below the chart.

The disclaimer at the top of the page could be moved to the end of the report since it does not convey any new information for the experienced provider; however, mostly for legal reasons, we had to place it where it currently is. We placed another set of standard remarks at the bottom of the page.

Discussion

Prescription data is an essential part of the medical history of the patient, but it can be quite voluminous. In emergency care, when rapid response is necessary, providers may not have time to sort through 15-page long prescription fulfillment report. The problem would be exacerbated during a disaster, as emergency departments would at that time become triage centers as well. Our project started with this kind of scenario in mind and we adhered to that perspective in all design decisions.

In order to provide all necessary information with utmost clarity, we attempted to follow best practices in visual display design.6 We tried to avoid any superfluous text and visual design elements. We strived to strike a balance between the proportions designated to the visual timeline and to the textual information, i.e. drug label, dose, quantity, prescriber, and pharmacy information. Our top-down order of drugs has a narrative quality by itself, capturing part of a medical story of the patient.6

These design principles guided us in both versions of the timeline chart. We believe the first version is most suitable for emergency care providers, since it does not contain any unnecessary information or noise such as duplications. On the other hand, the second version seems very useful for pharmacists who need to conduct medication reconciliation and need every bit of information about the dispensation detail.

The three columns of prescriber, pharmacy, and quantity cross-references also helped us to eliminate all other textual data, since per consultation with the pharmacists at the trauma center, the current layout constitutes the necessary and sufficient information needed for medication reconciliation.

In addition to its valuable use in routine emergency care and in medication reconciliation, the visualization of the prescription history data help healthcare providers to quickly spot drug abuse and drug seeking behavior. We also believe that due to simple physical proximities of the currently used drugs, providers have a better chance of spotting pairs of medications with adverse drug event potentials. Note however that the efficacy and utility of our design and its effect on the patient outcome need to be measured and evaluated by future studies.

As one of our reviewers rightly pointed out, our design would benefit from a mapping between brand name drugs and their generic counterparts. If such a mapping were in place, we could move up Toprol XL tab 50mg (brand) and clamp it with its generic version Metorprolol tab 50mg ER (generic) in Figure 1. This way the clinician could immediately see that there was no discontinuity of the drug use.

Our approach can be extended to a visual interactive display on tablets or monitors. In such an interactive environment, one could allow for drilling down and zooming in for more detailed information, allow for selectively narrowing the report to certain drug classes to focus on critical elements in the report. Even, automatic drug interaction warnings could be implemented.

Footnotes

Funding

This work was supported by the Intramural Research Program of the National Institutes of Health, National Library of Medicine.

References


Articles from AMIA Annual Symposium Proceedings are provided here courtesy of American Medical Informatics Association

RESOURCES