Skip to content

Watch Closely → Measurements + Cancer Pain Breakthrough Design

Version: 1.1
Last Updated: 2026-06-15 20:02:59
Status: Partially implemented — urine beaker + Bristol capture UI shipped on /vitals (2026-06-15); fever inline flags and cancer breakthrough remain per phase table below
Parent: 2026-06-09-care-profile-capability-platform-design.md
Proof point: Cancer at Home (cancer_at_home)


Move Watch Closely from passive list rows on the cancer board into real, graphable measurements on the right LynCareOS surfaces — with inviting visual capture controls, not form fields.

Watch item (today)Target surfaceStored as
Urine colour / volumeVital Signs (/vitals)Intake/output record + trend
Stool / bowel changesVital Signs (/vitals)Bristol-type record + trend
Fever / infection signsVital Signs (/vitals)Temperature (existing) + derived fever band + optional symptom flags
Breakthrough painPain & Stats (/pain)patient_pain_entries with breakthrough context — same 0–10 score, cancer-specific presentation
Neuro changes (brain site)Pain & Stats (/pain)Nerve-layer / neuro-region pain entries + optional symptom checklist
Oxygen / breathing equipmentVital Signs + link to Breathing board when entitledSpO₂ (existing) + oxygen therapy session record

The cancer board keeps a compact “Needs attention” strip (status + deep links + “last recorded”) — not the full capture UI.


Layout below existing Pulse / SpO₂ / Temperature cards:

Vital Signs
├── Date strip (existing)
├── Core vitals row (existing)
├── Fever & temperature ← enhanced
├── Urine today ← new
├── Bowel today ← new
└── Oxygen (when active) ← new, profile-gated

Recording: User taps Temperature card (existing flow) — numeric °C/°F entry stays.

Visual fever band (derived, not a separate score):

Band°C (clinical)Family labelVisual
Normal< 37.5NormalCool blue-green thermometer fill
Elevated37.5 – 38.4Watch — possible feverAmber fill + subtle pulse
High fever≥ 38.5High fever — call planRed fill + stronger alert styling

After save, the temp card shows value + band label + thermometer arc (not just a dot). Trend chart plots temperature with coloured band background zones.

Optional (Phase 1b): Two tap chips under the thermometer after a high reading: “Feeling unwell” / “Shivering or sweating” — stored as optional flags on the same vitals row (fever_symptoms jsonb or boolean columns). Cancer fever pathway (call clinic now) remains a care-board session overlay until inline cards ship.

Implementation status (2026-06-15): ✅ Shipped on Vital Signs → Intake/Output.

DeliverableComponent / file
Hybrid PNG shell + SVG liquid fillUrineVolumeBeaker.tsx, urineBeakerConstants.ts
mL slider (vertical desktop / horizontal mobile)UrineVolumeSlider.tsx, UrineCapturePanel.tsx
Seven-step colour strip + SVG dropletUrineColourSelector.tsx
Mobile full-screen capture + sticky SaveVitalsCaptureSheet.tsx, StickyActionBar.tsx
Collapsed today row (visual strip)UrineEntryStrip.tsx in IntakeOutputSection.tsx
Daily stacked-bar trendUrineTrendChart.tsx

See 14-FRONTEND-PRESENTATION-STACK.md and 2026-06-15-vitals-ui-sophistication-roadmap.md.

One combined entry per time (default: once per day; allow multiple with time picker like core vitals).

Beaker slider (volume bands):

LevelLabelApprox. volume
0Very little< 50 mL
1Small~50–100 mL
2Moderate~100–200 mL
3Good~200–500 mL
4Large> 500 mL

SVG glass beaker fills with animated liquid as the slider moves. Stored as urine_volume_band (0–4) — graphable as ordinal trend.

Colour tuner: Horizontal strip of six swatches (family labels):

  • Pale straw
  • Yellow
  • Dark yellow / amber
  • Brown
  • Red or pink
  • Cloudy or unusual

