Commit Graph

248 Commits

Author SHA1 Message Date
Andrew Charlwood 9171563651 docs: update progress.txt with iteration 47 (Task 11.4 complete — ALL TASKS DONE) 2026-02-07 00:39:35 +00:00
Andrew Charlwood caf7ada287 style: improve filter modal aesthetics for large screens (Task 11.4)
- Drug modal: size 70%, sm chips in 4-col SimpleGrid layout
- Trust modal: size lg, md chips in vertical Stack layout
- Directorate modal: size 70%, larger badges and text
- CSS: modal title full-width, chip nowrap, scroll padding
2026-02-07 00:37:47 +00:00
Andrew Charlwood 59f6cbafaa docs: update progress.txt with iteration 46 (Task 11.3 complete — chart fill height) 2026-02-07 00:32:30 +00:00
Andrew Charlwood 10d47d616c style: make Patient Pathways chart fill available viewport height (Task 11.3)
- Changed .main from min-height to height with overflow-y auto
- Added flex chain: #view-container → #patient-pathways-view → .chart-card
  → dcc.Loading wrapper → #chart-container → #pathway-chart
- All flex parents get min-height: 0 for proper flex shrinking
- dcc.Graph set to responsive=True with flex: 1 and minHeight: 0
- Trust Comparison view scrolls naturally via .main overflow-y auto
2026-02-07 00:31:47 +00:00
Andrew Charlwood ab62acf41d docs: update progress.txt with iteration 45 (Task 11.2 complete — TC chart sizing) 2026-02-07 00:25:58 +00:00
Andrew Charlwood a4059b5829 style: increase Trust Comparison chart height from 320px to 500px (Task 11.2)
Charts were overspilling 320px containers. Increased to 500px for
readability. Added overflow: hidden + min-height: 0 to .tc-chart-cell
to prevent any content leaking. Dashboard scrolls vertically, which
is acceptable for 6 readable charts.
2026-02-07 00:25:08 +00:00
Andrew Charlwood 4ec3e6b973 docs: update progress.txt with iteration 44 (Task 11.1 complete — Clear All button repositioned) 2026-02-07 00:20:39 +00:00
Andrew Charlwood 99ccddbb98 style: move Clear All button to left side next to filter buttons (Task 11.1)
Moved Clear All from right-aligned separate sibling into the
pathway-filters__buttons group. Removed justify-content: space-between
from .pathway-filters. Added thin vertical separator between
Directorates and Clear All for visual distinction.
2026-02-07 00:20:11 +00:00
Andrew Charlwood 2b997fbb4f docs: update progress.txt with iteration 43 (Task 10.11 complete — final integration) 2026-02-06 22:55:41 +00:00
Andrew Charlwood 5f890f2d93 docs: final integration verification + CLAUDE.md update for two-view architecture (Task 10.11) 2026-02-06 22:55:22 +00:00
Andrew Charlwood 552b949ed9 docs: update progress.txt with iteration 42 (Task 10.10 complete — CSS cleanup + polish) 2026-02-06 22:41:02 +00:00
Andrew Charlwood c5b6191a5b style: clean up dead CSS, add CSS variables, improve responsive rules (Task 10.10)
- Remove dead .kpi-row/.kpi-card CSS (KPI row replaced by header fraction KPIs)
- Remove dead .top-header__breadcrumb CSS (breadcrumb removed in 10.3)
- Remove dead .filter-select CSS (replaced by dcc.Dropdown)
- Remove dead .sidebar__item--disabled CSS (disabled items removed in restructure)
- Delete unused dash_app/components/kpi_row.py
- Add --sub-header-h and --header-total-h CSS variables
- Update .main and .sub-header to use CSS variables instead of hardcoded values
- Add responsive rules: header KPIs collapse at 1200px, hide at 768px
- Add responsive pathway-filters wrap at 768px
- Remove dead .kpi-row responsive rules
2026-02-06 22:39:48 +00:00
Andrew Charlwood ba9909f151 docs: update progress.txt with iteration 41 (Task 10.9 complete — pathway filter relocation) 2026-02-06 22:33:23 +00:00
Andrew Charlwood f1eecf88bf feat: scope pathway filters to Patient Pathways view with design-spec CSS (Task 10.9) 2026-02-06 22:32:02 +00:00
Andrew Charlwood 9c783a7e4e docs: update progress.txt with iteration 40 (Task 10.8 complete — TC 6-chart dashboard) 2026-02-06 22:24:47 +00:00
Andrew Charlwood ea6b9065bf feat: Trust Comparison 6-chart dashboard with real data (Task 10.8)
- Add 3 new visualization functions to plotly_generator.py:
  create_trust_market_share_figure, create_trust_heatmap_figure,
  create_trust_duration_figure
