Appointments and encounters stay separate
An appointment represents a scheduled booking. An encounter represents completed care activity. A cancelled or missed appointment should still exist for scheduling analysis without becoming an encounter.
HEALTHCARE ANALYTICS ENGINEERING CASE STUDY
A healthcare operations analytics model that separates scheduling, care delivery and inpatient activity so each business event can be measured at the correct grain.
01 / PROBLEM
The project models patient scheduling, completed visits, inpatient admissions, facility capacity and patient return behaviour. The main modelling challenge is keeping events separate when their grains and meanings differ.
An appointment is not the same as an encounter, and an encounter is not the same as an admission. Treating them as one event would distort no-show, waiting-time, visit-volume and inpatient metrics.
02 / REPORTING OUTPUT
Metrics calculated from the deterministic synthetic dataset.
03 / ARCHITECTURE
Patients, facilities, clinicians, appointments, encounters and admissions.
Identifiers, timestamps, categories and explicit source fields.
Separate appointment, encounter and admission facts plus reusable dimensions.
Care KPIs, patient engagement, department performance, readmissions and occupancy.
04 / KEY DECISIONS
An appointment represents a scheduled booking. An encounter represents completed care activity. A cancelled or missed appointment should still exist for scheduling analysis without becoming an encounter.
The intermediate appointment model creates Boolean fields for completed, no-show and cancelled outcomes so downstream marts do not repeatedly rewrite status logic.
Waiting time measures the period from patient arrival to consultation start. Consultation duration is handled separately so operational delay and care duration are not mixed together.
Admissions are ordered by patient and time. A window function identifies the next admission, allowing the current admission to be evaluated for a possible 30-day readmission.
Discharges near the end of the dataset do not have a full 30-day period in which a later admission can be observed. The reporting mart therefore excludes those incomplete follow-up records from the denominator.
Admissions are expanded across occupied calendar dates, then occupied beds are compared with licensed facility capacity for each day.
05 / METRIC DEFINITIONS
06 / DATA QUALITY
A production clinical measure could require planned-readmission exclusions, diagnosis logic, transfer rules, risk adjustment and other clinical definitions. The project intentionally keeps that boundary explicit rather than presenting the simplified metric as a medical-quality measure.
07 / DELIVERY
A deterministic Python generator creates the synthetic source files. `dbt seed` loads those files into the raw schema before the transformation models are built.
Repository checks enforce SQL conventions and generate the synthetic data. BigQuery-backed dbt steps can run when the required repository secrets are configured.