DHIS Connector Module
For the latest OpenMRS-DHIS2 integration work, see http://om.rs/dhis2
Demos
.
About DHIS Connector Module (DCM)
This module posts aggregate data from OpenMRS to DHIS2, and gives implementers a User Interface for an easier-to-set-up OMRS to DHIS2 pipeline, that doesn’t need manual code fixes every time there’s a change to reporting indicators.
Users gain a Mapping Tool UI, the ability to automatically send data to DHIS2 right away or on a schedule, and to map exports so that you can re-use your mapping work across sites.
The DHIS Connector module is used to extract/aggregate data from the OpenMRS system. Data is aggregated according to the user specification (CD4 COUNT < 200). Then the OpenMRS feature, the cohort builder, is used to query the database as specified by the user.
After getting the required aggregated data an HL7 message is created and sent to DHIS. The Mirth Messaging module is used to send the message to DHIS.
Technologies
HL7 API (HAPI)
Mirth
Mirth Messaging Module
Installing DHIS Integration Module
To install the DHIS Integration Module (DIM), the global property module.allow_web_admin must be set to true. The global properties are found under in Administration/Manage Global Properties. The Global Properties must be saved after any change.
For DIM to be installed, the Mirth Messaging module must be installed and running (Mirth Messaging Module). To install any module, you navigate to Administration>Manage Modules. Under the Manage Modules page, there is an Add Module sub-menu. Browse to the .omod file (OpenMRS module), and click on Add Module. OpenMRS will do the necessary checks to ensure that the module is up and running.
For DIM to run, certain Global Properties need to be defined:
dhismodule.dataSetFile - This specifies the file that has the datasets that need to be sent to the DHIS system. The directory of the file is needed (the file must also be created/exist in that directory).
(ex. C:/Application Data/OpenMRS/DHIS/DHISInput/dataSets.txt)
dhismodule.dhisInput - This specifies the directory where all the inputs for the module are. The directory contains things like the Dataset file.
(ex. C:/Application Data/OpenMRS/DHIS/DHISInput)
dhismodule.HL7Archive - This specifies the directory that will be used to save all HL7 messages sent to DHIS saved by date.
Remember to SAVE the global properties after every change.
Before you can use DIM, Mirth (http://www.mirthproject.com/) must be installed and a Mirth channel must be setup. Mirth is use to allow communication between the 2 systems. For information on how to create this channel see Creating a Mirth Channel for the DHIS Connector Module
Using DCM
After uploading DCM, the DCM menu will appear on the Administration page. The menu options will be displayed under DHIS Connector Module.
The DataSets file should contain all the DataSets that need to be made and sent to DHIS (ART Monthly Data for example). The Data Sets and associated descriptions can be found from the DHIS system. Each Data Set has a list of Data Elements in it (Descriptions) that make up that Data Set.
Before exporting Data to DHIS, DataSets and data elements for the DataSets must be defined. The Manage DataSets page is used to create the DataSets and define the descriptions/elements.
Configuration
The first step is to configure the link to your DHIS2 server. This is done by clicking the Configure DHIS Server link under the DHIS Connector Module heading on the OpenMRS Administration page. You will need to know the URL of your target DHIS2 instance as well the details of a user that has access to the API. To test with the DHIS2 demo server, use the following details:
Field | Value |
---|---|
URL | |
Username | admin |
Password | district |
Mappings
Before you can send Period Indicator Report data to DHIS2, a mapping must exist between the report and a DHIS2 Data Set. Mappings can either be generated via the UI or placed in the correct location. Mappings are stored as JSON on the file system at OPENMRS_DIR/dhisconnector/mappings/
. On Ubuntu, this usually corresponds to /usr/share/tomcat7/.OpenMRS/dhisconnector/mappings/
.
Create Mapping
To generate a mapping via the UI, click the Create Mapping link under the DHIS Connector Module heading on the OpenMRS Administration page. Then select the Period Indicator Report from the left menu and the corresponding DHIS2 Data Set from the right menu. Drag the Data Elements and Category Option Combos from the right to the matching row on the left as follows:
Finally, click save and give your mapping a unique name.
Exporting Existing Mapping
This module provides a way of exporting existing mappings which basically archives them into one download that can thereafter be imported/uploaded into the current or another OpenMRS instance.
Uploading Existing Mapping
The module provides an option to import or upload mappings previously exported from the current or other instances, this feature is available and will be released as part of 0.1.2
Location Mappings
Before you can send Period Indicator Report data to DHIS2, a mapping must exist between the OpenMRS Location and a DHIS2 Organization Unit. So when pushing data, the respective DHIS Organization Unit and OpenMRS Location of the Dataset will be automatically mapped. Location Mappings can be saved via the Location Mapping UI. Mappings are stored in the database at dhisconnector_location_to_orgunit
table.
Posting Data
To post data to the DHIS2 server or download the data in DXF format, click the Run Reports link under the DHIS Connector Module heading on the OpenMRS Administration page. Select the Period Indicator Report and the corresponding mapping to use.
Since Period Indicator Reports are always run for a specific location, you will also need to select the OpenMRS Location as well as the corresponding DHIS2 Organisation Unit. But with the automated location mapping feature, it will show the available location mappings when the mapping is selected. You can select the required location-org unit mappings from the available mappings.
The date selector will be changed based on the period type of the DHIS2 Data Set.
Once you have selected a value for all the fields, click Send Data to post data directly to the DHIS2 server, or