- Replace 6 placeholder callbacks in trust_comparison.py with real
  implementations using trust-comparison queries + figure builders
- Cost Waterfall reuses existing figure function via key mapping
- Dosing reuses existing create_dosing_figure with group_by="trust"
- Cost Effectiveness reuses existing function scoped to directorate
- All 6 charts respond to date filter and chart type toggle
- Validated with both directory (RHEUMATOLOGY) and indication (asthma)
2026-02-06 22:23:47 +00:00
Andrew Charlwood b52fc295de docs: update progress.txt with iteration 39 (Task 10.7 complete — TC landing page) 2026-02-06 22:16:09 +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 04edf2cea5 docs: update progress.txt with iteration 38 (Task 10.6 complete — trust-comparison queries) 2026-02-06 22:05:31 +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 e123599312 docs: update progress.txt with iteration 37 (Task 10.5 complete — Patient Pathways 2-tab view) 2026-02-06 21:58:18 +00:00
Andrew Charlwood 979b79794c feat: reduce Patient Pathways to Icicle + Sankey tabs only (Task 10.5)
Removed 6 chart tabs (Market Share, Cost Effectiveness, Cost Waterfall,
Dosing, Heatmap, Duration) from the Patient Pathways tab bar. These will
reappear in the Trust Comparison dashboard (Task 10.8).

All _render_* helper functions preserved in chart.py for reuse.
2026-02-06 21:57:06 +00:00
Andrew Charlwood 0f1ae5dd2a docs: update progress.txt with iteration 36 (Task 10.4 complete — global filter sub-header) 2026-02-06 21:52:55 +00:00
Andrew Charlwood 7e0c851063 feat: add global filter sub-header bar (Task 10.4)
Extract chart type toggle and date filter dropdowns from filter_bar.py
into a new sub-header component. Sub-header is fixed-position below the
main header, visible across both views. Filter bar now contains only
drug/trust/directorate buttons for Patient Pathways view.
2026-02-06 21:51:56 +00:00
Andrew Charlwood 95f5125889 docs: update progress.txt with iteration 35 (Task 10.3 complete — header fraction KPIs) 2026-02-06 21:46:09 +00:00
Andrew Charlwood 11b5cc5b81 feat: header fraction KPIs replacing KPI row (Task 10.3)
Remove KPI card row, add 3 inline fraction KPIs to header bar:
filtered/total patients, drugs, cost. Breadcrumb removed.
KPI callback refactored for 6 output IDs (3 filtered + 3 total).
total_cost added to load_initial_data() reference data.
2026-02-06 21:45:13 +00:00
Andrew Charlwood 6c9f68d880 docs: update progress.txt with iteration 34 (Task 10.2 complete — two-view architecture) 2026-02-06 21:38:53 +00:00
Andrew Charlwood 7d51efc25e feat: add two-view architecture with sidebar navigation (Task 10.2)
- Add active_view and selected_comparison_directorate to app-state
- Sidebar: rename to Patient Pathways + add Trust Comparison nav item
- View container pattern: two view divs toggled by active_view
- Navigation callback: sidebar clicks switch views + update active state
- Trust Comparison placeholder landing page with tc-landing structure
2026-02-06 21:38:12 +00:00
Andrew Charlwood 94b1ac640a docs: design specification for Phase 10 two-view architecture (Task 10.1) 2026-02-06 21:33:43 +00:00
Andrew Charlwood 547bc7c867 docs: complete Phase 9 final integration (Task 9.10)
All 8 chart tabs verified — queries, figures, and filter dispatch
tested in both directory and indication modes. CLAUDE.md updated
with new chart types, query functions, and parsing utilities.
Phase 9 completion criteria all satisfied.
2026-02-06 20:22:21 +00:00
Andrew Charlwood e4d6c8886b docs: update progress.txt with iteration 31 (Task 9.9 complete — Duration chart) 2026-02-06 20:13:42 +00:00
Andrew Charlwood 965fc8c3d2 feat: add Treatment Duration bar chart (Task 9.9) 2026-02-06 20:12:01 +00:00
Andrew Charlwood 1b134c46a2 docs: update progress.txt with iteration 30 (Task 9.8 complete — Heatmap chart) 2026-02-06 20:05:05 +00:00
Andrew Charlwood 0af76e68e0 feat: add Directorate × Drug Heatmap chart (Task 9.8) 2026-02-06 20:04:19 +00:00
Andrew Charlwood c1e11a6dd7 docs: update progress.txt with iteration 29 (Task 9.7 complete — Dosing Interval chart) 2026-02-06 19:58:47 +00:00
Andrew Charlwood 02fe4b4e28 feat: add Dosing Interval Comparison chart (Task 9.7) 2026-02-06 19:58:28 +00:00
Andrew Charlwood b1136ad7bf docs: update progress.txt with iteration 28 (Task 9.6 complete — Sankey diagram) 2026-02-06 19:51:44 +00:00
Andrew Charlwood 4ffcdf4268 feat: add Drug Switching Sankey diagram (Task 9.6) 2026-02-06 19:50:43 +00:00
Andrew Charlwood ba39f94c32 docs: update progress.txt with iteration 27 (Task 9.5 complete — cost waterfall chart) 2026-02-06 19:45:24 +00:00
Andrew Charlwood 73a8d1a49f feat: add Cost Waterfall bar chart (Task 9.5) 2026-02-06 19:44:37 +00:00
Andrew Charlwood 47e4aa4df2 docs: update progress.txt with iteration 26 (Task 9.4 complete — cost effectiveness chart) 2026-02-06 19:39:48 +00:00
Andrew Charlwood 4ef7239eed feat: add Pathway Cost Effectiveness lollipop chart (Task 9.4)
- Create create_cost_effectiveness_figure() in plotly_generator.py
  Horizontal lollipop chart with dot size by patient count,
  colour gradient green→amber→red by cost, retention annotations
