Skip to content

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


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).


LayerStateNotes
MigrationsDoneV079 (observation_types, patient_observations)
APIDonerouters/observations.py — types, list, create, trend, soft-delete
Service / repoDoneobservations_service.py, repositories/observations.py
UI — dashboardDone/observations (Observations.tsx → ObservationDashboard.tsx)
UI — gapsPartialAdmin custom type CRUD (REQ-OBS-06); Bollinger care-alert firing

MethodPathPurpose
GET/api/patients/{id}/observations/typesObservation types for patient
GET/api/patients/{id}/observationsList entries (date/type filters)
POST/api/patients/{id}/observationsRecord observation
GET/api/patients/{id}/observations/trendBollinger trend for one type
DELETE/api/patients/{id}/observations/{obs_id}Soft-delete

Gate: require_module("custom_observations") via _obs in main.py.


value_typeUI widget
pill_tapDiscrete pill selector
slider0–10 or configured range
numberNumeric input with optional unit
textFree text

FileRole
backend/routers/observations.pyHTTP layer
backend/services/observations_service.pyBusiness logic + trend math
backend/repositories/observations.pySQL
frontend/src/components/observations/ObservationDashboard.tsxMulti-card layout + summary
frontend/src/components/observations/ObservationCard.tsxSingle observation capture card
frontend/src/lib/api.tsobservationsApi

  1. Mount ObservationDashboard on Dashboard, patient detail, or dedicated /observations route behind ModuleGate.
  2. Add primary nav / More page link when module enabled.
  3. Wire Bollinger out-of-band readings to care_alerts (REQ-OBS-11).
  4. Admin UI for tenant custom observation types (REQ-OBS-06).