Shared CTE foundation for analytics queries.
Produces three CTEs:
base_runs
run_scores
run_data
Both the metrics and review-dashboard analytics layers build on top of run_data.
Shared CTE foundation for analytics queries.
Produces three CTEs:
base_runs— filtered, deduplicated (latest run per patient × template), with metadatarun_scores— per-run pass/total/pct aggregates (excludes summary + not_applicable)run_data—base_runsenriched with score columnsBoth the metrics and review-dashboard analytics layers build on top of
run_data.