CVD Risk — dependency graph demo
ViewDefinition → SQLView → SQLQuery graph computing CVD risk on synthetic data, with pie / bar / butterfly / line charts.
The cohort
A synthetic cohort of 60 patients aged 40–79, roughly half male and half female. No one here is a real person — everything is produced by a small deterministic generator, but using the same real coding systems a Synthea export would (LOINC, SNOMED CT, RxNorm).
Each patient carries exactly the inputs a cardiovascular risk score needs:
- Systolic blood pressure (LOINC 8480-6) and total cholesterol (LOINC 2093-3) — six quarterly readings each.
- HDL cholesterol (LOINC 2085-9) — a single recent value.
- Smoking status (LOINC 72166-2) — about 1 in 4 are current smokers.
- Diabetes and hypertension as Condition resources (SNOMED).
- Statin therapy as a MedicationRequest (RxNorm).
Every resource is tagged cohort = cvd-demo, so the views below see only this cohort.
1. Load the cohort
One transaction bundle creates everything in a single POST: the 60 patients with their observations, conditions and medications, plus the ViewDefinition / SQLView / SQLQuery definitions used below.
12345678
POST /fhir
Content-Type: application/json
{ "resourceType": "Bundle",
"type": "transaction",
"entry": [
{ "resource": { "resourceType": "ViewDefinition",
"id": "vd-patient", "resource": "Patient" } },
… 60 patients + observations + conditions ] }
2. The data, flattened (ViewDefinition)
Each cell shows one slice of the cohort as a plain table, read straight from the FHIR resources.
Patient demographics
Flat projection of cohort patients: one row per Patient with id, administrative gender and birth date.
Result (60)
patient_id
gender
birth_date
3. One row per patient (SQLView)
Here the per-measurement history is reduced to the latest value per patient, and each patient gets a cardiovascular risk score and a category.
Patient risk factors (latest values)
One row per patient with the latest systolic BP, total cholesterol and HDL plus smoking, diabetes and statin flags.
Result (60)TableChart