You can use multiple approaches
Approach 1: Create your own events in your own feed (against a new category) and consume that.
- 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”)
- 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.