Stored as urine_color enum. Trend: stacked or categorical chart by day (most recent colour per day).

Implementation status (2026-06-15): ✅ Shipped on Vital Signs → Intake/Output.

DeliverableComponent / file
Types 1–7 PNG grid (desktop) / scroll-snap carousel (mobile)BristolStoolSelector.tsx, public/assets/bristol/
Concern flags (blood, black/tarry, …)BristolStoolSelector.tsx — min-h-11 chips
Collapsed today rowBowelEntryVisual.tsx in IntakeOutputSection.tsx
BSFS trend chartBristolStoolTrendChart.tsx

Bristol type grid (Types 1–7) with simplified illustrations + one-line plain-language labels (not clinical jargon on the tile).

TypePlain label
1–2Hard or lumpy — constipation
3–4Normal
5–7Loose or watery — diarrhoea

Optional flags (multi-select chips): Blood seen · Black/tarry · Mucus · Pain with bowel movement.

Stored as stool_bristol (1–7) + stool_flags[]. Trend: Bristol type over time + flag markers on chart.


3. Pain & Stats — breakthrough pain (cancer presentation)

Section titled “3. Pain & Stats — breakthrough pain (cancer presentation)”

Not a separate card. Breakthrough is a mode of recording on the existing body map — same patient_pain_entries.pain_level (0–10), stored in PostgreSQL like any other pain score.

Add to patient_pain_entries:

ColumnTypePurpose
pain_contexttext CHECK IN (general, breakthrough, neuro)Default general; breakthrough for cancer rescue pain

No parallel table. Trends API filters by pain_context. Existing entries backfill as general.

Alternative considered: Fixed body_region = 'breakthrough' — rejected; context column keeps analytics clean and works without map coordinates.

3.2 Cancer-specific UI (only when care_profile_slug = cancer_at_home)

Section titled “3.2 Cancer-specific UI (only when care_profile_slug = cancer_at_home)”

On Record view, below or beside the body map:

  • Breakthrough pain entry strip — distinct amber/violet accent (not default pain rose), Zap iconography, label “Breakthrough pain (cancer)”.
  • Tap opens compact 0–10 scale (reuse PainScaleBar) — optional “where does it hurt?” quick region picker, but score is required; region defaults to last breakthrough region or treatment-related site from primary cancer site.
  • Saved entries render on the map as breakthrough markers (different icon/shape from standard pain dots) and appear on Trend as a separate series: Breakthrough pain vs Body pain.

Dose logging: After scoring ≥7, offer “Log breakthrough dose” → existing /log?reason=breakthrough&source=cancer (CANC-C08). Score and dose stay linked by timestamp, not FK (Phase 1).

Breakthrough context hidden unless cancer profile active (or breakthrough reason type configured). Other profiles can enable later via capability matrix.


4.1 Neuro (brain primary site or neuro watch capability)

Section titled “4.1 Neuro (brain primary site or neuro watch capability)”

Primary home: Pain & Stats

  • Enable Mind layer + nerve anatomy type (already in schema).
  • Cancer adds Neuro watch quick checklist on Record tab when cancer_primary_site = brain:
    • Headache change · Confusion · Weakness · Speech change · Vision change · Seizure activity
  • Each item: None / Mild / Significant (3-level tap) → stored as care_module_events (Phase 1) or patient_observations slug neuro_watch (Phase 2).
  • High-significance taps surface on cancer board attention strip + visit prep.

Why Pain & Stats: Neuro symptoms are body/brain/mind mapped — not vitals.

Primary home: Vital Signs (when cancer lung site OR oxygen treatment mode OR breathing profile)

  • SpO₂ already on Vitals and Pain (Complete tier).
  • New Oxygen today subsection:
    • Equipment type (icon grid: concentrator, cylinder, cannula, mask — from platform equipment catalogue lite)
    • Flow rate (L/min) optional
    • Hours used today (stepper)
  • Stored in new patient_oxygen_sessions or JSON on extended vitals row — graphable hours + flow trend.

