Hello OpenMRS Community,
Our team is currently looking into linking orders where a subsequent order is directly contingent upon the results or performance of a prior order. We are looking to utilize the previous_order_id to maintain linking between these related orders.
Clinical Scenarios
We have identified two primary use cases where a subsequent order of a different concept must be linked to an initial order:
1. Laboratory Order
In many public health settings, a positive screening for Hepatitis B Surface Antigen (HBsAg) must be followed by a viral load test to determine if the infection is active.
-
Initial Order: Hepatitis B Surface Antigen (HBsAg) - Serology test.
-
Linked Subsequent Order: HBV DNA (Viral Load) - Molecular test.
-
The Need: The clinician needs to link the DNA test back to the HBsAg screen to show that the second order was triggered by the first, ensuring a clear linkage.
2. Sequential Radiology Imaging
Radiological investigations often follow a “preliminary view” protocol. A clinician may initially order a standard view, and upon reviewing the image or the patient’s condition, require additional specific views to be performed under the same clinical context.
-
Initial Order: Chest X-ray (CXR) - PA View.
-
Linked Subsequent Order: Chest X-ray - Lateral or Oblique View.
-
Need: Linking these ensures the radiologist and technician understand the subsequent view is a continuation of the initial diagnostic inquiry, rather than a separate, unrelated order.
Technical Constraint
Currently, the OpenMRS API enforces a validation rule that requires the concept of a new order to match the concept of the previous_order it references. Reference to OrderServiceImpl.
While this logic is essential for REVISE, RENEW, and DISCONTINUE actions to prevent data inconsistency, it creates a blocker for the NEW action type where the clinical intent is continuation or reflex testing rather than replacement.
Proposed Alignment
This requirement aligns with the HL7 FHIR ServiceRequest resource, which utilizes the basedOn field to reference prior requests, allowing for different order to be linked.
We propose that the validation check requiring matching concepts be bypassed specifically when the OrderAction is NEW. This would allow clinicians to “chain” orders while maintaining a clear audit trail of which order triggered the next.
We would love to hear the community’s thoughts on this:
-
Is there an existing alternative mechanism for this type of linking that we may have overlooked?
-
If not, can we proceed with creating a JIRA issue to allow different concepts for
NEWactions in theOrderService?
Looking forward to your feedback.
@dkayiwa @burke @mseaton @ibacher @angshuonline
Best regards,