feat: retention funnel chart tab with treatment line depth (Task C.1)

This commit is contained in:
Andrew Charlwood
2026-02-07 03:12:30 +00:00
parent 37bac5d841
commit a6cf6efa18
6 changed files with 190 additions and 9 deletions
+14
View File
@@ -24,6 +24,7 @@ from data_processing.pathway_queries import (
get_trust_heatmap as _get_trust_heatmap,
get_trust_durations as _get_trust_durations,
get_directorate_summary as _get_directorate_summary,
get_retention_funnel as _get_retention_funnel,
)
DB_PATH = Path(__file__).resolve().parents[2] / "data" / "pathways.db"
@@ -180,3 +181,16 @@ def get_directorate_summary(
) -> list[dict]:
"""Per-directorate summary (name, patient count, drug count) for landing cards."""
return _get_directorate_summary(DB_PATH, date_filter_id, chart_type)
# --- Retention funnel (Phase C) ---
def get_retention_funnel(
date_filter_id: str = "all_6mo",
chart_type: str = "directory",
directory: Optional[str] = None,
trust: Optional[str] = None,
) -> list[dict]:
"""Patient retention by treatment line depth."""
return _get_retention_funnel(DB_PATH, date_filter_id, chart_type, directory, trust)