Inspiration

Nigeria accounts for nearly 20% of global maternal deaths despite representing just 2% of the world's population. In rural Northern Nigeria, maternal mortality exceeds 1,500 per 100,000 live births — among the highest recorded anywhere on Earth.

The painful irony is that Nigeria is not without resources. There are 160,000 Community Health Extension Workers (CHEWs) already deployed across the country, seeing pregnant women every week. DHIS2 — a world-class health data platform — is live in every Nigerian state. Mobile networks, even basic ones, exist almost everywhere.

The gap is not infrastructure. The gap is a decision support gap at the last mile.

When a CHEW named Aisha visits Hauwa — 32 weeks pregnant, in a village 40km outside Kano — she has no clinical decision support, no internet, and no backup. She makes life-or-death calls from memory alone. When Hauwa's blood pressure reads 148/96, Aisha has no way to know that crosses the WHO threshold for pre-eclampsia risk. Hauwa goes home. Three days later, she doesn't.

Raya was built for Aisha. And for Hauwa.


What We Built

Raya is an offline-first clinical decision support system for CHEWs in Northern Nigeria, targeting maternal and neonatal mortality reduction in Kano State.

It has four integrated layers:

1. Offline Clinical Triage (CommCare + XForms) Three structured clinical modules run entirely on the CHEW's Android phone with zero internet dependency:

  • Antenatal Risk Scoring — captures BP, oedema, haemoglobin, gestational age. Flags pre-eclampsia risk (systolic ≥ 140 or diastolic ≥ 90 per WHO IMPAC guidelines) and generates a referral slip instantly on-device.
  • Labour Danger Signs Triage — screens for PPH, eclampsia, prolonged labour, and triggers immediate referral pathways.
  • Neonatal Immediate Assessment — APGAR-aligned scoring for breathing, temperature, and feeding at birth.

All form logic runs in XForms on CommCare's Javarosa engine, stored in AES-256 encrypted SQLite on the device. No server call is required to open, fill, or submit any form.

2. USSD Fallback (Africa's Talking) For CHEWs without smartphones, Raya is accessible via *384*56224# on any basic feature phone. A stateless Node.js webhook processes danger sign selections and returns triage decisions within 5 seconds — no data connection, no app, no barrier.

3. Automatic National Sync (CommCare → DHIS2) When a CHEW's device detects any connectivity — even 2G — CommCare syncs automatically. A custom Node.js bridge (our MOTECH-equivalent middleware) receives the CommCare XML payload, transforms it, and posts to DHIS2's Tracker API (POST /api/tracker), creating a tracked enrollment for every patient under the "Raya ANC" program.

4. Population-Level Dashboard (DHIS2) Aggregate indicators — ANC visit counts, high-risk flag rates, referral rates by LGA — are immediately visible to district health officers in Kano State through DHIS2's native analytics dashboards. No paper reports. No weekly meetings. Real-time signal from the last mile.


How We Built It

We made a deliberate architectural choice from day one: build on what Nigeria already has.

CommCare is already used for CHW programmes across Nigeria. DHIS2 is Nigeria's Federal Ministry of Health's national HMIS. Africa's Talking powers real health USSD services across Sub-Saharan Africa. We did not invent new infrastructure — we built the bridge that was missing between these existing systems.

Clinical grounding first. Every decision threshold in Raya's forms is sourced from WHO IMPAC guidelines and the Nigeria FMOH CHEW Training Manual. The system is designed for eventual sign-off from SOGON (Society of Gynaecology and Obstetrics of Nigeria) before any production deployment.

Compliance by design. Patient data is AES-256 encrypted at rest on-device (CommCare's native SQLCipher). The system architecture is aligned with Nigeria's Data Protection Act 2023 (NDPA), with explicit consent capture in the form flow and health data treated as the highest sensitivity tier.

Idempotent infrastructure. DHIS2 metadata — tracked entity types, program stages, org unit hierarchy (Nigeria → Kano State → LGA → Facility) — is provisioned via automated API scripts that can be re-run safely. Resettable, reproducible, deployable.


Challenges We Faced

The offline/online boundary is harder than it looks. CommCare's Data Forwarding fires on sync, not on form submission. In deep rural areas, this gap can be hours. Designing the system so that the clinical decision (the referral) happens at the point of care — offline — while the data aggregation happens later, required careful separation of concerns between the form logic layer and the sync layer.

XForms logic is unforgiving. The clinical triage logic lives in XPath expressions inside XML — a domain with very little modern tooling or debugging support. Getting the pre-eclampsia threshold calculation, the case block structure, and the referral slip generation to work correctly offline required deep reading of the CommCare and JavaRosa specifications.

Bridging two opinionated systems. CommCare and DHIS2 have fundamentally different data models — CommCare thinks in Cases and Forms, DHIS2 thinks in Tracked Entities, Enrollments, and Events. The middleware bridge had to reliably translate between these models, handling XML parsing, XMLNS fingerprinting for form routing, and DHIS2's strict Tracker API payload structure — all without a pre-built MOTECH instance.

The 5-second wall. Africa's Talking terminates USSD sessions that don't respond within 5 seconds. Every additional triage question added to the USSD flow had to be weighed against response time. We kept the fallback lean by design — two steps, one decision, one outcome.


What We Learned

That the hardest problems in global health are not technical. The technology to solve Nigeria's maternal mortality crisis has existed for years. CommCare, DHIS2, and mobile networks are all proven at scale. What was missing was someone connecting them specifically for the last mile — offline, in context, with clinical grounding — and building it simply enough that a CHEW with a $20 phone in rural Kano could use it without training beyond what she already has.

We also learned that building for low-resource settings forces better engineering. Every design decision had to justify itself against the constraint: does this work with no internet, on a basic Android phone, for a user who cannot afford for this to fail? That constraint made Raya more robust, not less.


What's Next

Raya is pilot-ready. The proposed next step is a 6-month pilot across 3 LGAs in Kano State — 500 CHEWs, clinical protocol validation with SOGON, and a formal partnership with the Kano State Primary Healthcare Development Agency.

The architecture is deliberately replicable. The same CommCare + DHIS2 + Africa's Talking stack, with adapted clinical modules, could serve CHW programmes in Zamfara, Sokoto, or any high-burden state in Northern Nigeria — or across Sub-Saharan Africa. Kano is the proof of concept. The framework is the contribution.

Built With

Share this project:

Updates