Skip to content

Power BI → Metabase over DuckDB gold tables

This demo mirrors the SSM reporting pattern: the pipeline publishes gold tables, and a BI tool reads them for population analysis and outreach. Metabase stands in for Power BI. These are demo equivalents of the report purposes in the requirements, not a claim that SSM's original Power BI files were supplied or reproduced.

SSM / Power BI report purpose Metabase dashboard DuckDB gold tables What the viewer can inspect
Population overview Population overview gold_population, gold_patient_summary Age bands and the underlying patient cohort
Chronic-condition prevalence Chronic conditions gold_population Patients with active recorded conditions
Preventive-care gaps Immunization gaps gold_immunization_status Patients without a recorded qualifying flu immunization in the prior twelve months
Longitudinal laboratory results Lab trends gold_lab_trends Dated HbA1c results, units and source observation IDs
Predictive stratification and outreach Population risk gold_risk_flags, gold_patient_summary, gold_lab_trends, gold_blood_pressure, gold_outreach Warning-flag burden, flag types, A1c trend cohorts, BP control over time, ASCVD bands including insufficient data, and an outreach review queue with cited inputs

The Population risk dashboard uses the same allowlisted SQL as the Vue Predictive reports page. Its source is PredictiveReports.Definitions; dashboard definitions live in bi/metabase. Each Vue chart exposes its exact SQL, source tables and captured data-as-of time. The browser's static snapshot contains real exported pipeline results and remains usable on a phone without a Metabase server.

The charts have specific meanings:

  • Warning-flag burden counts emitted warnings for outreach review. It is not a validated clinical risk score.
  • A1c trends use the latest three valid, dated percent results. Strictly increasing values are rising; strictly decreasing values are improving; other complete triples are stable/mixed. Fewer than three usable values remain insufficient data.
  • BP control over time uses the last valid reading per patient and UTC calendar month. Systolic at least 140 or diastolic at least 90 is elevated; the chart does not carry an unmeasured value forward.
  • ASCVD bands use existing rule outputs. Missing scores remain in an explicit insufficient-data category; no missing inputs are imputed.
  • The outreach queue lists patients with captured warning flags, reasons and cited source IDs. “This week” describes the review workflow, not a claim that appointments were scheduled.

The SSM view answers a population and outreach question. The Oystehr view answers a point-of-care question for the doctor in the room. Vue shows actual Way 2 Zambda fixture outputs as patient cards and a population roll-up alongside the gold-table reports. The parity banner reports measured agreement and lists disagreements. Fixture mode does not claim that a live Oystehr seed has been applied.

Reproduce the local visual proof

Build the lakehouse before opening its file in Metabase. DuckDB's writer must finish before a separate read-only Metabase process opens it; stop Metabase before refreshing the file. Follow the local Metabase setup for the pinned image ghcr.io/motherduckdb/metabase-duckdb:0.63.17-duckdb1.5.6.0, pinned driver and provisioning command. Bind the container only to loopback.

After provisioning all five dashboards, supply the local admin email/password through process-scoped METABASE_ADMIN_EMAIL and METABASE_ADMIN_PASSWORD. Set METABASE_URL to the bare loopback origin if it differs from http://127.0.0.1:3000. With the web Playwright dependencies and Chromium installed, run:

node bi/metabase/capture.mjs

The runner verifies that each provisioned card still matches its committed SQL, executes every query, rejects failed or truncated results, captures its real row count and gold-table as-of time, and waits for the browser cards to render. It blocks browser requests outside the local Metabase origin. Credentials, session cookies and source rows are excluded from the JSON evidence.

Successful execution writes docs/screenshots/metabase-{population,conditions,immunizations,labs,risk}.png and docs/screenshots/metabase-row-counts.json. The JSON is the query-count receipt; screenshots show the actual rendered dashboards. This page describes the verification procedure, not an execution claim. Run-specific results belong in VERIFY.md.

The capture selectors follow the pinned upstream DashCard component and Visualization component.