The Handling and Mapping of Order Status for the Lab Workflow
Overview of Relevant States and Value Sets
- OpenELIS Order Workflow States
- FHIR
Task
Status States - FHIR
ServiceRequest
Status States - FHIR
DiagnosticReport
Status States - FHIR
Task
Business Status - OpenMRS Order
Proposed Mappings for Lab Order Workflow - 1st Iteration
Overview of the Current iSantéPlus - OpenELIS Workflow
The Handling and Mapping of Order Status for the Lab Workflow
The Lab Order workflow between OpenELIS and OpenMRS will use the FHIR Workflow Module and suggested Communication Patterns to implement the ordering of lab tests from OpenMRS to OpenELIS and returning the results to OpenMRS.
Currently, the workflow is implemented using HL7 V2.5.1 messages as documented here.
The OpenMRS data model does not seem to provide much support for storing Order status, with the version of the Order
class used by most implementations supporting only the Order.active
field. OpenMRS platform 2.2.0 adds another field called Order.fullfilerStatus
which has values that correspond to FHIR and OpenELIS states, but I’m not sure where and how this field is used.
This post summarizes what I’ve put together so far for determining the correct handling and mapping of order states between OpenELIS and OpenMRS using FHIR, so please leave me any insight or feedback that might help with this task!
Overview of Relevant States and Value Sets
OpenELIS Order Workflow States
- ORDER_RECEIVED_NO_SPEC
- SPEC_RECEIVED
- PRELIMINARY_RESULT
- RESULT
- FINAL_RESULT
- CORRECTION
- TESTING_NOT_DONE
FHIR Task
Status States
https://www.hl7.org/fhir/valueset-task-status.html
- draft
- requested
- recieved
- accepted
- rejected
- ready
- cancelled
- in-progress
- on-hold
- failed
- completed
- entered-in-error
** bold states are currently implemented in the OpenMRS FHIR Module
State Machine
FHIR ServiceRequest
Status States
https://www.hl7.org/fhir/valueset-request-status.html
-
draft
-
active
-
on-hold
-
revoked
-
completed
-
entered-in-error
-
unknown
FHIR DiagnosticReport
Status States
https://www.hl7.org/fhir/valueset-diagnostic-report-status.html
-
registered
-
partial
- preliminary
-
final
-
ammended
-
corrected
-
appended
-
-
canceled
-
entered-in-error
-
unknown
FHIR Task
Business Status
https://www.hl7.org/fhir/task-definitions.html#Task.businessStatus
https://www.hl7.org/fhir/workflow-communications.html#12.6.2.1
Workflow example uses the following values for Task.business_status
:
-
Ordered
-
Accepted
-
Specimen Available
-
Preliminary Results
-
Final Results
OpenMRS Order
For the current implementation of OpenMRS Core, the Order.action
attribute holds a type of order status.
-
NEW
-
REVISE
-
DISCONTINUE
-
RENEW
I could not find any documentation for or test case uses of RENEW
, but NEW
, REVISE
and DISCONTINUE
seem to be used to denote the status of the order.
The OpenMRS Order
class also has a recent addition (since platform v2.2.0) of the attribute Order.fullfillerStatus
, with the following fields:
-
RECIEVED
-
IN_PROGRESS
-
EXCEPTION
-
COMPLETED
I’m not sure where this attribute is being used, altough these concepts do seem to map directly to OpenELIS states. Notabely, the Ref app currently does not include this change, since it runs OpenMRS Platform v2.1.3.
I also found a seemingly relevant conversation about htis topic on the OpenMRS Wiki, but the proposed system does not seem to be implemented in the code: https://wiki.openmrs.org/display/projects/Order+Actions+and+States
In general, the Order.active
field does not provide a wide range of states for keeping track of Order state, and the states that do exist do not map naturally to the value sets used in OpenELIS or FHIR.
Possibly relevant pages and posts:
Proposed Mappings for Lab Order Workflow - 1st Iteration
- Order Created in OpenMRS
Order.action = NEW
OpenMRSTask.status = DRAFT
- Order sent to OpenELIS
-
OpenMRSTask.status.REQUESTED
-->Task.status.REQUESTED
-
Order.action.NEW
-->ServiceRequest.status.ACTIVE
- Order Reception Acknowledgement sent to OpenMRS
* ORDER_RECIEVED_NO_SPEC|SPEC_RECIEVED --> Task.status.RECIEVED
|
---|
-
Task.status.RECIEVED
-->OpenMRSTask.status.RECIEVED
- Preliminary Results sent to OpenMRS
-
PRELIMINARY_RESULT|RESULT
-->Task.status.IN_PROGRESS
-
PRELIMINARY_RESULT|RESULT
-->DiagnosticReport.status.PARTIAL
-
Task.status.IN_PROGRESS
-->Order.active.NEW
-
Task.status.IN_PROGRESS
-->OpenMRSTask.status.IN_PROGRESS
- Final Results sent to OpenMRS
-
FINAL_RESULT
-->Task.status.COMPLETED
-
FINAL_RESULT
-->ServiceRequest.status.COMPLETED
-
FINAL_RESULT
-->DiagnostiReqport.status.FINAL
-
Task.status.COMPLETED
-->OpenMRSTask.status.COMPLETED
This simple outline does not cover all of the OpenELIS status values. Notibly, the CORRECTION
value would need to be handled on the OpenMRS side to update a current result, and would likely have to set the DiagnosticReport status to AMMENDED
.
Also, the OpenMRS Order
class includes some Date
attributes that might have to be set based on the Task
and ServiceRequest
statuses, like dateActivated
and dateStopped
.
Overview of the Current iSantéPlus - OpenELIS Workflow
-
OML^O21 - Incoming Order Request
-
Patient ID
-
Location ID
-
Patient Last,First,Middle
-
Mother’s Name
-
Sex
-
Address
-
Civil Status
-
Religion
-
BirthCity
-
RequestType
-
Provider Id
-
Test LOINC Code
-
Encounter Type & UUID
-
OrderDateScheduled
Mapped To:
POST
request from iSantePlus to OpenELIS containing:-
Task Resource
-
ServiceRequest Resource w/ link to Encounter
-
Patient Resource + associated
-
Provider Resource + associated
-
-
ORL^O22 - Acknowledgement of Recieved Order
Same fields as the triggering OLM^O21
Mapped To:
PUT
request from OpenELIS to iSantePlus containingTask.status
updated fromrequested
torecieved
-
ORU^R01 - Status Updates
-
- Patient ID
-
- Location ID
-
- Patient Last,First,Middle
-
- Mother’s Name
-
- Sex
-
- Address
-
- Civil Status
-
- Religion
-
- BirthCity
ORC
-
OrderControl
-
ProviderID
-
FillerOrderNumber-
-
OrderType(testrequest)
OBR (where status update is stored)
-
Encounter Type and UUID
-
OrderDateScheduled
-
ObservationalResultStatus
OBX (where results are stored when available)
-
DataType
Mapped To:
PUT
request from OpenELIS to iSantePlus containingTask.status
updated fromrecieved
to whatever the mapped status needs to be, and a DiagnosticReport for any available results.