OpenMRS – OpenELIS: Required FHIR Resources
Part of the OpenMRS – OpenELIS guide. This page lists the FHIR R4 resources that OpenMRS and OpenELIS exchange through the shared FHIR server, and the fields each side reads. Setup, configuration and troubleshooting are on the parent page. Checked against the OpenELIS source code and the Lab on FHIR 1.5.3 source.
Exchange at a glance
Step | Written by | Resources | Task status after the step |
|---|---|---|---|
1. Order placed | OpenMRS (Lab on FHIR) | A FHIR |
|
2. Order imported | OpenELIS | Reads the Task and the resources it references, copies them to its local FHIR store and creates an electronic order. Writes the new status back to the Task when |
|
3. Results validated | OpenELIS |
|
|
4. Results imported | OpenMRS (Lab on FHIR) | Reads the completed Task, its DiagnosticReports and their Observations, and saves the results in the patient's encounter. | unchanged |
Order resources (OpenMRS to OpenELIS)
Resource | Key fields | How OpenELIS uses it |
|---|---|---|
Task |
| Polls for Tasks with status |
ServiceRequest |
| One per ordered test or panel. The LOINC code is matched to an OpenELIS test, or else to a panel. |
Patient |
| Reads identifiers by system: |
Practitioner | Referenced from | The Task requester, or else the owner, is created or updated as an OpenELIS provider. The ServiceRequest requesters are copied to the local FHIR store. |
Location | Referenced from | Created as a referring site (organization) with the Location id and name, if no organization has that FHIR id yet. |
Encounter | Referenced from Task and ServiceRequest. | Not read by OpenELIS. OpenMRS uses it to attach the results. |
Specimen (optional) | Referenced from | Copied with the order when present. Lab on FHIR does not send one. |
Result resources (OpenELIS to OpenMRS)
Resource | Key fields | How OpenMRS uses it |
|---|---|---|
Task (the OpenMRS Task) | Same | Lab on FHIR searches Tasks with the OpenMRS identifier system and the lab owner, and finds its own Task by the value of the first identifier. It then follows each output. |
DiagnosticReport | One per test. | Imported only when the first coding of |
Observation | One per result. | Saved as an obs in the order's encounter. The concept is found by its LOINC mapping. A numeric concept accepts only a |
OpenELIS also sends its own order resources, as listed in org.openelisglobal.fhir.subscriber.resources: a Task with the OpenELIS order UUID as id, partOf the OpenMRS Task and identifiers order_uuid and order_accessionNumber; one ServiceRequest per test (the basedOn of the DiagnosticReport and Observations); one Specimen per sample; the Patient; and the Practitioner. Lab on FHIR does not read them.
Task status
Status | Set by | Meaning | Effect in OpenMRS |
|---|---|---|---|
| OpenMRS | New order, waiting for the lab. | Order is active. |
| OpenELIS | At least one test or panel of the order was recognised. | Order fulfiller status In progress. |
| OpenELIS | No LOINC code of the order matched an OpenELIS test or panel. | Order fulfiller status Exception. |
| OpenELIS | All tests of the order are validated. | Results imported, order Completed. |
| Not set on this Task by OpenELIS | Order cancelled. | Order fulfiller status Exception. |
References
OpenELIS FHIR Implementation Guide: https://digi-uw.github.io/openelis-global2-fhir-ig/en/
FHIR message examples: Examples of FHIR messages used
Lab on FHIR module: https://github.com/openmrs/openmrs-module-labonfhir
FHIR R4 Task: https://www.hl7.org/fhir/R4/task.html and workflow communication patterns: https://www.hl7.org/fhir/R4/workflow-communications.html