Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This page is outdated and no longer receives updates!

This page describes how to use Mirth to connect OpenMRS to other systems.

(at Joaquin's request, some I-TECH Mirth links added below)

Before the REST web services module, OpenMRS had a Mirth Messaging Module which probably shouldn't be used anymore.

Our specific case is connecting OpenMRS for importing and exporting data to another database in the same MySQL instance. Below is a diagram. Image Added

Questions

  1. How to connect Mirth using the REST web services module

    1. Should the REST web services work for both incoming and outgoing messages?  The comment at the end of the page describes that it would only work for outgoing messages.

  2. How to trigger a channel for outgoing messages?

    1. In our case we are going to export data from OpenMRS to a MySQL database table. So my guess is that we should be able to either schedule this every so many minutes or hours. Can we also trigger than on an update of a patient it sends the data via OpenMRS REST to Mirth?

  3. How to trigger a channel for incoming messages?

    1. We are going to import the data from a table in a separate MySQL database. Again, our idea is based on a schedule, but could we trigger Mirth on an update of that table?

Below is an initial explanation (translated via google from spanish to english)

...

- If something changes in OpenMRS require updates in Database Connection, you can connect with Mirth OpenMRS our way (with Mirth Messaging Module) and then use the Database Writer in the destination connector. We do not know in this case if you could use REST Web Services Module, I think it is not for this, but we do not know enough to secure outright.

============

Some comments re I-TECH experience with Mirth for OpenEMRConnect

Attribution – OEC owes most of it’s design and existence to staff in I-TECH’s Kenya and Seattle offices, to Jim Grace of UCSF/FACES in Kisumu, and to CDC staff in Kisumu and Kisian, Nyanza.

GSOC project using Mirth to import/export CDA as part of OpenEMRConnect (OEC).  click here... 

The OEC documentation site is not especially active (or pretty), but a lot of stuff is linked off here: https://sites.google.com/site/oeckenya/ This page has references to much of the Mirth work, which was done in late 2011, early 2012.

We’ll try and update at some point w/ a description of the currently deployed OEC system – things got hectic for a while and then our focus switched to the development and implementation of the OpenMRS distribution for the KenyaEMR.  https://sites.google.com/site/kenyahealthinformatics/  (This is the primary site for all of our KE work).

============

Comments from PIH when using Mirth to connect to a McKesson PACS system:

We went with the option of Mirth connecting to OpenMRS via the database,  because it is a simple way of setting up a message queue on the OpenMRS side, and because Mirth and OpenMRS will reside on the same server in our implementation.  Basically, when OpenMRS wants to send a message, it writes out a row in an "outbound_message_queue" table (in the OpenMRS database).  Mirth polls this table every several seconds for new entries (connecting via a user that only has rights to access that table)

Here's a screenshot of our channel configuration: Image Added

OpenMRS drops HL7 messages into this table, and then this channel reads the messages from the database.  This channel passes on the HL7 message to another channel that sends the HL7 message off to the PACS system via LLP. We use the following preprocessing script on the second channel to convert the xml format that the Mirth database reader returns into a format Mirth recognizes at HL7:

Code Block
// Strip off the leading and trailing <result> and <message> tags
message = message.replace(/&amp;/g,"&");
message = message.replace(/&#13;/g,"\x0D");
message = message.replace("<result><message>","");
message = message.replace("</message></result>","");
return message;

 

Other Mirth comments that could be useful

Mirth to OpenMRS REST User Authentication Problem that was resolved https://groups.google.com/a/openmrs.org/forum/#!topic/dev/g_LANqdHiDU