Introducing Bahmni HL7 LIS Integration

Bahmni LIS Integration

In late 2020 we wanted to have a similar integration of the Laboratory Information System (LIS) as it is with Picture Archiving and Communication System (PACS). This is why we took the PACS integration project as a basis of the new solution and further adopted its features to fit with LIS workflows. In addition we developed other new features. The idea is that just like PACS, LIS would be a solution that can be integrated with Bahmni EMR. We are fully aware that OpenELIS is part of Bahmni out of the box. We have used Senaite as LIS for integration, as we thought the product to be better maintained. Also a clean HL7 integration allows to use other LIS products (that might be already in place at a facility). A Mirth ESB was used to convert the HL7 messages to Senaite API requests. In this text, we describe the Integration approach using HL7 messages.

The solution works very well, so we decided it is the time to publish now. If bahmni team would like to “pull” this into the organization’s projects, this is of course more than welcome. We are open to suggestions of course :slight_smile:

My special thanks go to @aidjali @triumf @vesakelmendi @zjashanica. Also thank you @mksd for the interesting discussions and @angshuonline for replies to some of our questions.

Let us now take a look at the project:

HL7

HL7 is a set of international standards for transfer of clinical and administrative data between software applications used by various healthcare providers. There are different versions of HL7 standards available (2.x, 3.x, FHIR), the solution we developed uses HL7 v2. For this integration, we are interested in HL7 Order Entry (ORM) messages needed to place laboratory orders from Bahmni EMR to the LIS. Furthermore, HL7 Observation Result (ORU) messages are needed to send results from the LIS to Bahmni EMR.

Workflows

Place Order

image

A patient is admitted to a hospital, and it is decided that a Leukocyte blood test is needed. The order can be placed from the Clinical module in the Orders tab. The figure below shows the Request Order placed in Bahmni EMR.

image

When the test is ordered, the order is automatically transmitted from the HIS EMR to the LIS system, using a standardized HL7 v2 ORM interface. ORM message type holds information about a request for materials or services (in our case, one or more laboratory tests on a sample). Some of the information that can be found in the message are patient data (Name, ID-number in system), who made the order (Name, UUID, Email) and the order data (Test name, Sample, UUID).

Example of an Order Entry ORM Message:

MSH|^~\&||BahmniEMR|LIS||2021072111||ORM^O01|1626865227681307|P|2.5
PID|||LAO445428||Smith^Bill||19910721000000+0000|M
PV1||O|||||||||||||||||3998ee6d-048e-4c50-8fb6-9fc5d4c91b6b|||||||||||||||||||||||||20210721105928+0000 
ORC|NW|3735499d-99f3-4b35-9393-da992ac75030|||||^^^^^R|||^^BahmniEMR||c1c26908-3f10-11e4-adec-0800271c1b75^Man^Super||^^^root@example.com 
OBR||||26464-8^Leukocytes|||20210721110024+0000||||||||&Blood||||||||||||||||||||||||^Leukocytes||||^Smith,Bill

Cancel Order

image

If the case occurs, that an ordered laboratory test is not needed anymore, it is also possible to cancel the placed order from the Bahmni UI, by using the cancel button in the “Orders” tab.

Example of an Order Cancel ORM Message:

MSH|^~\&||BahmniEMR|LIS||2021072111||ORM^O01|1626865227681307|P|2.5
PID|||DD445428||Smith^Bill||19910721000000+0000|M
ORC|CA|3735499d-99f3-4b35-9393-da992ac75030|LIS-1234

Receive Results

image

In the laboratory, a couple of tests are performed. Once the values have been entered into the LIS system, and are confirmed by the laboratory staff, the results are sent back to Bahmni in an HL7 ORU R01 message:

MSH|^~\&||Some^Laboratory|BahmniEMR|BahmniEMR|||ORU^R01^ORU_R01||P|2.5
ORC|RE|75739d90-1c15-46e5-b386-c56f6834904c|d88f6677d6fc4c5da53e08a6c8ad1236||||^^^^^R
OBR|1|||^Erythrocytes
OBX|1|NM|^Erythrocyte distribution width [Ratio]||8.0|||||||||20210721123459
ORC|RE
OBR|2|||^Patient Document
OBX|1|ED|^Laboratory-Report-Wed-21-Jul-2021-12-35-41-UTC.pdf^^^arreport-5.pdf||MDAwNDAxN...<PDF Result Report as Base 64>...DUwOQolJUVPRgo=|||||||||20210721123541
ORC|RE
OBR|3|||^Results Interpretation
OBX|1|TX|||This is the lab results report for Sample Blood-0001 for Patient Smith Bill

The results stored as values and the textual interpretation are extracted from the ORC segments and stored as observations. They are now visible in the patient dashboard.

image

