dbt — Data Transformation
nhic_dbt is the data transformation layer for the HIC analytics platform. It takes raw data ingested from 10 health information source systems and transforms it into a structured data warehouse used by Apache Superset and the GreenRiver BI frontend.
All transformation logic lives in apps/analytics/nhic_dbt/ inside the Healthcare.MOH.RWA.HIC monorepo and runs on dbt-core + dbt-postgres.
Four-layer architecture
Data moves through four discrete layers, each with a single responsibility:
Raw Sources → staging_* → intermediate_* → dwh_* → reporting_* → BI Tools| Layer | Schema prefix | Materialization | Purpose |
|---|---|---|---|
| Staging | staging | table | Ingest raw source data; light cleaning only |
| Intermediate | intermediate | table | Business logic, joins, deduplication, SCD |
| DWH | dwh | table | Conformed dimensions and facts — the analytical core |
| Reporting | reporting | view | Buffer layer optimised for BI tools |
Ten source systems
The staging layer ingests from 10 health information systems across Rwanda’s national health infrastructure:
HMIS TrackerFacility-level health program tracking via DHIS2.
eFICHEOutpatient clinical records.
CRVSCivil registration and vital statistics.
EBUZIMAMaternal health system.
HPEMRHealth post electronic medical records.
IDSR / DHIS2Integrated disease surveillance and response.
ImmunizationNational immunization tracker.
MOH RHMISRoutine health management information system.
CEMRCentral electronic medical records.
SeedsStatic reference and lookup data loaded via dbt seeds.
Explore further
Getting StartedSet up your local dev environment and run dbt against a local Postgres instance.Data ModelsDeep-dive into the four-layer architecture and each staging source.MacrosThe full cleaning and utility macro library with usage examples.Seeds & Reference DataStatic CSV reference tables and when to use seeds vs. staging models.TestingSchema tests, custom generic tests, and the CI test gate.CI/CDThe GitHub Actions pipeline, ECR image builds, and Prefect production runs.
Last updated on