Order Uniqueness Constraints
Background
Within order entry systems, it's critically important to be clear on which orders are being given within an encounter (a single clinical transaction) and which orders are active at any point in time. For patient safety, it is important that orders are non-ambiguous not only within OpenMRS, but also for ancillary (external) systems. Three approaches to consider:
On 6-Jan-2014, a doctor wants to order two things for the patient:
Warfarin (a blood thinner) according to this schedule:
Week | Su | Mo | Tu | We | Th | Fr | Sa |
---|---|---|---|---|---|---|---|
1 | - | 2 mg | 3 mg | 2 mg | 3 mg | 2 mg | - |
2+ | - | 2 mg | 5 mg | 2 mg | 5 mg | 2 mg | - |
A chest x-ray for fever and cough.
Here's how these might be ordered and reflected in the active order list. Some choices of how these orders are placed are made to illustrate the differences between the approaches:
Approach | Example | Pros and Cons |
---|---|---|
No uniqueness constraint Any order can be written in an encounter any number of times. Active orders may contain repeats.
| In a single order session, the API would allow a doctor to order:
Active orders could contain:
| Pros
Cons
|
Orders unique by concept Two or more orders for the same concept are not allowed within the same encounter. A concept can only appear once within the active orders list. | In a single order session, the API would allow a doctor to order:
Active orders could contain:
| Pros
Cons
|
Drug orders unique by formulation; Two or more orders for the same concept are not allowed within the same encounter, except for drugs, where the orderable concept may repeat as long as the specific drug formulation (strength & form) does not. Active orders may contain two or more drug orders for the same concept as long as the drug formulation differs. | In a single order session, the API would allow a doctor to order:
Active orders could contain:
| Pros
Cons
|
All orders unique by orderable and time active. An order can be repeated within an encounter as long as no two orders for the same concept (formulation for drug orders) will become concurrently active. Active orders may contain duplicates for the same concept (formulation for drugs) as long as only one is active at any point in time. | In a single order session, the API would allow a doctor to order:
Active orders could contain:
| Pros
Cons
|
qMWF = each Monday, Wednesday, and Friday. qTu = each Tuesday. qTh = each Thursday. qTuTh = each Tuesday and Thursday. qM-F = each weekday. For this example, warfarin comes in 2 mg and 3 mg.
Order Uniqueness Constraints within OpenMRS
While we want the order entry API to be flexible, we believe avoiding any uniqueness constraints on orders is irresponsible, since it increases the likelihood of medical errors (ambiguity, duplicates, etc.) and patient harm. We have experience with systems that constrain solely by concept, but this becomes overly constraining for drug orders and forces sometimes convoluted instructions within a single order to work within the constraint. Therefore, we choose to enforce uniqueness at the level of the drug formulation for drug orders and at the level of the orderable concept for other types of orders. Since initiation dosing and tapers are common and several implementations are accustomed to using order sets with these, we will strive for supporting the last approach – i.e., allowing for duplicates if and only if the orders do not overlap in time.
Order Uniqueness Definition
Orders are unique based on two things: (1) what is being ordered and (2) when the order is being carried out. More specifically:
Orderable
For non-drug orders, this is just the order's Concept
For drug orders, this is the combination of Concept + Drug formulation (i.e., drug inventory ID). In this case, a null drug inventory ID is treated as just another possible value, so a drug order for "FOOCILLIN" and an order for "FOOCILLIN 500 MG TAB" are unique orders. When support for "other drug" (non-coded drug orders) is added, then a drug order with concept "DRUG OTHER" + the specific name will define the drug being ordered.
Timing of order
Date range from date started – i.e., date activated, unless order urgency is scheduled (e.g., ON_DATE or ON_DATETIME) then scheduled date – through date stopped or, if not stopped, auto-expiration date. If neither date stopped and auto-expiration date are set, then the order is assumed to continue infinitely from the start date. If the urgency is not a scheduled urgency or scheduled date is not set, then the order is assumed to be active as soon as it is activated.
Examples
Orders within single encounter or in active list | Description |
---|---|
| Allowed. Drug orders for different formulations. |
| Allowed (even though we hope no patient would receive this particular example). Drug orders for different formulations. |
| NOT allowed. Same formulation cannot be duplicated. |
| Allowed. Drug orders for same formulation, but are not active at the same time. |
| Allowed. First order is for ampicillin without a formulation (drug ID) specified (only implied in instructions). The second uses a specific formulation. |
| Allowed. In the first order, the specific drug "ampicillin 500 mg tab" is being ordered. In the second order, a non-coded "DRUG OTHER" has been ordered with the free text specific name "ampicillin 500 mg tab". |