Watch Closely Measurements — Implementation Plan
Version: 1.0
Last Updated: 2026-06-10 12:00:00
Spec: 2026-06-10-watch-closely-measurements-design.md
Phase 1a — Urine + stool on /vitals ✅
Section titled “Phase 1a — Urine + stool on /vitals ✅”| Task | Files |
|---|---|
Migration V017__patient_intake_output.sql | backend/migrations/ |
| Repository / service / router | repositories/intake_output.py, services/intake_output_service.py, routers/intake_output.py, schemas/intake_output.py |
| Wire router (vitals_tracking gate) | backend/main.py |
| Tests | tests/test_intake_output.py |
| OpenAPI export | openapi/openapi.json, frontend/src/lib/api.types.ts |
| API client | frontend/src/lib/api.ts |
| UI components | UrineBeakerCapture, UrineColourPicker, StoolBristolPicker, IntakeOutputSection |
| Page integration | VitalsTracking.tsx |
Phase 1b — Fever bands ✅
Section titled “Phase 1b — Fever bands ✅”| Task | Files |
|---|---|
fever_band_from_celsius service helper | services/intake_output_service.py |
| Shared frontend fever bands | lib/feverBands.ts |
| Thermometer on temp card | FeverThermometerDisplay.tsx, VitalsBar.tsx, VitalEntryModal.tsx |
| Temp trend zone backgrounds | VitalsTrendChart.tsx |
Phase 2a — Breakthrough pain (next)
Section titled “Phase 2a — Breakthrough pain (next)”- Migration:
pain_contextonpatient_pain_entries BreakthroughPainStrip, map markers, trend filter
Phase 2b–3 — Neuro, oxygen, board attention strip (later)
Section titled “Phase 2b–3 — Neuro, oxygen, board attention strip (later)”- Do not remove
CancerWatchCloselyuntil Phase 3buildAttentionItems()is wired.
Verification commands
Section titled “Verification commands”cd backendpython -m pytest tests/test_intake_output.py tests/test_fever_band.py -xruff check repositories/intake_output.py services/intake_output_service.py routers/intake_output.py
cd ../frontendnpm run generate:typesnpm run build