Pharmacy Data Export Module

The PharmacyDataExport module allows the user to export a prescription to a pharmacy system. In this specific case the open source iDart pharmacy system was used however, any pharmacy system could use the exported data as long as a corresponding Mirth channel is created. The module allows the user to choose from drugs that that the patient is currently on and add them to a prescription. A duration is then selected and the prescription can then be exported. When the prescription is exported it is sent to a mirth server. From there it can be sent to a pharmacy system. The export is generic at this stage and it is up to the Mirth channel to map the exported data to field in the pharmacy system.

A mirth channel as been created specificaly for the iDart system and is included with the module source. The following will explain how to setup this system for the iDart pharmacy system:

Video Demo: link


  1. Download and install iDart
  2. Install OpenMRS (1.5)
  3. Download and install Mirth (make sure to use a port different to the one tomcat is using for OpenMRS)

Setup OpenMRS

  1. Import the PharmacyDataExport module into the OpenMRS system.
  2. At this point you will need to create the drugs that will be used in this integrated system
    1. Create the concepts that will represent the drug
    2. Create the drug in the 'Manage Concept Drugs' section of the Administration page
    3. Repeat until all drugs have been added

Setup Mirth

  1. Double click the 'Mirth Server Manager' icon in the taskbar
  2. Click Administrator, this will start the administrator tool
  3. Enter your user name and password for Mirth (default: admin,admin)
  4. On the side bar click 'Channels' then 'Import Channel'
  5. Select the 'OpenMRS to iDart Integration Channel.xml' file (found in the pharmacydataexport folder on the OpenMRS SVN) and click ok
  6. Double click the new imported channel
  7. Click on the 'Destinations' tab
  8. Ensure that the URL, username and password fields correspond to that of your iDart postgres database as well as the connection parameters in the javascript pane for the database connection.
  9. In the javascript pane under the //h3. SETTINGS heading set the clinic id for the exported data. This corresponds to a clinic id in the iDart system. '2' is the default but check what the is in the iDart database if you are unsure.
  10. Scroll down to the DRUG MAPPINGS section of the javascript. Here you must add the mapping for the OpenMRS drug name to the iDart Drug name. Note: This is extremely important, the drug names must be identical so those in the respective systems. Without the proper setting the integration will not work.
  11. Click on the channels link on the sidebar.
  12. Right click the imported channel and click enable if the channel is disables
  13. Now, right click the imported channel and choose "Deploy All". This will deploy the channel and it will be ready for use.

Adding support for another Pharmacy System

The data exported to mirth is rather generic and it would be relatively easy to add support for another pharmacy system. This would be done by creating a new mirth channel that accepts incoming message via aTCP connection and then performs the custom transformations to integrate with the other system. The TCP connection that is used can be setup in the module via the global properties.