What is Mirth

Mirth is used for sending, receiving and processing HL7 messages. It works on the principle of creating Channels for processing HL7 messages. Fortunately two Channels are under production for us by Webreach. These Channels are XML files that can be imported and deployed in the Mirth application. Although the second channel is not yet complete, these already enable some level of testing with GNUmed.

Downloading Mirth

I checked out the latest source from the Mirth Project's subversion repository:


$> svn co https://www.mirthproject.org/svn/trunk

* NB. For the purposes of this guide, the environment variable MIRTH_HOME was created to point to the directory you checked out mirth from. This can be anywhere on you system. Mine is ~/Projects/Mirth/mirthws. The environment variable is not needed to install or run Mirth in reality.

You will now see all the source under:



  1. Java: Mirth runs on Java. As such you will need to install a Java Runtime Environment. Either install it using apt or from here http://java.sun.com/javase/downloads/index_jdk5.jsp. Use Java 5. I wouldn't go to Java 6 or 7.
  2. Ant: Mirth builds using apache ant - http://ant.apache.org/ Ant is a common tool used to compile java projects.
  3. Data: Import the following data into the GNUMed database: gnumed/server/sql/testdata/BC-Excelleris-test_patients.sql. These provide pseudo-patients against which test data having this BC Canadian specification can be imported.

Building and Running Mirth

Once ant and java are installed and on your path, Mirth can be built by issuing the following command:

$> cd $MIRTH_HOME/trunk/server

$> ant -f mirth-build.xml

It creates all the required jars and config and places them in $MIRTH_HOME/trunk/server/setup

To run the mirth server issue the following command:

$> $MIRTH_HOME/trunk/server/setup/mirth.sh

This will start the Mirth server. Mirth uses java WebStart to start the client. This means that you have to go to a URL in order to launch the Mirth client application. This is java's way of always running the latest code.

To start the Mirth client application, go to: http://localhost:8080

Click the "Lauch Mirth Administrator" button.

Setting Up the GNUMed Channels in Mirth

I followed the instructions from this guide: mirth_user_guide-1.3.2.pdf

Once Mirth is started you can import the GNUMed Channels created by Webreach. BEFORE IMPORTING YOU WILL NEED TO UPDATE YOUR GNUMED DATABASE CONNECTION INFORMATION DIRECTLY IN THE CHANNEL XML FILES. Do a search for them in the channel.xml files. Hopefully I will be able to clean this part up in future.

Import channel1.xml and then channel2.xml.

After importing the Channels you must deploy them. Click on the Deploy All option once inside the Channels Menu. The Dashboard should show 2 Channels in a running state.

Once the channels are deployed and running you can send a message to them. I sent this HL7 message QA_20071101b_v2.3.xml to Channel 1. Channel 1 filters the content and sends it to Channel 2 which is responsible for storing the content in the GNUMed database. If you have been successful the Dashboard will show the number of successful messages received smile Otherwise consult the logs for errors frown

Page originally authored Sept 9, 2008 by David Mackenzie.
Topic attachments
I Attachment Action Size Date Who Comment
QA_20071101b_v2.3.xmlxml QA_20071101b_v2.3.xml manage 19 K 10 Sep 2008 - 09:51 DavidMackenzie Sample HL7 message
channel1.xmlxml channel1.xml manage 24 K 10 Sep 2008 - 09:49 DavidMackenzie GNUMed Mirth Channel 1
channel2.xmlxml channel2.xml manage 22 K 10 Sep 2008 - 09:50 DavidMackenzie GNUMed Mirth Channel 2
mirth_user_guide-1.3.2.pdfpdf mirth_user_guide-1.3.2.pdf manage 378 K 10 Sep 2008 - 10:03 DavidMackenzie Mirth User Guide
Topic revision: 25 Jun 2011, KarstenHilbert
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Powered by Olark