Developer Reference

Data model — source to dashboard lineage

Every source table, every column, every Silver entity, every dbt model, and every mart table — fully traced to the dashboard KPI it powers.

Epic Clarity835 EDIERP Supply ChainHR / PayrollHL7 Stream

Five-layer data architecture

From source systems to dashboard-ready marts

Data flows through five layers before reaching a dashboard. Each layer is write-once relative to the layer below — you can always replay Silver from Bronze, and Gold from Silver, without touching source systems.

Golden rule: Bronze is write-once. Silver is canonical. Gold is recomputable. Marts are disposable. If a dbt mart has a bug, drop and rebuild — never touch Bronze or Silver to fix it.

LayerNameTechnologyRefresh cadenceWhat is storedWritten by
0Source systemsSQL Server · REST APIs · SFTP · MLLPReal-time → dailyLive operational data in vendor-native schemas. Never query directly for analytics — always extract to Bronze first.Epic, ERP, HR, Payer
1Bronze — rawS3 / GCS / ADLS · Parquet / .hl7On receipt (immutable)Exact bytes as received. No transformation. Partitioned by tenant/source/date. 7-year HIPAA retention.Ingestion pipeline
2Silver — canonicalPostgreSQL + Parquet<8s HL7 · daily batchParsed, validated, MPI-matched. One canonical row per entity. Schema enforced. RLS by tenant_id.Stream processor + Airflow
3Gold — dbt modelsSnowflake + dbt CoreHourly ops · nightly analyticsBusiness-logic tables: LOS, denial attribution, supply cost per case, staffing ratios, risk adjustment.dbt scheduled runs
4Marts — dashboard-readySnowflake views + MetabaseNightly full + intraday incrementalPre-aggregated, pre-joined. One mart per dashboard area. No PHI in AI narrative mart.dbt mart models

Silver canonical entities

dim_patient

Sources: MPI engine

PK: enterprise_patient_id (UUID)

Golden record ID. Never exposed in dashboards. PHI columns (mrn, dob) encrypted at rest.

fact_encounter

Sources: PAT_ENC + HSP_ACCOUNT

PK: encounter_id = PAT_ENC_CSN_ID

~5M rows/year. LOS, DRG, readmit_30d_flag (self-join), attending_prov_id, patient_class decoded.

fact_claim

Sources: CLAIM_INFO + ARPB + 835 EDI

PK: claim_id

Denied_flag, denial_category, preventable_flag derived. paid_amount from 835 only — not in Clarity.

fact_or_supply

Sources: ERP CASECHARGES + OR_LOG

PK: supply_line_id (synthetic)

Item cost per surgical case. Two-step join: ERP case_id → bridge → OR_CASE_ID → PAT_ENC_CSN.

fact_staffing_shift

Sources: SNO_SCHED + UKG/Kronos

PK: shift_id (synthetic)

Hours scheduled vs worked. Labour cost calculated. staff_type critical (travel = 2–3× rate).

fact_referral

Sources: REFERRAL table

PK: referral_id

Used for 90-day leakage self-join. Multi-facility: union all Epic instances first.