SQL

Clinical Operations SQL Toolkit

A tested query library that standardised cohort, funnel and retention reporting.

All projects
Clinical Operations SQL Toolkit preview
SQLdbtRedshiftWindow functions

Business problem

Every analyst wrote their own cohort logic, so the same question produced different answers depending on who ran it.

Dataset

Operational EHR extracts covering 2.4M patient encounters across 14 clinics.

Methodology

  • Catalogued the 30 most-requested ad-hoc reports.
  • Rewrote them as parameterised dbt macros with unit tests.
  • Documented definitions in a shared metric glossary.

Key findings

  • Nine reports disagreed on the definition of an active patient.
  • Analyst turnaround time dropped 40% after standardisation.

Recommendations

  • Make the macro layer the only sanctioned path for cohort logic.
  • Review the metric glossary quarterly with clinic operations.