DHIS2 Integration
What VLMIS takes from DHIS2, and the stock data it sends back every night for national analytics.
Two directions
VLMIS and DHIS2 are connected in both directions. VLMIS depends on DHIS2 for facilities, identities, and login; and VLMIS feeds DHIS2 with daily stock figures so the national level can analyse and track the vaccine supply chain in standard DHIS2 dashboards.
depends on
+------------------------------->
VLMIS DHIS2
<-------------------------------+
nightly stock data valuesWhat VLMIS takes from DHIS2
- Facilities (organisation units): VLMIS imports the DHIS2 organisation unit tree and keeps a replica of it. New facilities appear in VLMIS only after a refresh from DHIS2 (Maintenance, Settings), and the store hierarchy is built by attaching those units to their supplying parents.
- User identities: an account is created from a DHIS2 username, and the person's name, email, and phone come from the DHIS2 API. See Users.
- Login itself: when you sign in, VLMIS checks your username and password against DHIS2. There is no separate VLMIS password; if your DHIS2 password changes, so does your VLMIS one.
- Data element mapping: every product in the catalog carries an HMIS Code (Maintenance, Products). That code is the id of the DHIS2 data element the product reports into; a product without it cannot be reported to DHIS2.
What VLMIS sends back to DHIS2
VLMIS reports every store's stock activity to DHIS2 automatically, with no user action needed, in two nightly steps:
1. End of Day summary (23:59)
Just before midnight, VLMIS walks the entire store hierarchy from the central store down and, for each store and product, freezes the previous day into an End of Day (EoD) report: opening balance, arrivals, requisitions received, distributions out, returns in and out, physical count adjustments, dispensing, wastage, and closing balance. Products with stock but no movement that day are recorded too (opening equals closing). If a day was missed (for example the server was down), the job catches up one day at a time.
These per-day summaries are what the EOD report in the Reports module shows, alongside the daily operations report.
2. Push to DHIS2 (20:00)
Every evening, VLMIS takes the accumulated, not-yet-posted daily values and sends them to the DHIS2 dataValueSets API. Each product's figures become data values on its HMIS-coded data element, broken down by category (opening balance, received, returned in/out, distributed, dispensing, wastage, discrepancy, closing balance), per facility and per day. A successful upload marks the values as posted; a failed one is retried on following nights, up to five attempts per record.
The result: national DHIS2 dashboards see facility-level vaccine stock and consumption without anyone filling in DHIS2 forms by hand.
Why a product might not appear in DHIS2
The push only carries products whose HMIS Code matches a real DHIS2 data element, only for facilities that exist in DHIS2, and only from an instance configured as production. If national dashboards are missing a product, the HMIS Code in Maintenance, Products is the first thing to check.
What this means day to day
- Record everything in VLMIS on the day it happens: the nightly summary freezes yesterday, and backdated entry distorts what DHIS2 receives.
- Keep HMIS Codes correct when creating products; they are the bridge to national reporting.
- New facilities in DHIS2 need an organisation unit refresh, then a store hierarchy attachment, before their data can flow anywhere.