06 / HEALTHCARE QI

Streamlining STEMI Care: A Database-Driven Quality Improvement Project in a Synthetic EHR

Reducing door-to-balloon time for STEMI patients through SQL cohort analysis, an OpenEMR clinical decision support build, and a staff adoption survey.

SQLOPENEMRHEALTHCARE QI
View on GitHub
Anatomical heart illustration that beats healthily, then seizes into a heart attack on hover

At a glance

OPPORTUNITY

Door-to-balloon delays in STEMI care directly worsen mortality, yet the workflow was reactive and manual — a classic emergency cardiology quality problem.

WHAT I BUILT

A full QI cycle: SQL cohort construction from a synthetic EHR, three live OpenEMR clinical decision support rules, and a multi-angle evaluation covering cost, workflow timing, and staff sentiment.

IMPACT

Demonstrated a functioning alert-driven intervention with honest adoption findings (ease-of-learning gap) that directly shaped an incremental rollout recommendation.

Overview

STEMI care is time-critical. Clinical guidelines tie mortality directly to how quickly a patient moves from ED arrival through EKG and cardiology confirmation to the catheterization lab for PCI. Every step is a place where delay accumulates — and where a well-designed alerting system can close the gap. This project moves through the full quality improvement cycle against a synthetic hospital EHR.

The analysis ran directly against a PostgreSQL instance of SyntheticMGUH (Synthea-generated data) using SQL in a Quarto notebook. A myocardial infarction cohort of 1,680 patients was narrowed to 441 STEMI patients (with EKG, cardiology consult, and PCI) and then to 214 with complete, consistent timelines. Baseline metrics showed 95% of patients received PCI within 30 minutes of EKG and only 4% exceeded the 90-minute guideline — already efficient in this synthetic data, so the team used the small delayed pool and mortality signal as the entry point for intervention.

Three clinical decision support rules were built and validated live inside OpenEMR: passive alerts to cardiology, cath lab, and pharmacy when a STEMI encounter is created; a modal alert to the cardiologist when EKG results are uploaded; and cath-lab activation once the cardiologist confirms the diagnosis. Each rule was validated by confirming its clinical reminder flipped from due to "Not Due" once the action was acknowledged — a functioning rule set, not a paper design.

The evaluation spanned cost ($70,500 total), training burden (63 staff across nursing, cardiology, transport, and admin), post-intervention DTB monitoring (72.16% meeting the 90-minute benchmark with step-by-step timing breakdown), and a 63-respondent staff survey. The survey — analyzed with a Python NLP pipeline (tokenization, stopword removal, lemmatization) feeding a Tableau word cloud — showed strong perceived patient-care benefit (4.08/5) and workflow ease (4.02–4.25), but notably lower scores for ease of learning (2.57) and implementation (2.56).

This honest adoption gap directly shaped the final recommendations: establish a dedicated STEMI response team, expand post-discharge telehealth follow-up, hold biweekly metric reviews, and roll the intervention out incrementally rather than hospital-wide all at once. The project is a compact demonstration of a real hospital QI cycle — from guideline to database-backed cohort to working EHR intervention to a multi-angle evaluation that includes the human factors determining whether an intervention survives contact with a real care team.

Highlights

  • SQL cohort construction across encounters, conditions, procedures, and medications tables using SNOMED CT codes, CTEs, window functions, and date arithmetic
  • Baseline quality metrics: DTB time, medication compliance, 3-month mortality, and troponin testing against a 214-patient timeline cohort
  • Three live OpenEMR clinical decision support rules with validated alert-to-acknowledgment workflows
  • Post-intervention monitoring showing 72.16% meeting the 90-minute DTB benchmark with per-step timing breakdown
  • Staff adoption survey with NLP-processed qualitative comments revealing an honest ease-of-learning gap that drove incremental rollout recommendations