Skip to main content

Population Health Service — Service Overview

Status: populated Owner: TBD Last updated: 2026-04-18 Companion: Service Template · 03 platform-services · 02 DDD

1. Purpose

The population-health-service provides national-scale population analytics and public-health intelligence for the Ghasi eHealth platform. It owns disease registries (TB, malaria, MCH, NCD), cohort builders, quality-metric computation, risk stratification, outreach orchestration, HMIS indicator exports to MoPH DHIS2, de-identification pipelines for research exports, and secondary-use consent enforcement.

This is a licensed add-on module. It never holds source-of-truth clinical records; all analytics are derived from upstream clinical services. Afghanistan is the initial reference jurisdiction; multi-country indicator packs are supported via configuration.

2. Bounded Context

AspectValue
DDD contextPopulation Health (analytic + orchestration)
Bounded context ownerMoPH Analytics team + Ghasi platform
Source of truth forCohort definitions, registry snapshots, quality-metric snapshots, outreach lists, HMIS export jobs, de-identification results
NOT source of truth forPatient demographics, clinical encounters, medications, lab results, immunization records

3. Responsibilities

#Responsibility
R1Maintain versioned cohort definitions and refresh membership against upstream clinical data
R2Compute population dashboards (aggregate counts, age/gender distributions, disease prevalence)
R3Manage chronic disease registries: TB, malaria, MCH, diabetes, hypertension, COPD, asthma, CHF, CKD, mental health, obesity
R4Run quality-metric snapshots (HEDIS, QOF, OHIP QIP, MoPH-custom, donor indicator sets)
R5Execute configurable clinical risk-scoring models and track manual tier overrides with audit trail
R6Generate outreach lists; track contact-attempt lifecycle to terminal state
R7Push HMIS indicator aggregates to MoPH DHIS2 on configured schedules (daily / weekly / monthly per indicator family)
R8Apply de-identification pipeline (k-anonymity k≥5 + differential privacy ε≤1.0) before any research export crosses the trust boundary
R9Enforce secondary-use consent: aggregate-only queries for non-consented patients; identifiable research requires explicit consent + IRB-approved purpose
R10Generate facility-level offline aggregate reports; sync when connectivity restores

4. Non-Responsibilities

Non-responsibilityOwned by
Storing or modifying clinical recordspatient-chart-service, immunizations-service, medication-service
Real-time CDS at point of carecare-plan-service, ai-gateway-service
Patient identity matchingregistration-service
IRB protocol managementMoPH / legal
Trusted Research Environment (TRE) executionRoadmap — separate deployable
SMS/notification deliverycommunication-service

5. Upstream / Downstream Dependencies

6. Key Architectural Decisions

DecisionChoiceRationale
Analytics storeMaterialized snapshots in PostgreSQL 16No DWH dependency in phase 1; ClickHouse migration path in MIGRATION_PLAN
HMIS pushScheduled outbound adapter (DHIS2 REST API v2.39+)MoPH mandates DHIS2; schedule and indicator set are tenant-configurable
De-identificationk-anonymity (k≥5) + Laplace differential privacy (ε≤1.0) computed server-side before exportResearch exports must never expose re-identifiable micro-data per Afghan data protection baseline
Cohort DSLJSON boolean expression tree, validated at write time, versioned immutablyDeterministic; reproducible membership across reruns with same source snapshot
Offline reportsFacility-level JSON snapshot generation; CouchDB-Lite / local SQLite for district health offices; sync via platform sync-protocolAfghanistan: intermittent connectivity at district level
FHIR outputMeasureReport (quality metrics); Group (cohort publishing); Patient de-identifiedFHIR R4 conformant; routed via interop-service
Event domainpopulation_health per NAMING.md (replaces legacy health-population.* subjects)Consistency across platform event naming

7. Slice Involvement

SliceScope
S0Platform scaffold, NATS stream POPULATION_HEALTH, DB migrations, tenant isolation
S1Population dashboard, cohort CRUD, disease registries
S2Quality metrics (HEDIS/QOF/MoPH), risk scoring, HMIS DHIS2 export
S3Outreach lists, de-identification pipeline, research export API
S4Offline facility reports, sync protocol, donor indicator pack

8. Source Reconciliation

Primary source: services/population-health-service/_sources/health-population/ (single module — no multi-module merge). Legacy health-population.* event subjects mapped to population_health.* per NAMING.md. FR-POP-* identifiers are preserved in legacy column; new canonical refs use FR-POPHEALTH-* prefix for synthesized requirements. No removed specs/modules/... paths referenced in this documentation set.