Cardiometabolic Population Analysis
Data analysis to identify patterns in patient demographics, pharmacotherapy adoption, and healthcare resource utilization (HRU) to optimize clinical care pathways for cardiometabolic populations.
The project uses synthetic patient records (Synthea, 1,163 patients) mapped to the OMOP Common Data Model (v5.4), and combines a descriptive cohort analysis with a machine-learning patient segmentation.
Business questions:
-
Which cardiometabolic indications drive the highest post-diagnosis outpatient volume?
-
What is the standard timeline and rate for patients to start first-line pharmacotherapy?
-
Do patients fall into distinct clinical segments, based on their age and conditions, and how do treatment and visit patterns differ between them?
Technology stack:
SAS (data cleansing, OMOP ETL, cohort building and survival analysis),
Python (patient segmentation with k-means clustering: pandas, scikit-learn, SciPy)
Microsoft Power BI (DAX, snowflake schema, 2 dashboards).
Pipeline: SAS ETL → cohort → Python segmentation → Power BI


















Key Insights
-
Treatment initiation: 60.5% of the cohort (371 of 613 patients) started a core cardiometabolic drug within 1 year of diagnosis, and 73.7% were treated at some point. The earlier 96.3% figure is replaced, because the drug classes and the time window were redefined and drug starts are now counted from the index diagnosis.
-
Timing: The Kaplan-Meier time-to-treatment curve shows a steep initial step. About 43% of patients start on the diagnosis day (median time to treatment is 0 days among the treated), and 127 patients start several drug classes on day 1.
-
Healthcare resource utilization: Outpatient visits (wellness visits excluded) increase in the year after diagnosis compared with the year before, in every segment. The rise is largest in the early hypertension segment (0.4 → 1.2 visits per patient) and in the older dyslipidemia and obesity segment (0.2 → 1.1).
-
Cohort: The cardiometabolic cohort has 613 patients, 52.7% of the 1,163 in the dataset. The attrition flow is 1,163 → 613 → 508 → 487 patients, after the prior-observation and follow-up requirements.
-
Initial drug class: While "Other Regimen" is the most common broad category for initial treatment, Thiazide and CCB (Amlodipine) lead the specific first-line cardiovascular monotherapies.
-
Type 2 diabetes: Of the 73 patients with type 2 diabetes, 23.3% received a diabetes drug within 90 days. The median time from diagnosis to a first complication is 6.0 years, and about 47% of patients have had a complication by year 6.
-
Patient segments (k-means, 529 patients with at least 5 years of follow-up): Four segments emerged, with high stability (bootstrap ARI 0.89):
-
S1 Early hypertension (255 patients, mean age 18): almost all treated within a year, mostly with ACE inhibitors, thiazides and calcium channel blockers.
-
S2 Prediabetes (179 patients, mean age 34): only 2% treated within a year, and 30% ever, so mostly managed without drugs.
-
S3 Dyslipidemia + obesity (52 patients, mean age 52): 92% treated within a year, about 90% with statins, median 21 days to treatment.
-
S4 Multimorbid T2D (43 patients, 4.9 conditions on average): the most complex patients, mostly on diabetes drugs, and only 40% treated within a year but 93% ever.
-
-
Caution on the segments: The segments mirror the index condition, because Synthea assigns drugs by condition, so differences in treatment between segments are largely structural. The 84 patients with less than 5 years of follow-up are not segmented.
1. Data Source
-
Data source is derived from synthetic patient records (Synthea).
-
The dataset is standardized and structured according to the OMOP Common Data Model (CDM) v5.4 architecture.
-
Standard vocabularies (OHDSI ATHENA): Conditions are mapped from SNOMED codes to standard OMOP concepts. Drugs are mapped from RxNorm to ATC classes, and the cardiometabolic drug classes are defined with ATC groups A10 (diabetes drugs), B01 (antithrombotics) and C01 to C10 (cardiovascular drugs).
-
Core clinical domains analyzed include: Patient Demographics, Condition Occurrence (Diagnoses), Drug Exposure (Prescriptions), and Visit Occurrence (Encounters).
2. Data Exploration
-
ETL and export: Data was processed with a sequence of SAS OnDemand scripts (setup, import, OMOP table builds, vocabulary mapping, cohort and analysis, export) and exported as analytical CSV files for Power BI. The main tables are fact_cardio_cohort (613 index patients), fact_condition_flags and fact_condition_events (1,163 patients), fact_hru_utilization (487 patients), fact_cohort_attrition and the type 2 diabetes tables.
-
Standardisation: Raw Synthea records were mapped to the OMOP CDM v5.4 architecture. Source conditions (SNOMED) and medications (RxNorm) were converted to standard concept identifiers across the person, condition occurrence, drug exposure and visit tables. Drugs were then grouped into ATC classes.
-
Cohort definition: Each patient is indexed on the first occurrence of a cardiometabolic diagnosis (type 2 diabetes, prediabetes, hypertension, coronary artery disease or dyslipidemia). Person identifiers were harmonised across tables, and an observation period was built for each patient, so that only patients with enough prior and follow-up time are compared. An attrition table tracks the steps: 1,163 patients → 613 in the cohort → 508 with prior observation → 487 with 1 year of follow-up.
-
Treatment timing: Time to treatment was measured from the index date to the first core cardiometabolic drug, with same-day multi-drug starts handled explicitly. Kaplan-Meier curves (by indication) and 1-year and any-time initiation rates were computed from this, and a separate Type 2 diabetes analysis follows these patients to their first drug and to complications.
-
Healthcare resource utilization: Outpatient and inpatient encounters were counted in the year before and the year after the index date. Wellness visits are flagged, so the comparison can be shown with and without them.
-
Condition profile: Sixteen condition flags, grouped into Cardiovascular, Metabolic and Related, show which comorbidities each patient has and when each one first appeared. These flags are also the input to the segmentation.
-
Segmentation (Python): Patients with at least 5 years of follow-up (529) were clustered with k-means on age at diagnosis and 8 comorbidity flags (features scaled to 0–1, sex excluded). The number of clusters (k = 4) was chosen using silhouette score, bootstrap stability (ARI 0.89) and a minimum segment size of 5%, and the result was cross-checked with hierarchical (Ward) and Gower-distance clustering. The profiles, tests and PCA map were exported to Power BI.
3. Data Visualization
-
Data model: In Power BI, a relational model (snowflake schema) was built around the patient (cdm_person), linking the cohort, condition, drug, visit and utilization tables to dimension tables for conditions, drug classes, visit types and patient segments. Custom DAX measures calculate patient counts, rates (including a Wilson 95% confidence interval) and medians. Slicers for segment, primary indication, gender, race and age group filter every page.
-
Overview Dashboard: the population at a glance. KPI cards (patients in the dataset, cohort size and prevalence, treated within 1 year, treated at any time, average age at diagnosis), the prevalence of the 16 conditions by group, patients by age group and gender, cumulative treatment initiation over the first year, and the distribution of first-line drug classes and top initial drugs.
-
Patient Segments Dashboard: the result of the Python clustering. KPI cards, patients per segment, treatment within 1 year with confidence intervals, a condition-profile heat matrix, first-line drug class by segment, outpatient visits before and after diagnosis, a PCA patient map, a segment profile table and a method note.
Other projects


