Table of Contents

23.02. DHIS2 LMIS integration

DHIS2 is an open source data warehouse that can be used to store, aggregate and display health data. It has also been modified to be used as a simple stock reporting and ordering tool at small health facilities. mSupply can interact with this functionality to receive the stock on hand reports and requisitions and create replenishment orders for the facilities based on that information. This page describes how it works and what setup must be carried out in mSupply.

The process

Fetching requisitions

In this scenario, the supplying facility is using mSupply and the requesting facility is using a DHIS2 Event app. The requesting facility creates and saves a requisition in the event app and it is saved to the DHIS2 database. On a daily basis, mSupply checkes the DHIS2 database for completed requisitions, retrieves them and sends them to the supplying store's copy of mSupply as a customer requisition. The process is illustrated in this diagram:

Acknowledging shipment receipts and sending shipment transactions

The next part of the process is that the sending store sends goods to the facility that requested them with the requisition. The goods are sent with a packing list that contains a QR code. When the receiving facility receives the goods they add the consignment to the DHIS2 RTS capture app by scanning the QR code and check what has arrived. When they are happy the receiving facility marks the consignment as complete.

On a daily schedule mSupply checks the DHIS2 database for complete consignments and retrieves them (at the same time mSupply fetches stock on hand figures for the items in the various facilities. This is not shown in the diagram below). mSupply processes the details of the consignment and sends details of the stock supplied for the consignment to the DHIS2 server. The DHIS2 server then sends the updated stock levels to the RTS capture app at the requesting facility.

This process is illustrated in the following diagram:

Setup

Items

To send item details to DHIS2, mSupply has to know the identity of each of its items in DHIS2. There are two options for doing this:

  1. Use the item's universal code. See the 4.01.01 Items - General tab section for details on setting this.
  2. Use the DHIS2 UID or the DHIS2 code. Choose which one you want to use then enter those values in an item's custom field 1, 2, 3 or 6 (the 3 text custom fields).

The final step in setting up items is to tell mSupply which ones to send data to DHIS2 for. Do this by checking the Include in DHIS2 data push checkbox on an item's details window - see the 4.01.01 Items - General tab section for details on setting this.

Stores

Stores in mSupply correspond to org units in DHIS2. mSupply needs to know the Org unit reference for each of the stores that data needs to be sent to DHIS2 for.

To do this, add a “Dhis2Code” store custom field containing the Org unit reference to each store you want to send data to DHIS2 for. For all stores you don't want to send data to DHIS2 for, simply leave the “Dhis2Code” custom field empty.

For details on how to set store custom codes see the 26.07. Virtual stores section.

mSupply preferences

Before you can send data to and retrieve data from a DHIS2 LMIS instance, you need to tell mSupply where the data has to go and come from. To do that, go to File > Preferences and click on the DHIS2 LMIS tab to get to this window:

If this page already has settings entered and they have been used to successfully connect to the DHIS2 database then a “Last successful connection: date & time” message will show next to the Test connection button.

After entering the values you should click on the Test connection button to save the credentials and check that mSupply can now access the DHIS2 database. If the connection is successful you will see a green “Connection successful” message next to the button.

If the connection is not successful you will see a red “Authentication failed” message next to the button. Check your settings, edit them as necessary and try again. The connection problem may not be the credentials, it could be something else like the settings for firewalls between mSupply and the DHIS2 database.

Once configured, a scheduler will run every 5 minutes and regularly pull data from and send data to the DHIS2 LMIS instance. If there are any errors these will be saved in the log (see the 25.19. The system log page for details).