Skip to content

Care Module UI architecture — Cancer at Home + Breathing & Oxygen

Version: 1.16
Last Updated: 2026-07-31 22:47:33
Status: Phase A + Cancer Board V2 — implementation status: 30 · 04 §Phase 1b. Support flow UX (carer → clinician): 31-CANCER-AT-HOME-SUPPORT-FLOW-UX.md · interactive mockup
Profiles in scope: cancer_at_home, breathing_difficulties (pattern template for all paid Care Profiles)
Related: 00-FAMILY-CARE-LENS.md · LEARNING-CANCER-AT-HOME.md · FP-cancer-at-home.md · FP-breathing-difficulties.md


Families under stress need an interactive care board, not another charting app. Practitioners still need dense, time-stamped, coded data — but that is a second surface (visit prep, analytics, export), not the default home experience.

LayerWhoExperienceData
Family faceCarers at homeTaps, tiles, traffic lights, checklists, one-screen wizardsEvery tap writes structured care_events + optional observation_records
Practitioner faceOncology, respiratory, GPTrends, zones, PRO scores, episode windowsSame events → aggregates, thresholds, visit prep

Game-changer hypothesis: One shared Care Module Shell + pluggable capture widgets + shared zone engine lets each purchased pack feel bespoke while engineering builds once.


2. Research synthesis (what works for families + clinicians)

Section titled “2. Research synthesis (what works for families + clinicians)”
SourceFindingLynCareOS application
Cancer patients — GUI preference (PMC9873161)Text + icon + colour best understood; avoid realistic illness imageryHub cards: icon + plain label + green/amber/red strip
Color Me Healthy (pediatric oncology PRO)Emoji/check-in, home animations, history that interprets entriesDefault emoji/face for “how are they”; trend sentence on hub
JMIR cytostatic side-effects appRadio/tap grades preferred over dropdowns; review screen before submit; warning cards for severeBundle ends with “Here’s what we recorded”; fever/red zone = full-screen card
INSAIM symptom UXStep flows, progress, skip, ≤10 options per screen, completion stateCaptureSession wizard, not long observation grid
Topflight healthcare UXAvoid drag sliders on mobile; large targets; 3-tap ruleReuse segmented tap (PainScaleBar pattern), not <input range> for primary capture
Google Open Health StackPaginated questionnaires, anchored next/back, progress indicatorShared wizard chrome for bundles
myCOPD / NHS virtual wardTile home, daily symptom gate, clinician dashboard of same dataCare board tiles; optional “submit to team” packages last 48h
Contigo breast cancer app5-face severity + optional voice noteemoji_face_5 widget; notes optional behind chevron

Principle: Family UI optimizes for decisions (“okay / watch / call”). Clinical UI optimizes for trends (7-day breath at rest, CAT delta, breakthrough count).


AssetPathReuse for Care Modules
Calm Care design systemfrontend/src/index.css (cc-card, emerald CTAs)Board + wizard chrome
Observation pill_tapObservationCard.tsxPer-step taps in bundles
Pain segmented 0–10PainScaleBar.tsxsegmented_scale widget (tap tiles, not drag)
Dashboard stripsScheduledDosesStrip, DayDateStripProfile dashboard chips
ChartsECharts in Dashboard.tsx, Analytics.tsxPractitioner trends on board “Trend” card
API capture_widgetapi.ts — pill_tap, slider, number_input, text_inputExtend with visual, checklist, stepper
API visual_widgetDeclared, not implementedPrimary extension point for module UI
Patient scopePatientContext — no /patients/:id carer routesv1: /care/:moduleSlug + active patient; v2: deep links

Intentional deprecations for module flows: Do not show raw /observations grid as the pack home. Link “See all readings” for power users.


Backend pipeline

Capture widgets

Shared Care Module Shell

Server config per slug

pack_ui_manifest.json

observation_types

zone_rules

CareBoard page

CaptureSession wizard

ZoneBanner

