How to trigger synchronization between OpenElis and OpenMRS

I would like to know how feasible it is to trigger the synchronization(between OpenMRS and OpenElis) feature based on some events/activities. For example:

  1. When an lab order moves from “Sample to be collected” to “Sample collected”
  2. When one enters comments in the result entry page.
  3. When one fills in information on non conformity orders.

The main objective here is to see if there is a way to build on the currently available features in Open Elis to reach some level of order fulfillment. This way clinicians can be able to follow up on the status of their lab orders and hence guide their decision on the way forward. In one of our implementation clinicians are having hard time knowing the status of their lab orders. The only way they can do so is by physically going to the lab or calling the lab technicians which is not always evident.

You can use multiple approaches

Approach 1: Create your own events in your own feed (against a new category) and consume that.

  1. You need to raise an event, whenever sample is collected. For example see here
  • you can raise an event against a different category (say something like “accession-status”)
  1. On EMR side, you need to consume the feed and process each event. See here for example

Approach 2: Leverage existing setup

  • Everytime there is some update on the accession on LIS side, there is an update on the accession. The accession is described in a simplified form through the URL, against the OpenMRS encounter UUID, the order is associated with.

/openelis/ws/rest/accession/[encounter uuid]

Which gives result like

  "accessionUuid": "6d1514e7-9d4a-4861-8615-c03024c44d15",
  "patientUuid": "6da91a1c-1243-4378-be8e-21142abd1369",
  "patientIdentifier": "GAN203007",
  "patientFirstName": "Test",
  "patientLastName": "Patient",
  "labLocationUuid": "c58e12ed-3f12-11e4-adec-0800271c1b75",
  "dateTime": "2019-03-04T14:39:15+0000",
  "accessionNotes": [
  "testDetails": [
      "testName": "Haemoglobin",
      "testUnitOfMeasurement": null,
      "testUuid": "fe769568-16da-4d9e-9c99-fbed0a8a60f5",
      "panelUuid": null,
      "minNormal": 0.0,
      "maxNormal": 0.0,
      "resultUuid": null,
      "result": "8",
      "notes": null,
      "resultType": "N",
      "providerUuid": "1",
      "dateTime": "2019-03-04T14:42:04+0000",
      "status": "Results final",
      "uploadedFileName": null,
      "abnormal": false

See the above “status” field? that goes through changes like - Not started, Accepted by technician, Results final. So technically, you can modify the code here (while processing the accession) and save the information “somewhere”. That “somewhere” is currently undefined. Don’t assume OpenMRS “Order.order_action” is meant for that. (its actually meant for NEW, REVISE, DISCONTINUE etc - more to describe action from orderer side). Actually there is currently no field to store that information. You will have to figure out where you store that value. Maybe use a different table?

Approach 3: Just keep crawling for the accession result

  • If its just for showing on the UI, then you can write your own custom control to display the lab results with status. Just hit the above URL format and process the “status” field.
  • Once a order has been raised, you can potentially just run a scheduler job to keep checking the result using the “URL” for accession. You will need to store the data somewhere though, so the same question as above.

Hope the above helps. Bring it up on one of the upcoming PAT call if you like.


Thanks @angshuonline for the suggestions. We shall look at trying some of these suggestions and see how they turn out.

Kind regards, Gauthier A.