Connecting to DHIS2

Connecting DHIS2 and mWater
This guide shows how to connect DHIS2 — the open-source health and program information system used by many governments and NGOs — with mWater, step by step and with no coding required. Data can flow both ways: pull DHIS2 indicators into mWater using the AI Integrator, and send mWater survey results back to DHIS2.

Everything below was captured live from the DHIS2 Sierra Leone demo (play.dhis2.org, login admin / district) and the mWater portal. Part 1 covers the DHIS2 side: create a personal access token, find your data's IDs (UIDs), and the Import/Export app. Part 2 covers the mWater side: build the import that pulls DHIS2 data in, and the export that sends mWater data out. Each image is captioned with what it shows and the matching section of the written guide.
1 — Open a DHIS2 demo instance. The demo catalog at im.dhis2.org/public/instances; sign in with admin / district and pick a stable instance. (Step in Section 6 of the guide.)
1 — Open a DHIS2 demo instance. The demo catalog at im.dhis2.org/public/instances; sign in with admin / district and pick a stable instance. (Step in Section 6 of the guide.)
2 — Log in to the DHIS2 Sierra Leone demo with admin / district. The demo resets nightly, so it is safe to practice on. (Section 6.)
2 — Log in to the DHIS2 Sierra Leone demo with admin / district. The demo resets nightly, so it is safe to practice on. (Section 6.)
3 — Once signed in, click your avatar (top-right). Account security is where DHIS2 keeps your personal access tokens. (Section 3.2.)
3 — Once signed in, click your avatar (top-right). Account security is where DHIS2 keeps your personal access tokens. (Section 3.2.)
4 — Account settings opens in the User Profile app. The left sidebar lists “Personal access tokens” — open it. (Section 3.2.)
4 — Account settings opens in the User Profile app. The left sidebar lists “Personal access tokens” — open it. (Section 3.2.)
5 — Manage personal access tokens. There are none yet — click “Generate new token.” (Section 3.2.)
5 — Manage personal access tokens. There are none yet — click “Generate new token.” (Section 3.2.)
6 — Choose the token context. Pick “Server/script context” — that’s what mWater’s Integrator needs. (Section 3.2.)
6 — Choose the token context. Pick “Server/script context” — that’s what mWater’s Integrator needs. (Section 3.2.)
7 — Token details. Give it a clear name (e.g. “mWater Integrator”) and an expiration, then generate. (Section 3.2.)
7 — Token details. Give it a clear name (e.g. “mWater Integrator”) and an expiration, then generate. (Section 3.2.)
8 — The token is shown only once. Copy it now and paste it into mWater’s secrets field; treat it like a password. (Section 3.2.)
8 — The token is shown only once. Copy it now and paste it into mWater’s secrets field; treat it like a password. (Section 3.2.)
9 — Find your data’s IDs via the API: /api/dataElements.json lists each data element’s 11-character UID (e.g. “ANC 1st visit” = fbfJHSPpUQD). You give these to the mWater Integrator. (Section 4.1.)
9 — Find your data’s IDs via the API: /api/dataElements.json lists each data element’s 11-character UID (e.g. “ANC 1st visit” = fbfJHSPpUQD). You give these to the mWater Integrator. (Section 4.1.)
10 — The other direction: the DHIS2 Import/Export app loads data into DHIS2. Data Import accepts JSON, CSV, DXF2, ADX and PDF. (Section 5.3.)
10 — The other direction: the DHIS2 Import/Export app loads data into DHIS2. Data Import accepts JSON, CSV, DXF2, ADX and PDF. (Section 5.3.)
11 — Data import – basic options: upload your file, choose the format and an import strategy (Merge / Append / Update / Delete). (Section 5.3.)
11 — Data import – basic options: upload your file, choose the format and an import strategy (Merge / Append / Update / Delete). (Section 5.3.)
12 — Data import – advanced options: set the ID scheme to UID, and click “Start dry run” first to validate without saving. (Section 5.3.)
12 — Data import – advanced options: set the ID scheme to UID, and click “Start dry run” first to validate without saving. (Section 5.3.)
13 — Now the mWater side. The Integrations page has two halves: Import Integrations (pull data in) and Export Integrations (expose data out). (Sections 4 & 5.)
13 — Now the mWater side. The Integrations page has two halves: Import Integrations (pull data in) and Export Integrations (expose data out). (Sections 4 & 5.)
14 — Import Integrations list, with “+ New Import Integration” (top-right). This is the home for a DHIS2 pull. (Section 4.2.)
14 — Import Integrations list, with “+ New Import Integration” (top-right). This is the home for a DHIS2 pull. (Section 4.2.)
15 — The Import Assistant: choose a workspace, pick API or Webhook, and describe what to import in plain language — the AI builds the connection. (Section 4.2.)
15 — The Import Assistant: choose a workspace, pick API or Webhook, and describe what to import in plain language — the AI builds the connection. (Section 4.2.)
16 — The same assistant with the DHIS2 prompt pasted in: base URL, token auth, the analytics dataValueSet endpoint, the columns, and a daily incremental run. (Section 4.2.)
16 — The same assistant with the DHIS2 prompt pasted in: base URL, token auth, the analytics dataValueSet endpoint, the columns, and a daily incremental run. (Section 4.2.)
17 — Export Integrations list. Each export has a shareable api.mwater.co URL and CSV / JSON / GeoJSON formats — this is the feed DHIS2 reads. (Section 5.2.)
17 — Export Integrations list. Each export has a shareable api.mwater.co URL and CSV / JSON / GeoJSON formats — this is the feed DHIS2 reads. (Section 5.2.)
18 — New Export Integration: name it, then click “Select Data Source” to choose the table and define the DHIS2-shaped columns. (Section 5.2.)
18 — New Export Integration: name it, then click “Select Data Source” to choose the table and define the DHIS2-shaped columns. (Section 5.2.)