VisitPrep

Worry pathways

traffic_light_3

emoji_face_5

segmented_scale

icon_checklist

stepper_gauge

toggle_tiles

care_module_events

observation_records

aggregates

ItemPathStatus
Events tablebackend/migrations/V011__care_module_events.sqlDone
Manifest JSONbackend/care_modules/manifests/*.jsonDone (cancer + breathing bundles)
Board + events APIbackend/care_modules/routers/board.pyDone
Zone engine v1backend/care_modules/services/zone_engine.pyDone (worse-count heuristic)
CaptureSessionfrontend/src/components/care-capture/CaptureSession.tsxDone — CareCaptureOverlay.tsx (portal, z-[1100], opaque bg-canvas; phone full-screen, tablet ~85vw card, desktop ~50% main column + backdrop)
Traffic light widgetfrontend/src/components/care-capture/TrafficLight3.tsxDone
Board pagesfrontend/src/care-modules/{cancer,breathing}/CareBoardPage.tsxDone (wizard wired)
Dashboard chipfrontend/src/components/dashboard/CareBoardDashboardChip.tsxDone
Visit prep / worry flows—Phase B
Dual-write to observation_records—Phase B

4.1 pack_ui_manifest (per slug — config-driven adaptation)

Section titled “4.1 pack_ui_manifest (per slug — config-driven adaptation)”

One manifest drives UI without forking pages per disease. Stored JSON (DB or backend/care_modules/manifests/{slug}.json).

{
"slug": "breathing_difficulties",
"hub_route": "breathing-care",
"title": "Breathing & Oxygen",
"primary_cta": {
"type": "capture_session",
"session_id": "daily_breathing_bundle",
"label": "How is their breathing?",
"duration_hint": "About 2 minutes"
},
"zone_rule_set": "respiratory_v1",
"tiles": [
{ "id": "o2_cupboard", "component": "O2CupboardCard" },
{ "id": "week_trend", "component": "TrendSparkCard", "metrics": ["breath_at_rest", "breath_o2_hours"] }
],
"dashboard_strip": "breathing_today",
"worry_flows": ["cant_catch_breath", "equipment_fault"]
}

cancer_at_home manifest swaps primary_cta by computed day type (infusion / tablet / rest) — see §6.

Route (v1): /care/cancer-at-home · /care/breathing
Gate: activePatient.care_profile_slug matches; else upsell/apply prompt.

┌──────────────────────────────────────────────────┐
│ [Photo] Name Cancer at Home │
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
│ RIGHT NOW ● Watch "Breathless after lunch" │
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │
│ ┌────────────────────────────────────────────┐ │
│ │ ▶ Comfort check-in one screen │ │ ← primary_cta (stacked)
│ └────────────────────────────────────────────┘ │
│ ┌─────────────┐ ┌─────────────┐ ┌────────────┐ │
│ │ Today │ │ This week │ │ Helping │ │
│ │ Chair day │ │ Thu infusion│ │ Dad drives │ │
│ │ 3/7 packed │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └────────────┘ │
│ ┌────────────────────────────────────────────┐ │
│ │ If you're worried → │ │
│ └────────────────────────────────────────────┘ │
│ Trend ▾ (sparklines — collapsed by default) │
└──────────────────────────────────────────────────┘

Adaptation: Only tile set + copy + primary_cta change per manifest. Layout identical for cancer and breathing.

4.3 Capture Session (shared wizard — “interactive” value)

Section titled “4.3 Capture Session (shared wizard — “interactive” value)”

Replaces “open five observation cards” for bundle FPs (CANC-E02, BRTH-E01).

Step UXWidgetFamily seesPractitioner gets
1traffic_light_3 or emoji_face_5“Overall today?”Mapped 1–5 / 1–10
2–NManifest-defined stepsOne question, large pillsobservation_records per slug
ReviewSummary cards“You said: breath worse, cough more”Audit trail
SubmitHaptic + check animation“Done — you’re on green”care_module_events.session_completed

Properties: Progress dots top; back/skip; autosave draft in sessionStorage; max 6 steps on family path. layout: stacked — all steps on one phone screen (numbered questions + segmented_bar each); used for Comfort check-in (How are they? · Ready for clinic? · Breakthrough pain?).

Evaluates rules on hub load and after each capture session.

ZoneFamily copyExample rules (breathing)Example rules (cancer)
Green“Okay for now”Scores stable 48hBundle green, no fever
Amber“Keep a closer eye”Breath worse vs baselineMissed checklist item, rising nausea
Red“Consider calling the team”SpO₂ below target + breath at rest highFever pathway triggered

Implementation: evaluateZone(patientId, ruleSetId) → { zone, reasons[], deepLinks[] }.

4.5 Worry pathways (full-screen, not forms)

Section titled “4.5 Worry pathways (full-screen, not forms)”

Pattern: Decision cards (large buttons), not text fields — CANC-F01, BRTH-F02, BRTH-F05.

Fever during treatment Can't catch breath
───────────────────── ─────────────────────
Was chemo today? [Yes][No] Try these first:
Temp high? [Yes][No] · Sit upright
· Fan on face
→ Call oncology now · PRN if prescribed
or monitor with plan Still bad? → Emergency card

Each choice logs care_module_events.pathway_step for analytics (funnel analysis for product + quality).

SurfaceRouteContent
Visit prep/care/cancer-at-home/visit-prepWeek at home, in brief — short bullet lines for clinic (story.lines: check-ins · mood, breakthroughs, fever flags); treatment context; questions queue
Show clinicianToggle on visit prepMVP: larger-type read-only view on same page (CANC-H02 lite). Spec: swipeable slides (Contigo / virtual ward pattern) — not shipped
Board trend expandCare boardECharts sparklines: breath at rest, O₂ hours, cancer pain — same data as /analytics

Families never need to open /analytics. Practitioners get full series derived from tap events.

4.7 Care Flow Loop (Cancer pilot — Decision A)

Section titled “4.7 Care Flow Loop (Cancer pilot — Decision A)”

Pattern: Orient → one prompt → Because → Next fork → action/share. Full spec: 31-CANCER-AT-HOME-SUPPORT-FLOW-UX.md · mockup.

PieceComponentNotes
Step rail (Check-in · Next · Done)CareFlowRailDriven by buildCancerCareFlow()
Single active promptInlineComfortCheckInUnsaved spider spoke → headline
Because one-linerBecauseLinebuildComfortBecauseLine() from saved labels
Do now / Later / SkipNextStepForkFork → session, route, or expand “More for today”

Cancer-first: lives under care-modules/cancer/ until sign-off; then extract generic rail/fork to shared for Breathing daily bundle.


5. Capture widget library (build once, configure per pack)

Section titled “5. Capture widget library (build once, configure per pack)”

Extend observation_types.capture_widget and add visual_widget discriminator.

Widget IDInteractionFamily UIClinical storageUse in
pill_tapLabelled chips✅ Existingchoice / scale indexSelf-care, cough
segmented_scale0–10 or 0–5 tap tiles (PainScaleBar)✅ AdaptnumberPain, breath (optional depth)
emoji_face_55 faces😟😐😊…Maps to 1–5Bundle step 1
traffic_light_3Better / Same / Worse🟢🟡🔴Maps to scale deltaBreathing “right now”, cancer bundle
segmented_barTap segments on a narrow bar (3–5)Question + horizontal barMaps to scale / choiceComfort check-in (stacked one-screen), sub-questions
icon_toggle_grid2×2 or 3×2 iconsShower, walk, sleep…boolean groupInfusion checklist
stepper_gauge+/− with pictogramCylinders left: ●●●○numberO₂ inventory
fluid_arcArc fill tap levels“About 4 glasses”number ml estimateCancer fluids
yes_no_stackLarge Yes/No cardsFever? Chemo today?pathway stateWorry flows
checklist_rowSwipe-to-complete rowsChair day packingappointment_checklist_itemsCANC-B03
segmented_timeMorning / afternoon / eveningWhen symptom worstmetadataDiary

Rule: Default bundle = no keyboard. number_input only on “Add detail” expander.

Implementation location: frontend/src/components/care-capture/ — CareCaptureOverlay.tsx (viewport portal; responsive sizing per breakpoint) + CaptureSession.tsx (wizard steps). All cancer/breathing capture bundles share this stack; hub tiles that navigate (visit prep, log dose) are full routes, not overlays. Desktop panel width tracks the max-w-5xl main column (~50% inner width, lg:pl-60 for sidebar offset).


6. Cancer + Breathing — shared vs specific

Section titled “6. Cancer + Breathing — shared vs specific”

6.1 Shared infrastructure (build together)

Section titled “6.1 Shared infrastructure (build together)”
ComponentCancer FPBreathing FP
CareBoard shellCANC-A01BRTH-A01
Dashboard stripCANC-A04BRTH-A02
CaptureSessionCANC-E02 (symptom bundle)BRTH-E01 (daily bundle)
ZoneBannerCANC-F04 + feverBRTH-A06, F01–F04
VisitPrep + clinician modeCANC-H01–H03BRTH-H01–H03
EmergencyCardCANC-F02BRTH-F05
HandoverSentenceCANC-G02BRTH-G02
Appointment checklist UICANC-B03 (infusion)BRTH-B02 (virtual ward series)

6.2 Cancer-specific modules (manifest plugins)

Section titled “6.2 Cancer-specific modules (manifest plugins)”
Tile / flowFamily display nameWidgetsFP
Actions for todayChips: Infusion day at clinic / Tablets / Rest / Clinic — top CancerTodayContextPanelCancerDayPicker → today_day_typeCANC-A01
Treatment modesIcon toggles; unlocked tiles highlight + scroll pulsehub.catalog.treatment_modes[] (icon, unlocks_tile_ids); drives _visible_tiles()CANC-A02
Infusion visit packingProgress bar + checklist on tiletiles[].visual.progressCANC-B03
Breakthrough pain24h / 7d stats + last dose + 7d sparkline; Log dose → /log?reason_type_id=…&source=cancer; Week storyhub.breakthrough_log_route, metrics.breakthrough_*CANC-C08
Calendar → Today is…Oncology appointment type on calendar; hub suggests/applies day typeappointment_type (V016), today.effective_day_typeCANC-B01 lite
Site tipOne-line home tip when primary site setPRIMARY_SITE_TIPS → hub.today.site_tipCANC-T02 lite
Comfort overrideApricot banner when gentle or palliative+chemohub.comfort_overrideCANC-A02 / CANC-P01
Kitchen table chemo“Felt sick after dose?” → pathwayyes_no_stackCANC-C04
Daily statusInline 8-spoke radar on hub: tap ring dots 1–4 (each tap saves); auto-complete when all eight saved; Because + Next fork; past days show merged full spiderInlineComfortCheckIn + CancerComfortRadarChart; postStep per tap → auto completeSession; comfort-checkin GET merges instancesCANC-P01
Today’s care planNumbered action steps driven by day type + treatment modes (not daily status / breakthrough — separate sections)buildTodayPlan + CancerTodayPlanCANC-A01
Line care due“Dressing due today” tickchecklist_rowCANC-D06–D09
Ready for oncologyAbbreviated summary screen (full route, not capture overlay)Bullet story.lines + questions; backend story objectCANC-H01
Where cancer isSlim Listbox pill right-aligned on title row (MapPin + label + chevron; ~30px phone)CancerPrimarySitePicker (Headless UI; anchor bottom end; not native <select>) → cancer_primary_siteCANC-T01, CANC-A05 — MVP shipped; pictogram body zones optional v2 (body_site_pick)

Primary CTA rotation (manifest logic):

Computed dayPrimary CTA labelSession
Infusion day at clinic“Infusion visit — quick check” / packing tileinfusion_checklist, chair_day_ack
Oral chemo day“Tablet safety check”oral_oncolytic_quick
DefaultHow are they today? (inline spider)cancer_symptom_bundle on page
Gentle / palliativeSame inline spidercomfort_round
Appointment today“Ready for clinic”visit_prep
Tile / flowFamily display nameWidgetsFP
Breathing right now🟢🟡🔴traffic_light_3BRTH-E01 step 0
O₂ cupboardCylinder dots + concentrator on/offstepper_gauge, toggleBRTH-D01–D04
Before you leaveOne-line morning summarygenerated textBRTH-A02 strip
Flare stepsScrollable action cardsstatic + PRN deep linkBRTH-F02
Sputum changed?Colour chips (not medical chart)pill_tap colouredBRTH-E05
Send to respiratory teamOne tap packageevent bundle exportBRTH-G04

Overlap with cancer: Lung primary site (CANC-T06) can deep-link to Breathing board if both packs owned — shared CareBoard with combined manifest (future).


7. Data model — rich capture without family-facing forms

Section titled “7. Data model — rich capture without family-facing forms”

Every interactive UI action writes a care_module_events row (new table):

ColumnExample
patient_iduuid
care_profile_slugbreathing_difficulties
event_typecapture_session_step, zone_change, pathway_choice, checklist_tick
session_iddaily_breathing_bundle
step_keybreath_at_rest
family_label“Harder to breathe sitting”
clinical_value{"scale": 4, "scale_max": 5}
observation_record_idnullable FK when maps to obs
metadata{"widget": "traffic_light_3", "choice": "worse"}

Benefit: Analytics queries events; practitioners see normalized scales; families never see JSON.

7.2 Mapping family choices → clinical analytics

Section titled “7.2 Mapping family choices → clinical analytics”
Family choiceclinical_valueAnalytics series
Traffic light worsebreath_at_rest: 47-day line + zone counts
Emoji face 3/5cancer_energy: 3Trend + correlation with PRNs
Checklist “Labs done”appointment_task: labsInfusion adherence %
Pathway “Call now”pathway: fever_call_oncologySafety funnel

Existing observation_records remain source of truth for charts already in ObservationDashboard — events dual-write where applicable.

7.3 Practitioner analytics (same app, different entry)

Section titled “7.3 Practitioner analytics (same app, different entry)”
ViewMetrics (cancer)Metrics (breathing)
Board “Trend” expandBreakthrough 24h, pain max, bundle completion %breath at rest / activity, O₂ hours, PRN count
Visit prepNew/worse symptoms, missed oral dosesExacerbation episodes, mMRC last (if captured in depth)
/analytics extensionFilter care_profile_slug=cancer_at_homeZone days green/amber/red, virtual ward submit count
Export (phase 2)7d PDF for clinic48h respiratory summary

Depth capture: “More for clinic” expands bundle with segmented_scale (mMRC 0–4 pills), CAT questionnaire as paginated session (8 steps) — BRTH-E02/E03, not on daily path.


8. Visual design techniques (beautiful + intuitive)

Section titled “8. Visual design techniques (beautiful + intuitive)”
TechniqueApplication
Calm Care gradientsZone green→amber→red as subtle header wash, not alarm red full screen
MotionChecklist tick confetti micro-animation; session complete collapse to green badge
IconographyLucide: Wind (breath), Droplet (fluid), Calendar (infusion), Phone (worry) — consistent per manifest
Empty states“You’re all caught up for today” with illustration, not blank grid
Hapticsnavigator.vibrate(10) on session complete (mobile PWA)
Dark modeExisting isDark on ObservationCard — propagate to CareBoard
Accessibility44px min touch; voice-over labels from plain_name; contrast on traffic lights

Avoid: Long slider drags, dense tables on mobile, acronym labels on family path, realistic clinical photos (PMC9873161).


9. Implementation plan (both packs, one programme)

Section titled “9. Implementation plan (both packs, one programme)”
#DeliverableStatus
A1care_module_events migration + APIShipped
A2CareBoard + pack_ui_manifest loaderShipped
A3CaptureSession + widgets: traffic_light_3, emoji_face_5, pill_tapShipped (checklist_row → Phase B)
A4ZoneBanner + evaluateZone serviceShipped (v1 rules)
A5HandoverSentence generator from eventsPhase B
A6Dashboard strip component parameterizedPartial (dashboard chip)

API (authenticated, preview user + flags):

MethodPath
GET/api/patients/{id}/care-modules/board?slug=
POST/api/patients/{id}/care-modules/events?slug=
POST/api/patients/{id}/care-modules/sessions/complete?slug=

Phase B — Breathing MVP (validates platform)

Section titled “Phase B — Breathing MVP (validates platform)”

BRTH-A01, A02, A06, E01, D01, D02, D04, F01, F05, G02, H01 — matches FP-breathing-difficulties.md MVP.

CANC-A01, A04, B03, E02, C08, F01, F02, H01 — matches LEARNING-CANCER-AT-HOME.md §5.

segmented_scale, stepper_gauge, CAT/mMRC sessions, visit prep clinician mode, combined lung+cancer manifest.


Family (product)Practitioner (data)
Median bundle time < 120s≥1 event per patient per day on active pack
≥70% sessions complete without skipVisit prep opened before ≥30% of appointments
Hub DAU / weekly carersZone distribution correlates with documented escalations
Qualitative: “feels like it’s for us”Exported 7d summary used in clinic (survey)

#QuestionRecommendation
1Patient routes vs context-only?Ship v1 with PatientContext; add ?patientId= deep links v2
2Implement visual_widget in DB seed?Yes — e.g. breath_at_rest → traffic_light_3 in bundle only
3Separate app section vs bottom nav?“Care board” entry on dashboard when pack applied
4Offline bundle?Queue events locally (PWA phase 2)

VersionDateChange
1.02026-06-04Initial architecture — cancer + breathing shared UI platform
1.12026-06-04Phase A build; fixed Mermaid; API + implementation table
1.22026-06-05Visit prep §4.6: home story narrative + clinician text toggle (CANC-H02 lite); not swipe slides
1.32026-06-05Visit prep copy tightened: story.lines abbreviated bullets; minimal VisitPrepPage chrome
1.42026-06-05CANC-A02 treatment modes: on_enable/on_disable feedback, hub.board_effects, gentle mode copy
1.52026-06-05Cancer board resilience: null-safe hub arrays, API error UI; CareModuleRoutes Suspense + labelled ErrorBoundary
1.62026-06-05Family copy: “chair day” → infusion visit packing / infusion day at clinic (Home chips + hub)
1.72026-06-05Visual hub redesign: cancer_board_visual.py, tiles[].visual, LEARNING layout, CancerTileCard / icon mode+day pickers
1.82026-06-05Where cancer is moved to hub header (CancerPrimarySitePicker beside title; Home on name row); zone banner dark-mode tints
1.92026-06-05Site picker: Headless UI Listbox chip (mobile-first sizing); custom panel replaces native select
1.102026-06-05Site picker right-aligned on title row; panel anchor bottom end
1.112026-06-05Mobile-minimal hub: compact zone chip; inline spider check-in; collapsible More for today / Today is / Your treatment
1.122026-06-05Care Flow Loop pilot (§4.7): CareFlowRail, BecauseLine, NextStepFork; link 31 + HTML mockup
1.132026-06-05MVP completion §6.2: calendar day sync, breakthrough log route + sparkline, site tips, comfort override banner
1.142026-06-10Board V2 §6.2: Actions for today context panel; Today’s care plan; Daily status radar; home CareBoardDashboardPanel