28 — Custom Observations Module
Version: 1.1
Status: Backend + /observations dashboard shipped
Last Updated: 2026-06-02 10:30:00
Master requirements: 02-REQUIREMENTS.md §3.11, §7.37 (REQ-OBS-01–17). Tier matrix: 23-SUBSCRIPTION-TIER-ENTITLEMENTS-MATRIX.md §2. Daily self-care seed catalogue: 35 §3.6.
Module slug: custom_observations
Tier: Family, Complete
Purpose
Section titled “Purpose”Flexible daily observation tracking beyond standard vitals — bowel, fluid intake, breathlessness scores, weight, daily self-care independence (§3.6), etc. Uses plain-language prompts and family-friendly widgets (pill-tap, slider, number, text). Trend charts include Bollinger-band analytics (rolling mean ± 1σ).
Distinct from Stream 5 care_observations (clinical multi-domain table, Complete-only, schema-only today).
Implementation status
Section titled “Implementation status”| Layer | State | Notes |
|---|---|---|
| Migrations | Done | V079 (observation_types, patient_observations) |
| API | Done | routers/observations.py — types, list, create, trend, soft-delete |
| Service / repo | Done | observations_service.py, repositories/observations.py |
| UI — dashboard | Done | /observations (Observations.tsx → ObservationDashboard.tsx) |
| UI — gaps | Partial | Admin custom type CRUD (REQ-OBS-06); Bollinger care-alert firing |
API surface
Section titled “API surface”| Method | Path | Purpose |
|---|---|---|
| GET | /api/patients/{id}/observations/types | Observation types for patient |
| GET | /api/patients/{id}/observations | List entries (date/type filters) |
| POST | /api/patients/{id}/observations | Record observation |
| GET | /api/patients/{id}/observations/trend | Bollinger trend for one type |
| DELETE | /api/patients/{id}/observations/{obs_id} | Soft-delete |
Gate: require_module("custom_observations") via _obs in main.py.
Widget types
Section titled “Widget types”value_type | UI widget |
|---|---|
pill_tap | Discrete pill selector |
slider | 0–10 or configured range |
number | Numeric input with optional unit |
text | Free text |
Key files
Section titled “Key files”| File | Role |
|---|---|
backend/routers/observations.py | HTTP layer |
backend/services/observations_service.py | Business logic + trend math |
backend/repositories/observations.py | SQL |
frontend/src/components/observations/ObservationDashboard.tsx | Multi-card layout + summary |
frontend/src/components/observations/ObservationCard.tsx | Single observation capture card |
frontend/src/lib/api.ts | observationsApi |
Remaining work
Section titled “Remaining work”- Mount
ObservationDashboardon Dashboard, patient detail, or dedicated/observationsroute behindModuleGate. - Add primary nav / More page link when module enabled.
- Wire Bollinger out-of-band readings to
care_alerts(REQ-OBS-11). - Admin UI for tenant custom observation types (REQ-OBS-06).