Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Charlwood 7e63e6ea45 feat: add desktop packaging (pywebview + PyInstaller)
- resource_path.py: frozen/dev path resolution for bundled data files
- app_desktop.py: pywebview entry point (Dash in daemon thread)
- app.spec: PyInstaller onedir config with data files and hidden imports
- Updated queries.py, card_browser.py, app.py to use get_resource_path()
- Added pywebview + pyinstaller to project dependencies
- Fixed unresolved merge conflict in .gitignore
- Removed stale 01_nhs_classic.html and AdditionalAnalytics.md
2026-02-09 14:53:22 +00:00
Andrew Charlwood c253e05046 feat: Trends landing page with directorate overview chart (Task E.3) 2026-02-07 22:19:52 +00:00
Andrew Charlwood d052d2b16d refactor: remove Trends tab from Patient Pathways (Task E.1)
Remove trends tab, metric toggle, render helper, and callback I/O
from Patient Pathways view. Trends will be re-added as a standalone
3rd view in E.2-E.4. Preserved get_trend_data() and create_trend_figure()
for reuse.
2026-02-07 22:07:01 +00:00
Andrew Charlwood d0404aa18a feat: temporal trends CLI script + Dash tab (Task D.1)
D.1a: cli/compute_trends.py — standalone CLI that imports existing pipeline
functions to replay pathway computation for ~10 historical 6-month endpoints.
Creates pathway_trends table via CREATE TABLE IF NOT EXISTS.

D.1b: Trends tab (10th PP tab) with metric toggle (patients/cost/cost_pp_pa).
Query gracefully returns empty when table doesn't exist, figure shows
instruction message to run compute_trends.
2026-02-07 18:24:34 +00:00
Andrew Charlwood c7e9398d65 feat: average administered doses chart tab (Task D.2) 2026-02-07 03:47:53 +00:00
Andrew Charlwood 0a14f1fce3 feat: drug timeline Gantt chart tab (Task D.3) 2026-02-07 03:40:29 +00:00
Andrew Charlwood 1405476818 feat: drug switching network graph tab (Task C.4) 2026-02-07 03:32:14 +00:00
Andrew Charlwood d8df41619d feat: duration vs cost scatter plot tab (Task C.3) 2026-02-07 03:25:39 +00:00
Andrew Charlwood 55c9af2de7 feat: pathway depth distribution chart tab (Task C.2)
Horizontal bar chart showing patients who stopped at each treatment
line depth (exclusive counts, not cumulative like the funnel).
2026-02-07 03:18:28 +00:00
Andrew Charlwood a6cf6efa18 feat: retention funnel chart tab with treatment line depth (Task C.1) 2026-02-07 03:12:30 +00:00
Andrew Charlwood 10739ca84d feat: Trust Comparison landing page + directorate selector (Task 10.7)
- Add get_directorate_summary() query for per-directorate patient/drug counts
- Create trust_comparison.py with landing grid and 6-chart dashboard layout
- Wire directorate card clicks and back button through app-state callbacks
- Add TC landing and dashboard CSS per Phase 10 design spec
- Placeholder charts for 6 dashboard graphs (filled in Task 10.8)
- Chart type toggle clears selected directorate when switching modes
2026-02-06 22:15:10 +00:00
Andrew Charlwood 9d4e32910d feat: add 5 trust-comparison query functions for Phase 10.6
New per-trust-within-directorate queries:
- get_trust_market_share: drugs by trust within a directorate
- get_trust_cost_waterfall: cost per patient by trust
- get_trust_dosing: drug dosing intervals by trust
- get_trust_heatmap: trust x drug matrix for one directorate
- get_trust_durations: drug durations by trust

Also verified existing get_pathway_costs(directory=X) works for
directorate-scoped Cost Effectiveness (no new function needed).

Thin wrappers added in dash_app/data/queries.py.
2026-02-06 22:04:43 +00:00
Andrew Charlwood d98cd4fd69 feat: add 7 analytics chart query functions (Task 9.2)
New query functions in src/data_processing/pathway_queries.py:
- get_drug_market_share: Level 3 drug nodes grouped by directory
- get_pathway_costs: Level 4+ pathway nodes with cost_pp_pa
- get_cost_waterfall: Directorate cost per patient from level 3 aggregation
- get_drug_transitions: Sankey source/target drug transitions with ordinal line labels
- get_dosing_intervals: Parsed average_spacing by trust/directory
- get_drug_directory_matrix: Directory x drug pivot with patient/cost metrics
- get_treatment_durations: Weighted avg_days by drug within directorates

Thin wrappers added in dash_app/data/queries.py for all 7 functions.
2026-02-06 19:21:10 +00:00
Andrew Charlwood f0505ee43e feat: add trust selection to drawer with filter wiring (Task 5.1) 2026-02-06 14:09:36 +00:00
Andrew Charlwood b71748fa7d feat: add shared pathway query functions for Dash data access (Task 1.1)
Extract load_data() and load_pathway_data() logic from Reflex AppState
into standalone functions in src/data_processing/pathway_queries.py.
Create thin dash_app/data/queries.py wrapper with DB_PATH resolution.
2026-02-06 13:02:34 +00:00