DHIS2

The DHIS2 module lets BridgeERP HMS report aggregate health data to national HMIS platforms — KHIS in Kenya, eHMIS Uganda, HMIS Tanzania, DATIM / PEPFAR and similar instances built on DHIS2. It turns the hospital’s clinical activity into DHIS2 data values keyed by data element, organisation unit and reporting period, then pushes them to the ministry server and tracks confirmation. This page covers connecting an instance, mapping clinical activity to data elements, the period and org-unit model, and running a sync.

Where to find it

Everything lives under HMS Core → Integration → DHIS2:

MenuOpens
Configuration → DHIS2 InstancesServer connections (hms.dhis2.instance) — base URL, API version, auth and purpose.
Configuration → Field MappingsRules linking a platform metric to a data element (hms.dhis2.mapping).
Data ElementsThe DHIS2 data-element catalogue (hms.dhis2.dataelement) with value and aggregation types.
Data Sets (Forms)Reporting forms that group data elements (hms.dhis2.dataset).
Data ValuesThe actual figures queued and pushed (hms.dhis2.datavalue).
Org UnitsThe facility’s place in the national org-unit hierarchy (hms.dhis2.orgunit).
Sync RunsEach push / pull job and its outcome (hms.dhis2.sync.run).

Before you start

  1. Get the instance details from the ministry: base URL (for example https://play.dhis2.org/40.0), the API major version (39, 40 or 41) and credentials.
  2. Know your org-unit. The ministry assigns each facility a DHIS2 organisation-unit id; you cannot push without it.
  3. Have the data-element ids. Each figure you report maps to a ministry data element id and category-option-combo.

Step-by-step: connect an instance and push

  1. Open Configuration → DHIS2 Instances and create a record. Enter Name, a unique Code, the Base URL and API version.
  2. Pick the Auth Type: HTTP Basic (username / password), Personal Access Token (paste the PAT), or OAuth2 (PKCE). Set the Purpose (National HMIS, DATIM / PEPFAR, Ministry Internal, Research, Partner Organization or Test / Sandbox) and the ISO Country Code.
  3. Set the Default Reporting Org-Unit and the local Facility it maps to.
  4. Click Test Connection. The instance calls /api/system/info and posts the server version into the chatter; on success the Status turns Active, otherwise Error.
  5. Map your metrics under Field Mappings, then create a Sync Run with direction Push and a Period, and start it. Data values move to the instance via /api/dataValueSets.
Tip — Begin with a Test / Sandbox purpose against the public DHIS2 play server to prove your mappings before pointing at the live national instance.

Data elements & mapping

A Data Element describes one reportable quantity. Its Value Type mirrors DHIS2 (Number, Integer, Positive Integer, Percentage, Text, Boolean, Date, Coordinate and so on, defaulting to Integer) and its Aggregation Type says how DHIS2 combines values (Sum, Average, Count, Min, Max, None, Custom). The Domain Type is Aggregate or Tracker, and an Indicator Group ties it to a national return such as MoH 731 (HIV/ART), 705-A/B (morbidity), 710 (vaccination), 711 (service workload), 717 (family planning), 745 (mortality), DATIM / PEPFAR MER, or IDSR weekly / monthly.

A Field Mapping links a platform figure to a data element. Its Local Aggregation chooses how the source is summarised; when the aggregation is not a simple count, the Local Field names the value to sum or average.

Periods & org-units

DHIS2 keys every value by period and org-unit. The Period on a data value and on a sync run follows DHIS2 period notation (for example a monthly period like 202406). The Org Unit is the facility’s node in the national hierarchy; set a default on the instance so pushes are stamped correctly. A data value is unique per instance, org-unit, data element, period and category-option-combo, which prevents accidental double reporting.

Period typeSubmission cadenceTypical use
DailyEvery dayHigh-frequency surveillance counts.
WeeklyEach epi weekIDSR weekly disease surveillance.
MonthlyEach calendar monthThe default; most routine HMIS returns.
QuarterlyEvery three monthsProgramme indicators reported quarterly.
SixMonthlyTwice a yearSemi-annual programme reviews.
YearlyOnce a yearAnnual facility returns.
FinancialOct / FinancialJul / FinancialAprFinancial year (Oct / Jul / Apr start)Returns aligned to a fiscal calendar.

Org-units form a hierarchy keyed by a DHIS2 UID, with a level indicating where each sits: 1 = country, 2 = province, 3 = county / zone, 4 = district, 5 = facility. Each org-unit can be linked to a local facility record so activity maps to the right reporting unit automatically.

Indicator groups

Every data element is tagged with the national report it feeds, so you can build a data set by picking a group rather than hunting individual elements.

GroupCovers
MoH 731HIV / ART
MoH 705-A / 705-BUnder-5 and over-5 morbidity
MoH 710Vaccination
MoH 711Service workload
MoH 717Family planning
MoH 745Mortality
DATIM / PEPFAR MERPEPFAR monitoring, evaluation & reporting
IDSR Weekly / MonthlyIntegrated disease surveillance & response
HR / Staffing, Laboratory KPI, FinanceOperational support returns

Data-value & sync states

Data-value storage statusMeaning
Local onlyCalculated, not yet queued.
Queued for pushSelected for the next sync run.
Pushed to DHIS2Sent in a sync run.
Confirmed by DHIS2The server import response accepted it.
Push ErrorRejected; see the error message.
Imported from DHIS2Pulled down from the server.

A Sync Run carries a Direction (Push, local → DHIS2) and a status of Queued, Running, Success, Partial Success, Failed or Cancelled. The instance records Last Push At and Last Pull At timestamps.

Instance field reference

FieldMeaningRequired
Name / CodeLabel and unique key.Yes (code unique)
Base URL / API versionThe DHIS2 server root and API major version.Yes
Auth TypeHTTP Basic, Personal Access Token or OAuth2 (PKCE).Yes
Username / Password / PAT TokenCredentials per auth type.As per auth
PurposeNational HMIS, DATIM/PEPFAR, Ministry Internal, Research, Partner Org or Test/Sandbox.Yes
Country CodeISO-3166 alpha-2 (KE, NG, ZA, UG, TZ, RW…).No
Default Reporting Org-Unit / FacilityThe org-unit pushes are stamped with and the local facility mapped.Recommended
StatusActive, Disabled or Error.Yes

Roles & access

  • DHIS2 Viewer — read instances, mappings, data values and sync runs.
  • DHIS2 Operator — queue figures and run syncs.
  • DHIS2 Administrator — configure instances, data elements and mappings.

MOH reporting

Because data elements can be grouped under an indicator group, the same engine feeds the standard ministry returns — for instance the MoH 711 Returns available under HMS Core → Clinical → Reports — while DHIS2 push delivers the aggregate figures to the national server. Align your data-element Indicator Group values with the return your facility submits.

Troubleshooting

SymptomLikely cause & fix
Test Connection returns ErrorWrong base URL, API version or credentials; the chatter shows the HTTP status returned by /api/system/info.
Sync run reports Partial SuccessSome values were rejected; open the data values with status Push Error and read the message.
Nothing to pushNo data values matched the filter; confirm figures are Queued for push and the period matches.
Duplicate value errorThe same instance / org-unit / element / period / combo already exists; adjust the period or combo.

Automated MoH 731 → DHIS2

The HIV/ART MoH 731 report can stage its indicators as DHIS2 data values and push them to the national instance via the existing sync engine. On a MoH 731 report use Stage to DHIS2 to build the data values for the period, then Stage & Push to transmit; a monthly cron can do this automatically. Each indicator is mapped to its DHIS2 data element (HTC tested/positive, ART new/current, viral-load suppressed) for the facility’s org unit. Live transmission needs the instance credentials and the facility’s DHIS2 org-unit UID configured.

Was this page helpful?