How can OpenMRS send HL7 message to Mirth?

Sure @vundamat… you can see what we are doing here:

In summary, we listen for order events using the Events module (OrderEventListener). Then, whenever an Order is created, we convert that order into an HL7 message (OrderToPacsConverter) and store in an new OutboundQueue domain object that we created which maps to a fairly simple pacs_outbound_queue table in the OpenMRS database that has a “processed” column that acts as flag to designate whether or not that row has been processed.

Then we created a user in the OpenMRS database that solely has access to that table in the database. In Mirth, we created a “Database Reader” connecter that queries that table at regular intervals for any records that have not been processed:

SELECT outbound_queue_id, message FROM pacsintegration_outbound_queue
                WHERE processed=0 ORDER BY date_created ASC;

… and then updates the process column after it processes them them:

UPDATE pacsintegration_outbound_queue SET processed=1
      WHERE outbound_queue_id=${outbound_queue_id};
1 Like