LIS Integration with Open EMR

(suresh) #1

Hi we are a Lab and we are using LabDaq had our LIS system and we have some draw sites where we need to use EMR.So we have installed OPEN EMR and all the basic setup is what are my options to establish bidirectionally HL7 integration where automatic results and orders will go. If not how to upload the results manually.

Thank you

(Stephen Waite) #2

hi @sarram1210, bidirectional hl7 isn’t built into the community version i believe.

(suresh) #3


Thank you for your reply.

So what are my options? Is it unidirectional is possible where I can only transfer results to EMR. Or at least can I upload results manually

(Stephen Waite) #4

hi @sarram1210, yes, if you setup sftp you can automate results only.

(suresh) #5


As of now both the LIS and EMR on the same network. Do we still need to use SFTP or any other alternatives?

(Stephen Waite) #6

hi @sarram1210, after you add the lab in the address book you can configure the connection under procedures->providers.

(Craig) #7

Hi there,

I’m fairly new to OpenEMR, but I am running community edition in a dev environment and have HL7 orders flowing out and results flowing back in. At least in 5.0.1, when you setup your procedure provider, you can specify a folder to send the order to (Orders Path). OpenEMR will write an HL7 message to a file in that folder and you can use Mirth to pick it up, read it, and send it on to your LIS. It also has a field for specifying the results (Results Path). If you setup a results channel in Mirth to write a properly formatted HL7 ORU to a file in that folder, you can pickup the results by visiting Procedures --> Electronic Reports. If needed, you can even embed a Base64 PDF report in the OBX segment of the message and OpenEMR will attach it to the documents section of the patient’s record.

I’m using it to send orders and results between OpenEMR and EEG software, but the mechanism should be the same.


(Stephen Waite) #8

hi @sarram1210, did you see this?

(suresh) #9

Thanks, Craig For detailed explanation.

I am also New to Open EMR. I will start working on it

(suresh) #10


I have seen it. I am completely new to this. I am working on it.

(MD Support) #11

Would you be open to contributing Mirth channels to community?
@brady.miller: I think just like couchbase option, providing recipe for using Mirth will be a compelling alternative to LAMP only solutions involving external entities be it labs or EDI partners.

(Craig) #12

Sure, I can post the channels I created (sanitized a bit). I’ll also give a bit of background and explanation.

Disclaimer: This post assumes basic knowledge of the structure of an HL7 ORM and ORU message. Also, keep in mind that these channels and configs were built for a dev environment, not a production environment. Be sure to thoroughly test anything you plan to put into production.

Again, these channels were designed specifically to interface with an EEG system, but they should be adaptable to your needs. The EEG system does not send back discrete data, but that should work fine simply by having multiple OBX segments with your discrete results.

My basic configuration:

  1. OpenEMR 5.0.1 running on Ubuntu 16.04
  2. Mirth 3.5.2 (important for if you try to import the channels) installed and running on the OpenEMR server
  3. EEG system receiving orders and sending results (PDF report), running its own instance of Mirth
  4. EEG system only accepts ORM O01 messages

When an order is placed in OpenEMR, a file is written to the path configured in the procedure provider, and is formatted as an ORM O01 HL7 message. This is native OpenEMR functionality.

"OpenEMR Orders - EEG" Channel
Source: Uses connector type “File Reader”. Checks “/opt/hl7orders/eeg” every 10 seconds for new files and ignores files that do not have “ORM” in MSH.9.1 and “O01” in MSH.9.2. If successfully processed, it moves the file to “/opt/hl7orders/eeg/processed”. Otherwise the file is moved to “/opt/hl7orders/eeg/error”. Because Mirth is installed on the same server as OpenEMR both software suites can read and write to the folders without using SFTP or some other remote file transfer protocol.

Destinations: “Send to EEG system” uses connector type “TCP Sender”. Takes the HL7 message passed to it by the Source and sends it on to a system called “eegserver” that is listening on port 12345.

"EEG Results Channel"
Requires that the ORU have the PDF report embedded in OBX.5.5 as encoded Base64 text.

Source: Uses connector type “TCP Listener”. Listens on port 5000. When an ORU is received the “Generate pdfName variable” transformer parses various pieces of the message to generate a filename for the PDF report, stores it as the variable “filename” and makes “filename” available to the channel as variable “pdfName”. It also pulls the Base64 PDF data from OBX.5.5 and makes it available to the channel as variable “pdfData”.

Destinations: “Write ORU to Folder” uses connector type “File Writer”. Takes the HL7 message passed to it by the Source and passes it through two transformers: “Create the filename” and “Put PDF in ORU”. Transformer “Create the filename” takes the Message Control ID from MSH.10.1 and uses that as a unique filename for the ORU file written to the server and makes it available to the channel as variable “filename”. Transformer “Put PDF in ORU” sets OBX.2 = “ED”, OBX.5.1 = “pdf”, OBX.5.2 = “TEXT”, OBX.5.4 = “Base64” and OBX.5.5 = pdfData variable. This transformer is important for getting OpenEMR to create a PDF file directly in the electronic results. It then writes the ORU to “/opt/hl7results/eeg” using the ${filename}.txt as the filename where ${filename} is the variable defined in transformer “Create the filename”.

Some of these steps are probably not necessary such as reading OBX.5.5 to pdfData and putting pdfData back in OBX.5.5, and creating the pdfName variable. However, it took some trial and error to get the process to work as desired, so there are a few artifacts that need to be cleaned up.

Viewing Results in OpenEMR
In order to get the results to show in OpenEMR, you must go to the “Procedures” menu --> “Electronic Reports”. This triggers OpenEMR to check all configured results folders in your various procedure providers configs and read in all files it finds. It will only process messages with a proper MSH segment. You will see the results listed in tabular form, as well as any file read errors. From there you can click on the date to see the specific results, or you can click on the patient and view “Lab Results” in the “Documents” section of the patient record.

Finally, here is a screenshot of the procedure provider configuration used to make this work.

OpenEMR Procedure Provider Configuration

Clear as mud, I’m sure. I hope this helps.

EEG Results Channel.xml (24.7 KB)
OpenEMR Orders - EEG.xml (25.2 KB)

Current state of HL7/CCD
(MD Support) #13

Thx @coddij. We had a PoC project that was pushed back. Dealing with labs needs some error handling.

Will see if we can leverage your approach and post progress.

(Suresh) #14

So if I understand correctly, is this correct?


We have LIS ( Labdaq server )
Planning on installing configuring a vm ( Turnkey Mirthconnector on Ubuntu )
OpenEmr ( Installed on a seperate VM )

Thank you

(Craig) #15

That should work. The biggest difference is that I have Mirth installed directly on my OpenEMR server so it has access to the filesystem of that server. In your setup you will either need to setup remote filesystem access for Mirth (SFTP, etc.) to your OpenEMR server’s filesystem so it can pickup the HL7 files or you will need to configure OpenEMR to place the HL7 files somewhere else that Mirth can access.

(Luke Krass) #16

i have a similar projekt, but the difference is that i have to read vital signs like pulse and oxygen saturation. how can i display it in the vital results and not in the labs results?