- Fix calculate_retention_rate() to accept both 'value' and 'patients' keys
- Add _render_cost_effectiveness() dispatch in chart.py callbacks
- Wire into tab switching for active_tab='cost-effectiveness'
2026-02-06 19:38:54 +00:00
Andrew Charlwood c34381a263 docs: update progress.txt with iteration 25 (Task 9.3 complete — market share chart) 2026-02-06 19:29:44 +00:00
Andrew Charlwood f8960a3064 feat: add First-Line Market Share chart (Task 9.3)
- create_market_share_figure() in src/visualization/plotly_generator.py
- Horizontal stacked bar chart: directorates × drugs with patient %
- Wire into tab dispatch via _render_market_share() helper in chart.py
- Responds to date, chart type, trust, and directorate filters
2026-02-06 19:28:20 +00:00
Andrew Charlwood 4375d22022 docs: update progress.txt with iteration 24 (Task 9.2 complete — query functions) 2026-02-06 19:22:23 +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 b34a1138fc docs: update progress.txt with iteration 23 (Task 9.1 complete — parsing + tabs) 2026-02-06 19:14:19 +00:00
Andrew Charlwood fe2d048a21 feat: add parsing utilities and 8-tab chart infrastructure (Task 9.1)
- Create src/data_processing/parsing.py with parse_average_spacing(),
  parse_pathway_drugs(), and calculate_retention_rate()
- Add 8-tab bar to chart_card.py (Icicle, Market Share, Cost Effectiveness,
  Cost Waterfall, Sankey, Dosing, Heatmap, Duration)
- Add active-tab dcc.Store and tab switching callback in chart.py
- Remove Chart Views section from sidebar (now in tab bar)
- Lazy rendering: only active tab's chart is computed
2026-02-06 19:13:19 +00:00
Andrew Charlwood 8a45ff1ca7 docs: update progress.txt with iteration 22 (Section 8 complete — pruning + KPIs) 2026-02-06 16:27:09 +00:00
Andrew Charlwood de08d4b520 fix: prune empty ancestor nodes and update KPIs for filtered views (Section 8)
- Add _prune_empty_ancestors() to remove directorate/trust nodes with no
  matching children when drug or directorate filters are active (e.g.,
  filtering by Immunoglobulin no longer shows empty Ophthalmology box)
- Sum level-3 drug nodes for KPI values when entity filters are active
  instead of using the root node's pre-computed unfiltered totals
2026-02-06 16:25:56 +00:00