The PDF report, that was stored in an ORC segment as well is saved as a patient document in the patients dashboard.

image

9 Likes

Absolutely, do you want to attend our PAT call tomorrow?
Its at 1 pm UTC, Wednesday 28 July on zoom

@angshuonline tomorrow is unfortunatly impossible. We could schedule a short demo for the next one?

Sure @bgevam … let us know.

Thanks for sharing @bgevam!

Great to see that you have used SENAITE LIMS, we also do the same internally. As you may remember we have put together a similar type of integration using FHIR and with SENAITE as well. In our case we have leveraged FHIR service requests, FHIR tasks and FHIR observations to achieve about the same thing as you did.

We haven’t used ours in production yet, we are basically still polishing it and testing it but hopefully we will be able to share a similar update soon. However our project’s aim is definitely less flexible as the goal was mostly to get a FHIR-based workflow working only with SENAITE at first. Having said that, there is sufficient separation of concerns in the code itself to split what is generic FHIR stuff from what is SENAITE-specific.

Cc @mksrom @ruhanga

3 Likes

@bgevam for OpenMRS → LIMS you use Atomfeed right, and that stems from the Event module in OpenMRS if I remember correctly.

But how do you detect the SENAITE changes (samples presumably) that you are interested in?


FYI we use openmrs-eip’s watcher to detect lab orders changes, on the way back we just poll for samples from SENAITE, but we’d been keen to do something better eventually.

In our design choices, where we also included a lab specialist, we strongly decided against detecting changes/polling the LIS. This is due to the reason, that the lab process must be finished at one time from the LIS, and from then on it shall be transferred to Bahmni and not changed anymore.

We implemented it by using smtp. When a report is published in senaite, an “e-mail” is sent to mirth using postfix (actually, we just read the e-mail file from the file system). Mirth then fetches all the additional needed data and generates the HL7 ORU message.

1 Like

Thanks @bgevam, this is really useful information.

To be 100% clear, you use this email trick as a way to publish events out of SENAITE? If so, I’m assuming that there wasn’t a better way to do that?

I don’t like polling either, it’s supposed to be a last resort, and it’s used too often.

To be 100% clear, you use this email trick as a way to publish events out of SENAITE?

correct

If so, I’m assuming that there wasn’t a better way to do that?

Well, there is a better way to do it (imho): Developing an add-on for Senaite/Plone, that deals with the communication. In a perfect world, we have one HL7 FHIR add-on, one HL7 v2 addon, etc. …

There we just configure the HIS we are communicating with. Even if this add-on just does an “internal polling” it would be quite clean.

Yes yes of course, agreed. Yes my question was in the realm of what SENAITE and its ecosystem provide “as is” and as of now.

Maybe we could collaborate on this together? Probably something to discuss on their platform rather than here :slight_smile:

Yes. But I think it is also of interest for the Bahmni community. Having their own fork of OpenELIS for sure consumed a lot of time, looking at the number of commits. Just taking an LIS as-is and only investing in integration might save a lot of time and maintenance effort.

Anyway, it would be good to further discuss in the SENAITE community.

1 Like

Sure. and that has been philosophy of Bahmni not to reinvent the wheel. You would see the same in our integration with ERP, PACS.

When we started on Lab, OpenELIS was dormant and BIKA not in vogue and we had no option but to fork ELIS (actually from their SVN repo). We would love to be in the situation where all enhancements. go to ELIS, but ELIS has since come back to life, and had change of codebase, and Bahmni had already fixed and enhanced a lot. We are still considering moving to either ELIS2.0 or SENAITE.

We are glad that you want to contribute back and would love to discuss on collaboration. (Some do not even wish so). Please try to attend this week’s PAT call … 1 pm UTC, Wednesday.

1 Like

Sorry I thought the PAT call is biweekly. I can confirm our availability for the call on 11th of August.

I did not mean to leave the impression, that any bad design decisions were made on OpenELIS. The integration works with a level of proficiency no other open source HIS project could offer. The “lis integration” sure needs thorough evaluation at this stage.

1 Like

The PAT call recording where this was demo’ed can be accessed here: https://bahmni.atlassian.net/wiki/spaces/BAH/pages/2859728897/Integration+with+SENAITE+BikaLIMS

(Reference Material Section has the video link).

I would like to see the demo but don’t want to register with thoughtworks zoom. Can it be posted elsewhere? Also, how are the concepts being synched between systems? Are custom IDs used, or are there LOINC codes, etc.? Is CIEL being used? Thanks!

@akanter you dont need to register on zoom. its an open call. I am not sure if the recording needs specific access.

Between MRS and ELIS, all concepts are synced - there is a mapping kept with external uuid (openmrs concept uuid) in ELIS. Changing to LOINC should be simple enough. @bgevam do you use LOINC or any other code system for mapping?