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
Prerequisites
Download and install iDart
Install OpenMRS (1.5)
Download and install Mirth (make sure to use a port different to the one tomcat is using for OpenMRS)
Setup OpenMRS
Import the PharmacyDataExport module into the OpenMRS system.
At this point you will need to create the drugs that will be used in this integrated system
Create the concepts that will represent the drug
Create the drug in the 'Manage Concept Drugs' section of the Administration page
Repeat until all drugs have been added
Setup Mirth
Double click the 'Mirth Server Manager' icon in the taskbar
Click Administrator, this will start the administrator tool
Enter your user name and password for Mirth (default: admin,admin)
On the side bar click 'Channels' then 'Import Channel'
Select the 'OpenMRS to iDart Integration Channel.xml' file (found in the pharmacydataexport folder on the OpenMRS SVN) and click ok
Double click the new imported channel
Click on the 'Destinations' tab
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.
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.
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.
Click on the channels link on the sidebar.
Right click the imported channel and click enable if the channel is disables
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.