Secondary: Deep link to Breathing board when breathing_difficulties profile also active.


5. Cancer board — Watch Closely becomes “Needs attention”

Section titled “5. Cancer board — Watch Closely becomes “Needs attention””

Replace full CancerWatchClosely list with compact status row (max 4 items):

Needs attention today
[Urine — not recorded] [Temp — normal 36.8] [Breakthrough — 2 today] [Neuro — review]

Each chip: colour by status (missing / ok / alert), tap → /vitals or /pain with date + focus param.

buildWatchItems() evolves to buildAttentionItems() — reads measurement summaries from new APIs, not static copy.


6.1 Migration V0xx__intake_output_vitals.sql

Section titled “6.1 Migration V0xx__intake_output_vitals.sql”

Extend patient_vitals or add patient_intake_output:

-- Preferred: dedicated table (clean trends, multiple IO entries per day)
CREATE TABLE patient_intake_output (
id serial PRIMARY KEY,
tenant_id int NOT NULL,
patient_id int NOT NULL,
date text NOT NULL,
recorded_time text NOT NULL DEFAULT '12:00',
urine_volume_band smallint CHECK (urine_volume_band BETWEEN 0 AND 4),
urine_color text CHECK (urine_color IN (...)),
stool_bristol smallint CHECK (stool_bristol BETWEEN 1 AND 7),
stool_flags jsonb DEFAULT '[]',
fever_symptoms jsonb DEFAULT '[]',
recorded_by int NOT NULL,
created_at timestamptz DEFAULT now(),
...
);

Temperature stays on patient_vitals.temp_celsius. Fever band computed in service layer.

MethodPathPurpose
GET/api/patients/{id}/intake-output?date=Day entries
POST/api/patients/{id}/intake-output/{date}Create urine/stool record
GET/api/patients/{id}/intake-output/trend?days=30Charts
PATCH/api/patients/{id}/pain/entriesAdd pain_context on create
GET/api/patients/{id}/pain/trend?context=breakthroughBreakthrough series

Module gate: vitals_tracking for IO; pain_tracking for breakthrough context UI on Complete.

Export + npm run generate:types per REQ-PLAT-10.


ComponentLocation
UrineBeakerCapture.tsxcomponents/vitals/
UrineColourPicker.tsxcomponents/vitals/
StoolBristolPicker.tsxcomponents/vitals/
FeverThermometerDisplay.tsxcomponents/vitals/ — band visual on temp card
IntakeOutputTrendChart.tsxcomponents/vitals/
BreakthroughPainStrip.tsxcomponents/pain/cancer/ — cancer profile only
BreakthroughPainMarker.tsxcomponents/pain/ — map overlay style
NeuroWatchChecklist.tsxcomponents/pain/cancer/ — brain site gate
OxygenTodayPanel.tsxcomponents/vitals/ — equipment gate

Extend VitalsTracking.tsx — do not duplicate full IO on Pain page (Complete embeds vitals bar only; IO stays on /vitals for Family tier clarity).


PhaseScopeBoard change
1aDB + API + urine/beaker + colour + stool/Bristol on /vitalsWatch rows → links only
1bFever thermometer band + temp trend zonesFever chip uses live temp
2apain_context + BreakthroughPainStrip + map markers + trend seriesBreakthrough chip live
2bNeuro checklist (brain site)Neuro chip live
2cOxygen today panelOxygen chip live
3buildAttentionItems() + remove legacy Watch Closely listCompact attention strip

  • Merging Observations module into Vitals UI
  • Inline fever decision cards on board (keep overlay session)
  • Care Orders / equipment catalogue full CRUD
  • Visit prep auto-bullets from IO trends (Phase 3+)

VersionDateChange
1.02026-06-10Initial design from product direction: vitals IO widgets, fever bands, breakthrough pain context, neuro/oxygen placement