Skip to content

02 — Solution & Business Requirements

Version: 3.33
Last Updated: 2026-08-06 13:33:14

This document defines what LynCareOS is, the business problem it solves, what it must satisfy, and what is fully implemented in this repository today. It is the master product requirements document for this folder — module specs (06, 08, 09, 26, 27, 28, 29, 33), 04-ROADMAP.md, 18-STRIPE-GLOBAL-PRICING.md, and 23-SUBSCRIPTION-TIER-ENTITLEMENTS-MATRIX.md must stay aligned with this file and backend/billing/tiers.json. Where behaviour differs, the API and PostgreSQL schema win; then update this document and propagate to siblings. For a three-way audit (requirements vs code vs marketing tier cards), see 31-REQUIREMENTS-CODE-MARKETING-RECONCILIATION.md — normative REQ status changes should follow the action register in that document, not ad-hoc edits here.

Technical companion: 01-ARCHITECTURE.md. UI standards: 03-DESIGN-SYSTEM.md (Calm Care — canonical); conventions: 05-DEVELOPER-GUIDE.md.


Millions of families worldwide are caring for a loved one — whether managing complex medication regimes for an elderly parent, coordinating a rotating team of paid and unpaid carers, or tracking the symptoms and wellbeing of someone living with a serious illness. These families rely on a patchwork of paper charts, WhatsApp groups, pill organisers, and spreadsheets. The result is missed doses, communication breakdowns, forgotten appointments, and care teams that cannot see the full picture.

Healthcare providers are not the answer. Existing clinical software is designed for institutions, not families. It is expensive, requires clinical training, and does not serve the informal care team — the adult children, partners, neighbours, and friends who deliver the majority of care in the home.

LynCareOS is a family care platform that brings together every dimension of home care management into a single, shared workspace for the care circle around one or more people in need. It is:

  • Multi-tenant SaaS: one deployment serves thousands of independent subscriber families, each with complete data isolation.
  • Subscription-based: three annual tiers (Essential · Family · Complete) priced from USD $39/year — affordable for families, not institutional buyers.
  • Module-gated: capabilities unlock at higher tiers, providing a natural upgrade path as the care situation grows in complexity.
  • Privacy-first: clinical data stays on-premise (single-region PostgreSQL); no third-party analytics, no data sharing, PHI never leaves the application layer.
  • Compliance-grade: full audit trail, role-based access, row-level security, and OWASP Top 10:2025 cleared at launch.

Primary: English-speaking families in Australia, New Zealand, the United Kingdom, United States, Canada, and Ireland who are managing the home care of one or more family members. Typical personas:

  • An adult daughter coordinating care for an elderly parent with multiple medications and fortnightly community nurse visits.
  • A parent managing daily medication schedules for a child with a chronic condition.
  • A couple self-managing a palliative care situation at home with a small team of nurses and family volunteers.

Product identity: LynCareOS is a family support care solution, not a medical app. It does not diagnose, treat, cure, or replace professional medical advice.

Not targeted: aged-care facilities, hospitals, community health services, or clinical service providers. The product is deliberately positioned outside the regulated health-provider space to avoid mandatory clinical registration requirements in each jurisdiction. Regulatory applicability (chair minute + control map): 26-REGULATORY-APPLICABILITY-AND-CONTROL-MAP.md.

EssentialFamily (slug: professional)Complete
USD / year$39$69$99
AUD / year$59$99$149
GBP / year£29£55£79
EUR / year€39€65€89
Other currenciesNZD $60 · CAD $59 · INR ₹3,299NZD $109 · CAD $95 · INR ₹5,999NZD $159 · CAD $139 · INR ₹8,999
One-line positioningCare coordination for a small, close family circleA growing care circle with more people and richer toolsAn extended family network caring for multiple loved ones
  • Annual billing only — no monthly option; Stripe Checkout with Adaptive Pricing (currency selected at checkout based on customer location).
  • Self-serve upgrade: subscribers pay only the prorated difference between tiers; annual anniversary date resets on upgrade.
  • Downgrade at renewal: tier change takes effect at the next billing anniversary; access to higher-tier features is preserved until then.
  • Add-on: +$5/yr per extra person in care (all tiers), stored as extra_care_recipients on the tenant row.
  • Stripe Customer Portal: subscribers manage invoices and payment methods directly.

The tier structure creates a compounding upgrade loop. A family starts on Essential (1 care recipient, 2 carers). As their care situation expands — a second parent needs care, more family members join, medication complexity increases — the platform surfaces contextual upgrade prompts at every capacity boundary. Higher tiers unlock richer clinical tools (prescriptions, sleep tracking, pain mapping, vital signs) that become essential once discovered.

LynCareOS is in private beta at https://app.lyncareos.com, live on DigitalOcean Sydney VPS lyncareos-prod-syd1 (134.199.173.206, 2 vCPU / 4 GB) since 2026-05-20. The workstation production host has been decommissioned. The marketing site at https://lyncareos.com remains gated by a worker-level private-beta splash page. Stripe is live on production since 2026-05-26 (operator E2E verified 2026-05-31) — see 21-STRIPE-LIVE-SWITCHOVER.md. Authoritative posture, launch gate, and resolution queue: 04-ROADMAP.md (Current posture, §1 Launch, Resolution queue).


The following use cases define the primary real-world scenarios LynCareOS is built to serve. Requirements were designed and prioritised against these cases. Engineers and reviewers should evaluate changes against the relevant use case(s). “Core Modules (Built)” identifies modules already implemented. “Future Modules Needed” identifies capability gaps for that use case addressed in the Future requirements in §7.

IDUse CaseDescriptionCore Modules (Built)Future Modules Needed
UC-01Family medication coordinatorAdult siblings rotating coverage for an elderly parent taking 8+ daily medications. Shared dispense log, schedule adherence, low-stock alerts, and task calendar.medication_dispensing, care_calendar, prescription_managementcare_observations, handover
UC-02Child with chronic conditionParents managing daily medication, PRN events, and specialist appointments for a child with epilepsy or a similar condition requiring close monitoring.medication_dispensing, care_calendar, pain_tracking, vitals_tracking, key_contactscare_observations, clinical_episodes
UC-03Adult palliative home careA family coordinating a rotating team of paid nurses and family carers for a terminally ill adult at home — care shifts, handover continuity, medications, vitals, pain management, and escalation contacts.care_calendar, medication_dispensing, vitals_tracking, pain_tracking, prescription_management, key_contacts, shoppinghandover, goals_of_care, clinical_episodes, caregiver_wellbeing
UC-04Complex paediatric palliative careA family providing full-time care for a teenager with a severe complex disability (e.g. Spina Bifida) in a palliative context. A 10+ person multidisciplinary team, daily observations across 15+ clinical domains, therapy session continuity, advance care planning, adolescent psychosocial tracking, equipment management, and longitudinal deterioration monitoring. This is the most demanding use case and drives the full module roadmap.care_calendar, medication_dispensing, pain_tracking, vitals_tracking, sleep_tracking, key_contacts, prescription_management, shoppingcare_observations, handover, therapy_records, goals_of_care, clinical_episodes, caregiver_wellbeing, equipment_management, patient_voice, care_intelligence
UC-05Aged care networkAdult children coordinating care for two elderly parents with different care needs, sharing a small care team across an extended family network.care_calendar, medication_dispensing, vitals_tracking, sleep_tracking, shopping, key_contactscare_observations, handover, caregiver_wellbeing
UC-06Disability support coordinationA young adult with a physical disability receiving government disability support funding (e.g., NDIS in Australia, Medicaid HCBS waivers in the USA, Local Authority care packages in the UK — see §1.8) delivered through paid support workers and family carers. Goal tracking, therapy continuity, equipment management, and scheme funding documentation.care_calendar, medication_dispensing, key_contacts, shoppingcare_observations, therapy_records, equipment_management, goals_of_care, patient_voice
UC-07Elderly respiratory palliative care (IPF)An elderly person (e.g., 80 years old) with Idiopathic Pulmonary Fibrosis being supported at home by family and community nursing. Breathlessness is the defining daily burden. Family needs to track oxygen therapy compliance, dyspnoea and fatigue trends, exertional performance decline, manage O₂ cylinder stock, and have a bedside crisis plan for acute breathlessness — all while coordinating with a respiratory team and palliative service. The condition is gradually progressive with sudden acute exacerbations.care_calendar, medication_dispensing, vitals_tracking, pain_tracking, sleep_tracking, key_contacts, prescription_management, shoppingrespiratory_oxygen, goals_of_care, clinical_episodes, care_observations, therapy_records, equipment_management, caregiver_wellbeing, preventive_care, frailty_tracking, care_intelligence
UC-08Advanced dementia palliative careA family (typically adult children) providing or coordinating full-time care for an elderly parent with moderate-to-severe dementia at home or in transition to residential aged care. The primary daily challenges are unpredictable behavioural episodes, progressive loss of communication, swallowing and nutrition safety, falls, and total ADL dependency. There is no single terminal event — the family needs to understand a slow, fluctuating trajectory, preserve the person’s dignity and routines, and sustain themselves across what may be years of care. This use case most directly surfaces the platform’s family-centric purpose.care_calendar, medication_dispensing, sleep_tracking, pain_tracking, key_contacts, shoppingbehaviour_tracking, care_protocols, cognitive_tracking, swallowing_safety, falls_tracking, observational_pain, care_observations, goals_of_care, clinical_episodes, caregiver_wellbeing, family_journal, preventive_care, frailty_tracking, care_intelligence

LynCareOS is designed for subscribers globally. All requirements and UI text use generic, jurisdiction-neutral terms. The table below maps each platform term to its common regional equivalent so that engineers, reviewers, and subscribers can correctly interpret requirements regardless of their country.

When building UI copy, error messages, or documentation, use the platform term in the first column. Jurisdiction-specific names belong in localisation/translation layers, not in platform code or requirements.

Platform TermWhat it means in the platformAUUSUKNZCAIE
Emergency services numberThe number to call for immediate emergency assistance (ambulance, fire, police)000911999111911999 / 112
Disability support funding schemeA government programme providing funded in-home and community support for people with a permanent disabilityNDIS (National Disability Insurance Scheme)Medicaid HCBS waivers; Medicaid waiver programmesLocal Authority adult social care funding; NHS Continuing Healthcare (CHC)Enabling Good Lives / MoH disability fundingProvincial disability support programmes (e.g., Ontario DSO)HSE Personal Assistance and Home Support
Government pharmaceutical benefitsA national scheme that subsidises or funds medicationsPBS (Pharmaceutical Benefits Scheme)Medicaid / Medicare Part DNHS prescriptionsPHARMACProvincial drug formularies / ODB (Ontario)HSE GMS / Drug Payment Scheme
Accident or injury compensation schemeThird-party or no-fault insurance covering care costs arising from accidents or injuriesTAC (Vic) / WorkCover / CTPWorkers’ compensation; auto liability insuranceCRU; NHS treatmentACC (Accident Compensation Corporation)WSIB / ICBCPIAB / employer liability insurance
Government-funded aged careA funded programme providing in-home or residential support for elderly peopleHome Care Package (HCP) / CHSP / residential aged careMedicaid LTSS; Medicare skilled nursingNHS Continuing Healthcare; Direct Payments; care home local authority fundingAged residential care / home supportLong-term care / LTCHFair Deal / Nursing Home Support Scheme
Primary care doctor / GPThe patient’s regular primary care physicianGPPrimary care physician / PCP / family doctorGPGPFamily physician / GPGP
Community nurseA nurse who visits patients at home via a community or district health serviceCommunity nurse / district nurseHome health nurseDistrict nurse / community nurseDistrict nurseCommunity health nursePublic health nurse
Residential care facilityA facility providing full-time care for elderly or disabled people who can no longer live independentlyAged care facility / nursing homeNursing home / skilled nursing facility (SNF)Care home / nursing homeAged residential care (ARC)Long-term care homeNursing home
Advance care directiveA legal or semi-legal document stating a person’s wishes for future medical treatment if they lose decision-making capacityAdvance Care Directive / Statement of ChoicesAdvance Directive / Living Will / POLSTAdvance Decision to Refuse Treatment (ADRT) / ReSPECT formAdvance Care PlanAdvance Directive / Goals of Care documentAdvance Healthcare Directive
Enduring power of guardianshipLegal authority to make health and lifestyle decisions on behalf of a person who has lost capacityEnduring GuardianshipHealthcare Proxy / Medical Power of Attorney (MPOA)Lasting Power of Attorney — health and welfareWelfare Guardian / EPOAPersonal Directive / MandateEnduring Power of Attorney (health)
Respite careTemporary relief care for the primary family carer, delivered in the home or at a respite facilityResidential respite / in-home respite (NDIS or HCP-funded)Respite care (Medicaid-funded or private)Short-break care / respite (Local Authority or CHC-funded)Carer support / respite (MoH or NGO-funded)Respite care (provincial funding)Short-term breaks / respite (HSE-funded)

Note for engineers: When a requirement references a funding scheme, legal document type, or service category, use the platform term from column 1 in code and API responses. Never hardcode a jurisdiction-specific label (e.g., "NDIS", "PBS") as an enum value unless it is stored as user-supplied free text. The funding_source field on equipment records, for example, is free-text for this reason.

Relationship to i18n locale config: Each row in this table that has a regional name variant (e.g., the emergency services number, scheme names, legal document names) maps to a terminology override block in the locale config file for that country. When the platform is localised for a new country, this table is the primary input for the locale’s terminology overrides. See §7.35 for the internationalisation and localisation architecture.

Language coverage: The table above covers Wave 1 and Wave 2 launch markets (AU, US, UK, NZ, CA, IE, FR, ES, NL, DE, IT, PT, RU) and Wave 2 expansion markets (AR, IN). Wave 2 also includes Japan (ja-JP) — the highest-priority non-European addition given Japan’s aged population (29% over 65), very high disposable income, and deep family care culture. Wave 3 covers South Korea (ko-KR) and Taiwan/Hong Kong Traditional Chinese (zh-TW, zh-HK). Japanese, Korean, and Traditional Chinese terminology equivalents will be added to this table when those locale configs are commissioned. The full language rollout schedule is in §7.35.9.


LayerDeliverable
Web clientReact 19, TypeScript, Vite 8, Tailwind CSS 3 — frontend/
APIPython 3.12, FastAPI, async PostgreSQL via psycopg v3 — backend/
DataPostgreSQL 16 — DDL in backend/schema.sql; incremental migrations in backend/migrations/V*.sql applied on startup
Marketing siteStatic HTML + Cloudflare Worker (beta gate) — marketing/palliative/
InfrastructureDocker Compose (docker-compose.yml), Cloudflare Tunnel, PgBouncer, Redis, scan worker

There is currently no native mobile app — the app is delivered as a PWA. A Capacitor-based native build (Google Play first, then Apple App Store), with website Stripe as commerce SoT and consumption-only free store clients, is on the product roadmap; see §7.36 and native-store-clients design. There is no separate BFF and no ORM (direct psycopg parameterised queries throughout). Frontend TypeScript interfaces are currently maintained manually in frontend/src/lib/api.ts; migration to OpenAPI-generated types is planned (REQ-PLAT-10).

  • Development: dev-start.ps1 — backend on port 8021, Vite dev server on 5173, lyncareos_dev PostgreSQL.
  • Production: docker compose --env-file .env.production --profile production on the operations host — services: app, postgres, pgbouncer, redis, scan_worker. Exposed via Cloudflare Tunnel at https://app.lyncareos.com.
  • UAT: Same Docker Compose production profile on a non-production machine; full-stack rehearsal against a non-authoritative database.

See 00-INDEX.md — Terminology for the definitive environment definitions.

2.2 Implementation snapshot (code-aligned)

Section titled “2.2 Implementation snapshot (code-aligned)”

Verified against backend/main.py, backend/billing/tiers.json, frontend/src/App.tsx, and frontend/src/lib/api.ts on 2026-05-25.

Module slugTier (from tiers.json)Backend gate (main.py)Primary UI route(s)Status
medication_dispensingAll_med/log, /history, /analytics, /medication-scheduleBuilt
care_calendarAll_cal/calendar, /schedule, /people, patients, shifts, appointmentsBuilt
prescription_managementEssential, Family, Complete_script/scripts, /scripts/:id, scan flowBuilt — active-script caps 2 / 5 / unlimited
sleep_trackingFamily, Complete_sleep/sleepBuilt
vitals_trackingFamily, Complete_vitals/vitalsBuilt
key_contactsFamily, Complete_contacts/contactsBuilt
shoppingComplete_shop/shopping, /admin/shopping-catalog (super-admin)Built
pain_trackingComplete_pain (pain + mind routers)/painBuilt
condition_templatesAll (2 free starters)_ctpacks/subscriptions Care Profiles grid; Care Start apply via API / dev QAPartial — unlock + apply Done on VPS (2026-06-04); open C1d, prod paid pack Stripe
custom_observationsFamily, Complete_obs/observationsPartial — dashboard + trends; alerts / export gaps per 28
family_helpFamily, Complete_help/help-requests (More menu)Partial — board Done; calendar integration pending
care_pathwaysFamily, Complete (planned)— (Future _pathways)/planning-ahead (planned)Future — spec complete 2026-06-04; REQ-PATH-01–34; D31 — 33-CARE-PATHWAYS-MODULE.md

Platform (not module-gated): auth, users, invitations, tenants, subscriptions, Stripe billing, onboarding checklist, care alerts (shared in-app alert queue), PWA auth handoff (routers/pwa_auth.py), audit viewer (under _med gate today).

Tier placeholders (Complete tier in tiers.json, no router yet): family_journal, preventive_care, and Stream 5 slugs (care_observations through care_intelligence) — DB schemas exist for many (V083–V088); routers and UI are Future. care_pathways is specified (REQ-PATH-01–34) but not yet in tiers.json — add at D31 P1 implementation. See §7.40 and 04-ROADMAP §10.5.

Not in tiers.json (legacy only): care_services — may appear on old subscriptions rows and in schema.sql CHECK constraints; no router, not provisioned for new signups. See REQ-MOD-03.

API versioning: Both /api/... and /api/v1/... resolve to the same routers (additive aliases in main.py). The SPA still calls /api/... by default.

PWA: manifest.json, sw.js, and install prompt flow are shipped; offline resilience is partial — syncQueue.ts queues failed dispensing POSTs only (NFR-2 Partial).

Known partial features vs this doc (sequencing: 04-ROADMAP): REQ-MED-08 carer filter — not built; REQ-MED-13 (carer_id / shift_id on dispensings) — Future; REQ-SHOP-04 shopping shift widget — not imported; REQ-HELP-08 calendar help entries — Future; Care Start apply — Done on VPS (2026-06-04); open C1d clinical sign-off + prod paid pack checkout; REQ-PAIN-12 body map observation layers — Future; REQ-MOD-04..22 — schema only (V083–V088). PHI encryption — Partial (V091 prod; DEK envelope outstanding).


These are the subscriber-visible outcomes the codebase currently supports, gated by tier subscription where noted.

  • Multi-tenant accounts: every subscriber family is a fully isolated tenant; data is scoped by tenant_id at the application and database (RLS) layers.
  • User registration and authentication: username/email + password; optional Google Sign-In (OAuth2 redirect or inline popup); JWT access + refresh token pair; TOTP multi-factor authentication (AES-GCM encrypted secrets at rest).
  • Invitation-based team access: admin issues time-limited tokens; invited users see a pending-approval screen until the admin approves; roles: admin, carer, observer.
  • Patient (person in care) records: CRUD per tenant; profile photo; medical summary; patient_access grants control which carers/observers can see each patient.
  • Module subscription system: eleven active product module slugs (eight original + three Stream 2–3), enforced server-side by require_module() dependency and ModuleGate in the frontend; locked modules are shown with upgrade CTAs, never hidden. Additional slugs in tiers.json are tier placeholders for Stream 5 clinical modules.
  • Getting Started checklist: guided 8-step onboarding (welcome, add patient, invite carers, configure medications, set up calendar, explore modules, review subscriptions, personalise account); progress badge on the More page.
  • Dark/light theme: persistent across sessions; chart colours, body map overlays, and all UI elements adapt.
  • Idle session warning: IdleWarningModal notifies users before their session token expires.
  • PWA (Progressive Web App): installable on iOS and Android; iOS Safari Google OAuth session handoff via a three-endpoint PWA auth service (session create → Safari callback → poll for token).
  • Care alerts (in-app): shared alert queue visible to all carers and admins with patient access; bell icon and open-count badge (including PWA app icon via Badging API; badge refreshes on resolve and when the inbox closes); carers resolve alerts with an audit trail (care_alert_events); observers may view but cannot resolve (403); per-channel tenant settings (master switch + nine channels: shift reminder/cancelled, calendar events, handover notes, shopping, family help, body pain high, mind elevated, overdue dose); admin settings at /admin/alerts. Web Push (VAPID) removed — awareness is in-app only.
  • Responsive mobile-first UI: mobile bottom tab bar (safe-area aware), desktop sidebar; return-to-Home after long idle (≥10 minutes away — awayCalendar.ts, Layout.tsx).
  • Audit log viewer: admin-only paginated view of audit_log entries with before/after JSON snapshots; supports action filter.
  • Full-page error boundary: ErrorBoundary component prevents blank-screen failures.

3.2 Care coordination (care_calendar — Essential, Family, Complete)

Section titled “3.2 Care coordination (care_calendar — Essential, Family, Complete)”
  • Shared care calendar: monthly and weekly grid views; shift chips coloured by the assigned carer’s profile colour.
  • Care shifts: create single, date-range, and recurring shifts (weekly/fortnightly presets); assign a carer; add per-shift task checklists with completion tracking.
  • Coverage gap detection: visual CoverageGapChip component highlights periods with no assigned carer.
  • My Schedule: agenda-style list view (/schedule) of upcoming shifts for the logged-in carer.
  • Clinical appointments: patient_appointments table — date, time, title, address, arranged-by attribution; linked to the calendar date view; in-app care alert on create/update/delete.
  • Care team management: invite carers and observers; view team members; assign carers to specific patients; remove members; enforce tier capacity limits.
  • People in care profiles: photo, DOB, medical summary; edit by admin; view by all members with access grants.
  • Observer (read-only) role: observers can view calendar, shifts, and patient data without being able to create or modify records.

3.3 Medication dispensing (medication_dispensing — all tiers)

Section titled “3.3 Medication dispensing (medication_dispensing — all tiers)”
  • Formulary management: per-tenant medicines (name, unit, active flag); reason types for categorising doses; tenant-configurable quick pills for the manual log screen; 5-item caps on Essential (6th triggers upgrade prompt).
  • Manual dose recording: log date, time, medicine, volume, optional reason and notes from the Log Dose screen; PRN (as_needed) medicines supported; first-dose adverse reaction check when a medicine is given for the first time (see REQ-MED-16), including urgent team notification, history log, and clinical contact list on Yes.
  • Dose history: filterable list of all dispensings (date range, medicine, carer filters available on Family/Complete); edit and delete with mandatory deletion reason; full audit trail. Dispensing and Adverse Reactions History Log merges dose records with coral-highlighted adverse reaction events (REQ-MED-16).
  • Proof-of-dose photo: optional image attachment on any dispensing record; stored in UPLOADS_DIR with URL on the dispensings row.
  • Medication schedule (/medication-schedule): named medication groups with a scheduled dispense time; per-group list of medicines + doses; week-wide grid view with pending/dispensed/overdue/waived state per day per group.
  • Batch dispense: mark all items in a group as dispensed in a single atomic server-side operation; batch undo (admin, same-day, unedited rows only).
  • Drag-and-drop reorder: @dnd-kit reordering of schedule items; batch reorder endpoint.
  • Dashboard summary: “Medications today” widget showing overdue count, due count, and a scheduled doses strip; links to /medication-schedule. Week at a glance (WeekAtAGlance) when care_calendar is enabled — Mon–Sun strip, week navigation, carer initial chips, tap-through to calendar.
  • Analytics dashboard (/analytics): heatmap, trend chart (dual-axis liquids/solids), daily summary, by-reason donut, timeline; analytics filters (date range, medicine, carer) unlocked at Family tier.

3.4 Prescription management (prescription_management — Family, Complete)

Section titled “3.4 Prescription management (prescription_management — Family, Complete)”
  • AI-powered scan: photograph a prescription → LM Studio (Qwen2.5-VL, server-side only) extracts structured fields (medicine, dose, quantity, repeats, prescriber, expiry) via SSE result stream; results are reviewed before saving.
  • Image handling: EXIF stripped before model submission; image stored in UPLOADS_DIR; viewable in script detail.
  • Script records: full CRUD; lifecycle statuses: active, paused, exhausted, expired, superseded, archived; stock adjustment field for admin corrections.
  • Fill tracking: record prescription fills against a script; fills vs authorised count.
  • Derived stock on hand: calculated from fills × quantity + stock_adjustment − dispensings linked by script_id.
  • Dashboard alert banners: low-stock and expiry-approaching alerts displayed on the home screen; tap-through to script detail.
  • Medicine summary: aggregated view across multiple scripts for the same medicine.
  • Dispensing link: dispensing records reference script_id and fill, enabling accurate stock depletion.

3.5 Sleep tracking (sleep_tracking — Family, Complete)

Section titled “3.5 Sleep tracking (sleep_tracking — Family, Complete)”
  • Sleep interval entry: drag-to-select half-hour grid on a weekly view; one or more intervals per day.
  • Pattern views: weekly grid, monthly calendar, total hours per day.
  • Rolling trend: 10-day trailing rolling average for bedtime and wake time. Per-day bedtime and wake markers merge contiguous sleep blocks separated by gaps of ≤ 30 minutes into a single session — earlier blocks pull bedtime earlier, later blocks pull wake time later. Gaps > 30 minutes split sessions; pre-evening and post-morning blocks outside the main session are excluded from the average. Curves end on the last calendar day that has any logged sleep (no extrapolation into empty rows).
  • Role enforcement: carers and admins can record; observers view only.

3.6 Vital Signs (vitals_tracking — Family, Complete)

Section titled “3.6 Vital Signs (vitals_tracking — Family, Complete)”
  • Dedicated page (/vitals): log pulse (bpm), blood oxygen (SpO₂ %), and body temperature (°C or °F).
  • Multiple readings per day: each reading has an HH:MM timestamp; partial-unique indexes prevent accidental duplicate entries at the same minute per vital type.
  • Clinical status indicators (VitalsBar): five-tier classification (Normal → Watch → Caution → Concerning → Critical) based on internationally recognised adult resting-value reference ranges (sourced from NHS and Cleveland Clinic guidelines as representative references; ranges are not jurisdiction-specific clinical advice).
  • Date navigation: browse any past date; future dates blocked.
  • Vitals embedded in Pain & Stats: on the Complete tier, vitals data is surfaced within the /pain page alongside body map and mind assessment.

3.7 Key Contacts (key_contacts — Family, Complete)

Section titled “3.7 Key Contacts (key_contacts — Family, Complete)”
  • Contact directory: per-patient list of healthcare and support professionals with rich fields: name, role tag, organisation, phone, email, address, notes, emergency flag, pin flag.
  • Role tags: GP · specialist · nurse · pharmacist · social worker · palliative care · physio · OT · legal · financial · emergency · transport · equipment · spiritual · other.
  • Communication notes: per-contact log entries with direction (incoming/outgoing), channel (phone/email/in-person/telehealth/SMS/other), priority (routine/important/urgent), follow-up date, author, timestamp.
  • File attachments on notes: PDF, JPEG, PNG, WEBP, DOC, DOCX up to 20 MB; stored in UPLOADS_DIR/contact_attachments/; served via authenticated download endpoint.
  • Emergency contacts quick-dial (Dashboard): up to 4 contacts flagged is_emergency appear as tap-to-call buttons at the bottom of the home screen; rendered for Family and Complete tiers when contacts are configured.
  • Module gate: enabled on Family and Complete via key_contacts subscription; carers and admins can write; observers are read-only via patient_access.
  • Patient shopping lists: multiple named lists per care recipient; items from a shared catalog or added as custom free-text products.
  • Catalog: categories and icons; tenant badge override per catalog item; catalog-backed search.
  • Item states: active (needed) vs purchased; recurring items auto-reset daily at 06:00 via APScheduler.
  • Real-time sync: Server-Sent Events (SSE) push so all family members see list changes immediately without polling.
  • Super-admin catalog management: /admin/shopping-catalog — global catalog CRUD (add, edit, deactivate items) and suggestion queue to review user-submitted catalog additions.
  • Shopping list page (/shopping): full list management, catalog search, SSE sync, recurring reset — built.
  • Shopping dashboard widget: ShoppingDashboardWidget is wired into Dashboard.tsx behind the shopping module gate (2026-05-20). ShoppingShiftWidget exists but is not yet wired into Calendar shift detail (REQ-SHOP-04 Partial).

3.9 Pain & Stats (pain_tracking — Complete)

Section titled “3.9 Pain & Stats (pain_tracking — Complete)”
  • Body map (/pain): interactive front/back anatomical diagram with polygon zone system (8-point polygon hit-testing via ray-casting); tap any region to record pain level 0–10; hotspot coordinates stored as percentages for device-independent rendering; carry-forward from the most recent prior day.
  • Pain history: navigate by date; edit and delete pain entries; 30-day trend charts per body region.
  • Vital Signs (embedded): vitals data shown alongside the body map for Complete-tier users (same data as /vitals).
  • Mind & wellbeing assessment: seven clinical domains scored 0–4 each (Mood, Anxiety, Fear, Cognition, Behaviour/Engagement, Sleep, Coping); one assessment per patient per day; narrative descriptions per score level.
  • Trend analysis (Trend tab): three category buttons (Body / Mind / Vitals); 30-day line charts; filter chips as coloured legend; tooltip shows clinical tier label for vitals.
  • Tenant settings: tenant_pain_settings table — enable/disable individual pillars (body map, vitals, mind); configurable module label and description; storage_key_prefix for localStorage namespace; standalone_mode flag reserved for white-label deployment.
  • Calibration tooling (user ID 1): in-app polygon editor with 8-handle per-zone editing, Group Transform sliders (Scale X/Y with configurable origin), one-click bake and copy output — enables recalibration against new body images without a development build.
  • Skeleton body map (REQ-PAIN-11): fourth selector pill [Front] [Back] [Skeleton] [Mind]; 16 tappable bone regions; body_layer values include front-skeleton / back-skeleton (V082, V092).

3.10 Condition template packs & Care Start (condition_templates — all tiers)

Section titled “3.10 Condition template packs & Care Start (condition_templates — all tiers)”
  • Care archetypes: seven coordination patterns via GET /api/condition-packs/archetypes; family selection UI withdrawn 2026-06-26 (REQ-TMPL-01 Partial — API only).
  • Care Profile library: twelve profiles + checkout bundles — canonical slugs in 35-CARE-PROFILE-CATALOGUE.md §3.2. Reconciled on dev and VPS via V007 (2026-06-04).
  • Unlock: two free starters (general_palliative, medication_orchestra); Complete tier all profiles; Family one-time Stripe purchase. tenant_pack_purchases ledger Done.
  • Care Start apply: apply_care_start_pack() seeds reason types, observation types, and shift tasks per patient (REQ-TMPL-02 Done on VPS; open C1d + prod paid pack checkout).
  • Archetype / profile correction: non-destructive per patient — REQ-CARE-START-04 Partial (API; family UX withdrawn 2026-06-26); policy 35 §7.5.
  • Subscriptions UI: pack grid on /subscriptions; Palliative Care Start bundle at marketing checkout — REQ-CARE-START-01 Done (C4a); prod pack purchase still gated.

See 27-CONDITION-TEMPLATE-PACKS-MODULE.md and 35-CARE-PROFILE-CATALOGUE.md.

3.11 Custom observations (custom_observations — Family, Complete)

Section titled “3.11 Custom observations (custom_observations — Family, Complete)”
  • Observation types: system-wide and tenant-scoped types with pill-tap, slider, number, and text widgets.
  • Capture API: POST /api/patients/{id}/observations; multi-entry per day; soft-delete with audit.
  • Trend analytics: Bollinger-band chart (rolling mean ± 1σ) per type over 7/30/90 days via trend endpoint.
  • UI today: /observations route with ObservationDashboard, multi-card capture, Bollinger trends; export and alert wiring Partial per 28.

See 28-CUSTOM-OBSERVATIONS-MODULE.md.

3.12 Family help board (family_help — Family, Complete)

Section titled “3.12 Family help board (family_help — Family, Complete)”
  • Request library: 25+ default help request types across five categories (help_request_types, V080).
  • Volunteer flow: create → open → “I’ll do this” (take) → complete; care alerts on create (new_help_request) and take (resolves open dedup + help_request_taken); schedule_alert after DB commit; audit on status transitions.
  • UI today: /help-requests page with Needs help / In progress / Done tabs; not yet linked from primary nav or More page; calendar filter pill for Help exists but does not render help entries yet.

See 29-FAMILY-HELP-MODULE.md.

3.13 Care Pathways — Planning Ahead (care_pathways — Family, Complete) — Future

Section titled “3.13 Care Pathways — Planning Ahead (care_pathways — Family, Complete) — Future”
  • Fourth product layer per Care Archetype: staged, informative planning journey — self-declared stage placement with undo, curated + family-added consideration cards, planning tasks with I’ll take this on ownership, data nudges that link to reading only (never auto-assign stage from meds).
  • UI (planned): /planning-ahead — discover via More menu, optional Home nudge, CTA from Subscriptions or People in care; not primary bottom nav (MVP).
  • Care alerts (planned): pathway_stage_acknowledged and pathway_stage_undone on human stage changes only (planning_ahead channel).
  • Status: product spec + interactive mockup complete 2026-06-04; no router, migrations, or UI shipped — implement per 04-ROADMAP §10.5 (D31).

See 33-CARE-PATHWAYS-MODULE.md · REQ-PATH-01–34 · §7.40.


  • Tokens: JWT access tokens (HS256, configurable expiry) held in-memory in the SPA; refresh token in an HttpOnly SameSite=Lax cookie (lyncare_refresh), Secure=true in production.
  • MFA: TOTP (RFC 6238) per user; secrets stored AES-GCM encrypted at rest (migration V038; MFA_ENCRYPTION_KEY derived from SECRET_KEY via HKDF-SHA256 if not explicitly set).
  • Google Sign-In: OAuth2 ID token verified server-side via google-auth; supported in the SPA login page and the marketing signup modal.
  • PWA Google handoff: iOS Safari-to-PWA session relay via three lightweight endpoints with 256-bit session IDs; rate-limited at 10/minute.
  • Rate limiting: JWT-signature-hashed rate limiting (backend/middleware/rate_limit.py) so buckets cannot be forged with a rewritten unsigned payload; applied to auth, registration, password reset, and invitation verification endpoints.
  • Idle warning: IdleWarningModal alerts users before token expiry.
  • OWASP Top 10:2025: cleared as of private beta; residual risks tracked in 32-KNOWN-DEBTS-REGISTER.md and 04-ROADMAP.

4.2 Multi-tenant data isolation (SECURITY CRITICAL — REQ-SEC-01)

Section titled “4.2 Multi-tenant data isolation (SECURITY CRITICAL — REQ-SEC-01)”
  • Every SQL query against clinical/care data includes tenant_id in its WHERE clause — no tenant-ambiguous queries.
  • Row-Level Security (migration V034) uses app_current_tenant_id() as a defence-in-depth backstop on PHI tables; a query that omits WHERE tenant_id = … returns zero rows rather than cross-tenant data.
  • require_tenant_member (or require_module) FastAPI dependency enforces tenant membership on every protected endpoint.
  • patient_access table grants per-patient scope to carers and observers; non-admin roles may only access patients they are explicitly assigned to.
  • super_admin impersonation via X-Tenant-ID header is strictly isolated to that header pattern.
  • Cache keys (Redis) include tenant_id — no resource-ID-only cache keys exist.

4.3 Audit trail (COMPLIANCE MANDATORY — REQ-AUD-01)

Section titled “4.3 Audit trail (COMPLIANCE MANDATORY — REQ-AUD-01)”

Every mutation to a clinical record writes an audit_log entry in the same database transaction:

FieldValue
tenant_idTenant of the record
performed_byUser ID of the acting user
actioncreate / update / delete
entity_typee.g. dispensing, patient_script, care_shift
entity_idPK of the affected row
snapshot_beforeJSON of the row before the change (null on create)
snapshot_afterJSON of the row after the change (null on delete)
created_atUTC timestamp
  • Deletes require a user-supplied reason (enforced in API).
  • Audit rows are append-only — no UPDATE or DELETE on audit_log.
  • Audit log viewer available to tenant admins via GET /api/audit; super-admin and auth/admin events are also covered (migration V033).
  • PHI fields are never written to application logs (print, logging, or console sink).
  • Content Security Policy: SecurityHeadersMiddleware on the FastAPI layer and _headers on the Cloudflare Pages marketing site — both allow only the specific origins actually used.
  • Dependencies: pinned in backend/requirements.txt and frontend/package.json; pre-commit audit hooks in place.
  • No telemetry or analytics SDKs — no third-party trackers; no data leaves the app other than Stripe (billing) and Google (auth).
  • Secrets in backend/.env (gitignored); VITE_* variables in frontend/.env are considered public.
  • Cloudflare Access on app.lyncareos.com (optional; CLOUDFLARE_ACCESS_AUD / CLOUDFLARE_ACCESS_APP_ID for JWT assertion verification).

4.5 Field-level identity encryption (REQ-ENC) — REQUIRED BEFORE PUBLIC LAUNCH

Section titled “4.5 Field-level identity encryption (REQ-ENC) — REQUIRED BEFORE PUBLIC LAUNCH”

Purpose and verifiable claim. LynCareOS must be able to state truthfully in its Terms & Conditions and Privacy Policy:

“The names and identifying information of the people in your care circle — both the person being cared for and the members of your care team — are encrypted at the application layer with a key unique to your account. LynCareOS does not store your account’s data encryption key in readable form accessible to database administrators. In the normal course of operations, LynCareOS staff cannot read the names or identifying details of your care recipients or carers.”

That claim can only be made honestly if identity fields are encrypted at the application layer before they are written to the database, using keys that are separated from the database content itself.

Encryption scheme.

  • Algorithm: AES-256-GCM with a unique random nonce per ciphertext.
  • Per-tenant Data Encryption Key (DEK): A 256-bit random key generated at tenant creation and stored in the tenants table as AES-256-GCM ciphertext, encrypted under the platform Key Encryption Key (KEK).
  • Platform Key Encryption Key (KEK): A dedicated FIELD_ENCRYPTION_KEY environment variable (separate from SECRET_KEY). The KEK never appears in the database. A DB-only breach yields only ciphertext DEKs and encrypted field values — decryption requires the KEK.
  • DEK derivation at runtime: The application decrypts the tenant’s stored ciphertext DEK using the KEK on first use per request, holds it in memory for the duration of the request, and discards it. It is never cached to disk.
  • Key rotation (envelope encryption): Rotating the KEK requires re-encrypting only the DEKs (one row per tenant), not re-encrypting field data — the DEK remains constant unless a deliberate per-tenant key rotation is performed.

Fields subject to field-level encryption.

TableEncrypted columnsNotes
patientsfull_name, preferred_name, date_of_birthThe identity of the person being cared for. medical_summary is intentionally excluded — it is unencrypted to support future product analytics and AI-assisted features.
usersfull_name, email (ciphertext), phone (if present)The identity of carers, observers, and admins
care_groupsnameGroup names are patient-linked and may identify the patient
tenantsnameThe account name often contains a family surname

Blind index for email login.

Because users.email is the primary login key and must support exact-match lookup, a deterministic blind index is stored alongside the ciphertext: email_idx = HMAC-SHA256(email.lower(), FIELD_ENCRYPTION_KEY), a fixed 64-char hex column. Login queries use WHERE email_idx = $1 — no plaintext email column exists. The UNIQUE constraint moves from email to email_idx. The encrypted ciphertext is used for display and outbound email only.

Audit log treatment.

audit_log.snapshot_before and snapshot_after store the row state at mutation time. Once field encryption is active, these JSON snapshots will contain AES-GCM ciphertext for the encrypted columns. This is by design: the audit record preserves an integrity-verifiable snapshot of what was written, without exposing plaintext PII to platform staff reading audit logs. Audit log consumers (tenant admin UI) receive decrypted values because the application layer decrypts before returning to the authorised caller.

Google Sign-In integration.

When a user authenticates via Google OAuth, the email returned by Google is encrypted and the email_idx is computed before the users row is written or matched. No plaintext email is stored at any point after the initial OAuth callback processing.

What this does and does not cover.

  • Covered: who is being cared for, who are the carers and observers — by name, email, and date of birth.
  • Not covered by this scheme: clinical records linked to a patient (e.g., dispensing logs, vital signs) — these are protected by tenant isolation and RLS but not by field-level identity encryption. Encrypting clinical time-series data would make reporting and analytics impossible; the encryption claim is scoped strictly to identity.
  • Not covered: free-text notes entered by carers (e.g., care shift notes, prescription notes). These may contain names but encrypting free-text would break full-text search. Platform staff policy (access controls, contractual NDAs) governs these fields.

Requirement IDs.

IDRequirementStatus
REQ-ENC-01patients.full_name, patients.preferred_name, and patients.date_of_birth are stored as AES-256-GCM ciphertext. The plaintext never touches the database layer. patients.medical_summary is explicitly excluded from field-level encryption and stored as plaintext to support future product analytics, AI-assisted feature development, and clinical tooling.Partial — full_name and date_of_birth encrypted (V076/V090; plaintext dropped V091, prod backfilled 2026-05-22). preferred_name_enc column exists but is not yet wired in services/field_crypto.encrypt_patient.
REQ-ENC-02users.full_name, users.email, and users.phone are stored as AES-256-GCM ciphertext. A deterministic email_idx blind index (HMAC-SHA256) replaces the plaintext unique index on email.Partial — email encrypted with email_idx blind index (V076/V090/V091); login, register, invite, and Google OAuth use email_idx exclusively. users.full_name and users.phone not yet encrypted (no phone column today; username remains pseudonymous in field_crypto.py).
REQ-ENC-03care_groups.name and tenants.name are stored as AES-256-GCM ciphertext.Done — care_groups.name_enc (V076), tenants.name_enc (V089); plaintext dropped V091; decrypt_tenant/decrypt_care_group on read paths.
REQ-ENC-04Each tenant has a per-tenant DEK, generated at tenant creation, stored encrypted under the platform FIELD_ENCRYPTION_KEY KEK. The DEK is never stored in plaintext in the database.Future — current implementation uses a single platform PHI_ENCRYPTION_KEY (Fernet) without a per-tenant DEK. Architecture in §4.5 above describes the target model; no dek_ciphertext table exists today.
REQ-ENC-05The FIELD_ENCRYPTION_KEY env var is separate from SECRET_KEY. Rotating the KEK requires re-encrypting only the tenants.dek_ciphertext column — not field data. A migration script and runbook must exist for KEK rotation.Partial — separate keys exist (PHI_ENCRYPTION_KEY + PHI_BLIND_INDEX_KEY rather than FIELD_ENCRYPTION_KEY). Multi-key rotation supported and tested in tests/test_phi_field_encryption.py; pinning runbook in scripts/production-phi-pin.ps1. KEK→DEK envelope rotation pattern not implemented (depends on REQ-ENC-04).
REQ-ENC-06The platform’s Terms & Conditions and Privacy Policy include the verifiable operator-blindness claim stated above. The claim is reviewed and approved by legal counsel before the marketing gate is lifted for public access.Partial — operator-blindness paragraphs live in marketing/palliative/terms.html / privacy.html (owner sign-off 2026-07-20; Pages redeployed). Formal external counsel optional. Marketing gate (A6) still closed until explicitly lifted. REQ-ENC-04 (per-tenant DEK) deferred per 22-BILLING-PRICING-REFERENCE.md

Implementation home: backend/services/crypto.py (extend existing AES-GCM service); backend/services/field_crypto.py (field-level helpers — encrypt/decrypt individual values); migration V###_field_encryption.sql (add email_idx, dek_ciphertext, dek_nonce columns; backfill existing rows).


4.6 Tenant data export — privacy pseudonymization (REQ-EXP)

Section titled “4.6 Tenant data export — privacy pseudonymization (REQ-EXP)”

Purpose. Subscribers who cancel or leave LynCareOS need a portable copy of their care data. Exports must align with the operator-blindness stance in §4.5: the downloadable file is designed so that sharing or archiving the ZIP does not unnecessarily spread real names or full email addresses, even though the requesting tenant admin sees decrypted identity inside the app.

Ordinal labels (mandatory in every export artefact).

Entity in the live appLabel in exportAssignment rule
Each care recipient (patients row)Patient One, Patient Two, Patient Three, …Stable order for that export run: ORDER BY patients.id ASC (documented in export_info.csv). Same patient always gets the same ordinal within one export.
Each carer/observer membership (tenant_memberships where role ≠ admin)Carer One, Carer Two, …Stable order: e.g. joined_at ASC, then user_id.
Each account administratorAdministrator One, Administrator Two, …Stable order among role = admin memberships.

Exports use these labels in CSV and README (e.g. recipient_label: Patient One). Format v2.1 does not include internal database IDs, tenant_id, or ID→ordinal maps — ordinals appear only in CSV columns.

Export format v2.1 (shipped 2026-05-28). User-facing personal archive — not a database mirror. Implementation: backend/services/export_v2.py (builders), tenant_export_service.py (ZIP orchestration).

v2 category keyContents
recipientsCare profiles (birth year, summary; address field shows suppression label only)
teamCurrent members only (role, masked email, joined date) — pending invitations excluded
medicinesFlat dose_records + readable dose_schedules (medicine and reason names, not IDs)
scheduleMerged calendar_events (shifts, tasks, appointments)
prescriptionsScripts + separate prescription_fills table
symptomsPain entries (region label + severity — no map coordinates)
vitalsreadings
sleepsleep_records
contactsKey contacts + notes
help_boardHelp requests (type name, not ID)
observationsReadings with observation type name
accountTimezone, status, human-readable enabled modules

Excluded from export (product decision): shopping lists, mind & wellbeing, care alerts (platform-generated), notification-engine toggles, ACL/care-group tables, internal FK IDs, UI config (color_hex, sort_order, dedup_key, etc.).

ZIP layout (CSV only): README.txt, export_info.csv (format_version 2.1, export time, selected categories), {category}-{table}.csv for each selected category (e.g. recipients-care_recipients.csv, team-members.csv). No JSON data files. Legacy v1 category keys in API requests are mapped to v2 keys; removed v1 keys (shopping, mind, care_alerts) are ignored.

Email, address, and contact masking (mandatory).

  • Never export a full email address, password hash, refresh token, Stripe customer id, email_idx, or other authentication secrets.
  • Never export a physical street address in plaintext. When a stored address would appear (care recipient profile, appointment location, key contact), export the literal label address suppressed for privacy reasons instead (export_address() in export_privacy.py). Empty/null addresses are omitted.
  • Email display in export (members, invitation audit rows, etc.): mask the local part as first five characters + literal *** + last five characters of the local part, then @domain.tld unchanged.
    Example: alexandra.smith@example.com → alexa***smith@example.com (first 5 = alexa, last 5 of local part = smith).
  • If the local part has fewer than eleven characters, export ***@domain.tld only (no partial reveal).
  • Phone numbers: export last four digits only, prefixed *** (e.g. ***1234), or omit entirely — implement as omit in v1 unless product specifies otherwise.
  • Date of birth: export year of birth only (YYYY), not full DOB, unless the tenant admin opts in to full DOB in a later enhancement (default off).

What may appear in plaintext in export.

  • Care clinical content the family entered (medication names, shift notes, pain scores, vitals, etc.) — already known to the exporter.
  • Tier name, export timestamp, timezone, module list, and non-identifying account settings.
  • File attachments (photos, script scans) — filenames must not embed patient or user real names; use ordinal-based paths (files/patient-one/script-scan-001.jpg).

What must never appear.

  • Platform operator notes, other tenants’ data, super-admin fields, or another subscriber’s export.
  • Decrypted medical_summary is allowed (excluded from REQ-ENC-01) but a future product decision may move summary to a separate optional appendix; v1 may include with a manifest warning.

Requirement IDs (billing + platform; verified against codebase 2026-05-28):

IDRequirementStatus
REQ-BILL-16Tenant admin may download a full account export before irreversible cancellation (deletion_choice = immediate) or at any time while the subscription is active. The cancel-subscription dialog must offer Download my data as a distinct action from Confirm cancellation.Done — More → Export data (/admin/export), CancelSubscriptionDialog.tsx Download my data, POST /api/billing/export/download
REQ-BILL-17Export is a single ZIP containing README.txt, export_info.csv, and per-category CSV tables.Partial — v2.1 CSV-only ZIP shipped (12 categories, denormalized payloads). Gaps: no binary attachments (script scans, proof images); categories are admin-selected, not auto-filtered to active modules only
REQ-BILL-18All person references in export content use §4.6 ordinal labels (Patient N, Carer N, Administrator N). No legal names, preferred names, or tenant display names in export payloads or attachment paths.Done — export_v2.py, export_privacy.py; key-contact practitioner names remain (external contacts, not care-circle identity)
REQ-BILL-19Email addresses in export use the §4.6 masking rules only; full emails never appear. Same masking applies to administrator and carer rows in team-members.csv.Done — masked emails in team CSV; audit log rows are not included in the export bundle
REQ-BILL-20Export generation is audited (audit_log: who exported, when; no file body in logs). Rate-limited. Unavailable after purge_tenant_all_data. Export does not cancel the subscription.Done — audit_log VIEW on tenant_export; Redis cap 5/hour per admin; 404 after tenant purge
REQ-BILL-21Subscription cancellation and tenant data purge: POST /api/stripe/cancel-subscription with deletion_choice immediate | anniversary; tenant_deletion_service.purge_tenant_all_data.Done — V061, CancelSubscriptionDialog.tsx (immediate UI only today)
REQ-PLAT-11Import from LynCareOS export format v2.1 into a new empty tenant (new signup). Not required for cancel flow v1. Must not promise re-import in cancel copy until Done.Future

Implementation home: backend/services/export_v2.py, backend/services/tenant_export_service.py, backend/services/export_privacy.py, backend/routers/tenant_export.py, frontend/src/pages/admin/ExportData.tsx, frontend/src/components/CancelSubscriptionDialog.tsx. Cross-reference 24-SUBSCRIPTION-BILLING-AND-TIER-LIMITS.md §4.6.


  • Base path: /api/... — primary path used by the SPA today. Additive /api/v1/... aliases mount the same routers (see §2.2); no breaking removal of unversioned paths yet.
  • OpenAPI: GET /api/docs (Swagger UI); GET /api/redoc.
  • Errors: FastAPI returns {"detail": ...} for 4xx; system errors return a generic 500 (raw DB errors are never exposed to the browser).
  • CORS: ALLOWED_ORIGINS env var; credentials: 'include' for the SPA.
  • Upgrade limit responses: HTTP 402 with a structured body when a tier capacity limit is reached; the frontend renders <UpgradeGate> at this point.

IDRequirementStatus
NFR-1 Mobile-first UITouch-first layouts; minimum 44×44 pt targets; all primary flows usable on a phone.Met — Tailwind responsive layout, mobile bottom nav, safe-area support.
NFR-2 Network resilienceGraceful degradation under poor connectivity; 401 triggers silent refresh retry.Partial — 401 auto-refresh in api.ts; syncQueue.ts + Service Worker Background Sync replay dispensing POSTs only (iOS falls back to error toast); no general offline write queue for other clinical mutations.
NFR-3 Consistent contractsAPI and clients share the same field names and types.Met — types maintained manually in lib/api.ts and Pydantic models. Domain types are being progressively extracted to lib/types/<domain>.ts (care.ts done 2026-05-20); CI gate verifies /api/openapi.json remains reachable on every push.
NFR-4 AuditabilityEvery clinical mutation produces an audit row with before/after snapshots; deletes require a reason.Met — audit_log table; V033 audit triggers; audit log viewer.
NFR-5 PerformanceLists and dashboards responsive on typical hardware; chart rendering fast.Target — connection pooling; Redis caching (billing tiers, FX rates, SSE tickets); ECharts for charting; no automated perf budget in CI yet.
NFR-6 AccessibilityKeyboard navigation; non-colour-only state; semantic controls.Partial — Headless UI for dialogs/selects; ongoing improvement expected.
NFR-7 Data securityAuth on protected routes; HTTPS in production; secrets in env; PHI-scoped access.Met — OWASP Top 10:2025 cleared; access token in memory; refresh in HttpOnly cookie; RLS backstop.
NFR-8 Scale readinessArchitecture must accommodate growth without a rewrite.Met — PgBouncer profile, read-replica profile, Redis, scan worker already in docker-compose.yml; 2–5k concurrent on one box; 100k-user ceiling documented in 17-HARDENING-SCALE-RUNBOOK.md.
NFR-9 PrivacyNo PHI in logs; no third-party analytics; data stays in the subscriber’s chosen region. Subscriber data exports follow §4.6 pseudonymization (ordinal labels, masked emails).Partial — operator-blind encryption partial (§4.5); tenant export shipped (REQ-BILL-16..20); T&C export sentence pending counsel (F3.7)
NFR-10 PWA installabilityWeb app installable on mobile home screen; Google OAuth works in standalone mode.Met — PWA auth session handoff implemented for iOS Safari/Chrome PWA flow.
NFR-11 InternationalisationThe app translates its structural frame — all labels, prompts, dropdown options, structured field choices, error messages, and notification templates generated by the platform. User-entered content (care notes, medication names, free-text fields) is stored and displayed exactly as typed, in whatever language the user writes — it is never translated by the platform. Clinical labels default to plain lay-carer language; a user-level clinical terminology toggle switches the interface to precise clinical terms for professional users. Adding a new language or country locale must require only a translation file, a locale config entry, and a Stripe currency/geography configuration — no application code changes. Date, time, and number formats are locale-driven.Partial — I18N-P0 shipped (react-i18next, en-AU bundles); P1 in progress; fr-FR enabled in app. See §7.35.
NFR-12 Layout directionUI layout must use CSS logical properties (start/end rather than left/right) from the first i18n implementation so that RTL locales (Arabic, Hebrew) render correctly without component rewrites. Text input fields must carry dir="auto" so user-typed RTL content (e.g., Arabic notes in an otherwise LTR interface) renders correctly at the browser level.Future — current Tailwind uses physical properties; refactoring required before first non-English locale ships.
NFR-13 Operator-blind identity encryptionThe names and identifying details of care recipients and care circle members (carers, observers) must be encrypted at the application layer before database storage, using per-tenant keys that are not readable by database administrators. The platform must be able to make a verifiable operator-blindness claim in its Terms & Conditions and Privacy Policy — we do not know who is being cared for and we do not know who is doing the caring. See §4.5 for full specification (REQ-ENC-01–06).Partial — V091 applied on production VPS 2026-05-22; plaintext identity columns dropped; email_idx blind index lookups in all auth paths; PHI_* keys pinned. Remaining: per-tenant DEK envelope (REQ-ENC-04), users.full_name/phone and patients.preferred_name encryption, T&C / Privacy Policy operator-blindness claim (REQ-ENC-06). Marketing gate must not be lifted until REQ-ENC-06 is signed off.

Status legend: Done = implemented end-to-end for the web app. Partial = exists but incomplete vs ideal. Future = not implemented.

IDRequirementStatus
REQ-AUTH-01Register with username, email, password; validations (password length, email format).Done — POST /api/auth/register
REQ-AUTH-02Login with username or email + password; JWT access + refresh token pair.Done — POST /api/auth/login, POST /api/auth/refresh
REQ-AUTH-03Google OAuth sign-in in the SPA (redirect flow) and on the marketing signup modal (popup flow).Done — POST /api/auth/google; GoogleSignInButton.tsx; GOOGLE_CLIENT_ID
REQ-AUTH-04Current user profile — GET /api/auth/me.Done
REQ-AUTH-05First-install bootstrap / super-admin seeding via seed_admin.py and environment.Done
REQ-AUTH-06Tenant membership; invited users pending approval; admin approval updates users and tenant_memberships consistently.Done — routers/auth.py, routers/users.py
REQ-AUTH-07Invitation tokens: create, validate, single-use, expiry; admin can invite admin-level members.Done — invitations table + routes; V044 widens role CHECK
REQ-AUTH-08Multi-factor authentication (TOTP); secrets AES-GCM encrypted at rest.Done — migration V035 (enrolment), V038 (encryption); backend/services/crypto.py
REQ-AUTH-09PWA Google OAuth session handoff for iOS Safari.Done — routers/pwa_auth.py, services/pwa_auth_service.py
REQ-AUTH-10Idle session warning before token expiry.Done — IdleWarningModal.tsx
REQ-AUTH-11Invite-only registration mode: a platform-level setting (controlled by super-admin, not per-tenant) that disables the public self-serve registration form and the Stripe Checkout signup path. When active: (a) the marketing signup modal and /register page display an “access by invitation only” message with no registration form; (b) new subscribers can only gain access via a direct invitation link issued by a super-admin or, when implemented, a country operator (REQ-I18N-14); (c) existing subscribers and invited pending-approval users are unaffected; (d) the setting is controlled via an environment variable (INVITE_ONLY_REGISTRATION=true) so it can be applied at the Docker level without a code release. Use cases: private beta control, gated country-operator market launches, enterprise deployments where subscriber acquisition is managed outside the platform.Future/policy — environment variable not yet implemented; current default is open registration.
REQ-AUTH-12Multi-tenant user model. A LynCareOS login is a single global identity (users row, unique email_idx); the same person may own and/or be a member of multiple tenants simultaneously. (a) When a logged-in user initiates a paid subscription via the marketing signup flow or via an in-app “Create another care account” action, the system reuses their existing users row and creates a new tenant with a new tenant_memberships row at role admin and a new stripe_customer_id. (b) The marketing signup form, on detecting an existing email via email_idx, branches to a “sign in to set up a new care account” path rather than returning HTTP 409. (c) Each tenant retains its own billing email, payment method, and subscription lifecycle; deletions and removals on one tenant never affect membership or admin role on any other tenant. (d) Roles (admin, member) are scoped per tenant_memberships row — being a member of one tenant places no constraint on being admin of another. (e) When INVITE_ONLY_REGISTRATION (REQ-AUTH-11) is active, both new-tenant creation paths are disabled along with the standard signup.Done — Phase E / F1.5: POST /api/stripe/start-additional-tenant, _provision_additional_tenant, marketing existing_user branch, CreateAnotherAccountPanel, BillingSuccess?additional=1
REQ-AUTH-13Active tenant in session. When a user belongs to more than one tenant, the system: (a) carries the active tenant as tid in the JWT pair (already present today; behaviour change is selection logic, not schema); (b) on first multi-tenant login, defaults tid to the most recently joined active membership and persists last-used tenant for subsequent logins; (c) exposes a tenant chooser in the application chrome (header / settings menu) that calls POST /api/auth/switch-tenant { tenant_id } to re-issue the JWT pair for the selected tenant; (d) all require_tenant_member / require_module checks apply against the active tid only — exactly one tid is in flight at any time; (e) the frontend tenant switch must invalidate all per-tenant client caches (TanStack Query, AuthContext) before applying the new tokens so cross-tenant data cannot leak through stale state.Done — users.last_active_tenant_id (V095), GET /api/auth/my-tenants, POST /api/auth/switch-tenant, TenantSwitcher in mobile + desktop chrome; full page reload clears client state (no TanStack Query in repo)

7.2 Subscription billing and tier management

Section titled “7.2 Subscription billing and tier management”
IDRequirementStatus
REQ-BILL-01Three annual subscription tiers (Essential / Family / Complete) with USD and per-currency pricing.Done — backend/billing/tiers.json; stripe_tiers + stripe_tier_local_prices tables
REQ-BILL-02Stripe Checkout signup flow: credentials first → Checkout → webhook provisions account; pending_signups table.Done — routers/stripe.py, services/signup_service.py, services/stripe_provisioning.py
REQ-BILL-03Google OAuth signup path through Stripe Checkout (no password).Done — POST /api/stripe/start-signup-google; migration V045
REQ-BILL-04WelcomeModal on post-payment redirect; masked-password receipt or “Signed in with Google” pill.Done — pages/BillingSuccess.tsx, components/WelcomeModal.tsx
REQ-BILL-05Self-serve tier upgrade: pay only the prorated difference; annual anniversary resets on upgrade.Done — POST /api/stripe/upgrade-tier; prorated coupon in billing currency
REQ-BILL-06Downgrade at renewal: pending_downgrade_to_tier_slug / pending_downgrade_effective_at on tenant row.Removed — V047 added the columns; V049__remove_pending_downgrade_columns.sql removed them. No POST/DELETE /api/stripe/schedule-downgrade endpoint exists in routers/stripe.py. CancelSubscriptionDialog.tsx performs immediate cancellation only; subscribers downgrade via the Stripe Customer Portal at renewal. Doc 24 §4 is obsolete and is superseded by 24-SUBSCRIPTION-BILLING-AND-TIER-LIMITS.md §4 (rewritten 2026-05-26). Reinstating this requirement requires a fresh migration plus product/UX work — see 04-ROADMAP.md.
REQ-BILL-07Per-person add-on: +$5/yr per extra care recipient; extra_care_recipients column on tenants.Done — tier limits enforce max_care_recipients + extra_care_recipients
REQ-BILL-08Stripe Customer Portal (invoices, payment method management).Done — STRIPE_BILLING_PORTAL_RETURN_URL env var
REQ-BILL-09FX rate preview on the marketing page (/api/billing/fx); Redis-cached 12 h; graceful stale fallback.Done (with known D14 robustness debt — see 32 D14)
REQ-BILL-10Tier capacity limits enforced server-side (HTTP 402); UpgradeGate component in frontend.Done — backend/services/tier_limits.py; backend/billing/tiers.json
REQ-BILL-11Locked modules shown with upgrade CTA (not hidden); ModuleGate + ModuleUpgrade page.Done — ModuleGate.tsx, pages/ModuleUpgrade.tsx
REQ-BILL-12Subscription admin page: view active modules, enable/disable modules, route to upgrade checkout.Done — Settings.tsx subscriptions section
REQ-BILL-13Billing success and upgrade-success post-payment pages; billing cancel page.Done — BillingSuccess.tsx, BillingUpgradeSuccess.tsx, BillingCancel.tsx
REQ-BILL-14Additional care account checkout for existing users (start-additional-tenant / complete-additional-tenant); separate Stripe customer per tenant.Done — Phase E / F1.5; see REQ-AUTH-12
REQ-BILL-15Per-module à la carte add-ons: monthly Stripe subscription line items; add/remove via API; locked-module UX offers tier upgrade or single-module purchase.Done — Phase F2; stripe_module_prices, module_prices.json, add-module / remove-module, ModuleUpgrade.tsx, Subscriptions.tsx
REQ-BILL-16Tenant admin can download full account export before cancel; Download my data on cancel dialog (separate from confirm delete).Done — /admin/export, cancel dialog; §4.6
REQ-BILL-17Export ZIP: README.txt, export_info.csv, and per-category CSV tables.Partial — see §4.6 gaps (attachments, module auto-filter)
REQ-BILL-18Export uses Patient One / Carer N / Administrator N ordinals — no real names in export files.Done — §4.6
REQ-BILL-19Masked emails only in export (first 5 + *** + last 5 of local part); no secrets.Done — §4.6
REQ-BILL-20Export audited and rate-limited; not available after purge.Done
REQ-BILL-21Cancel subscription + data purge (immediate / anniversary).Done — V061, tenant_deletion_service.py
IDRequirementStatus
REQ-CAL-01Shared care calendar with monthly and weekly grid views.Done — Calendar.tsx, routers/care_shifts.py
REQ-CAL-02Care shifts: create, edit, delete; single / date-range / recurring (weekly, fortnightly); assign carer.Done — recurrence presets implemented; full RRULE Future
REQ-CAL-03Per-shift task checklists with completion state.Done
REQ-CAL-04Coverage gap detection (visual indicator for uncovered periods).Done — CoverageGapChip.tsx
REQ-CAL-05My Schedule (/schedule): agenda-style list of upcoming shifts for the logged-in carer.Done — Schedule.tsx; not in primary nav (direct URL / bookmark)
REQ-CAL-06Clinical appointments: date, time, title, address, arranged-by attribution; linked to calendar date.Done — patient_appointments table; routers/patient_appointments.py
REQ-CAL-07In-app care alert on appointment create/update/delete.Done — alert_service from patient_appointments router
REQ-CAL-08aShift cover request: when a carer assigned to a shift cannot attend, either the carer or an admin can mark the shift as “needs cover”. This sets a visual indicator on the shift chip in the calendar and raises a shared urgent care alert for all eligible carers (patient access, no conflicting shift). Any eligible carer can volunteer from the alert or shift chip. The admin reviews volunteers and confirms a replacement; on confirmation the original carer is removed, the new carer is assigned, resolve/audit entries are written, and confirmation alerts are raised. If no internal cover is found, the admin can escalate to the provider directory (REQ-CAL-08b).Future — builds on care_alerts (Phase 4)
REQ-CAL-08bCare provider directory: a tenant-maintained directory of external professional care service providers — nursing agencies, community care organisations, respite providers, and similar — distinct from the patient-linked Key Contacts module (which holds clinician contacts specific to a patient). Each entry holds: organisation name, service type (nursing agency / community care / respite care / allied health / other), primary contact name, phone, email, and availability or speciality notes. The directory is accessible to the tenant admin from the Settings area and from the cover request flow when no internal carer is available. It is a plain address book — it does not initiate external communications on behalf of the admin.Future
REQ-CAL-09Full RRULE recurrence for care shifts: extends the current weekly/fortnightly presets to support the full RFC 5545 recurrence rule set. Supported patterns: daily; weekly with any combination of day-of-week selection (e.g., Mon/Wed/Fri); fortnightly; monthly by day-of-month (e.g., “the 15th”) or by day-of-week-in-month (e.g., “third Tuesday”); custom intervals (every N days/weeks/months). End conditions: no end / end after N occurrences / end on a specific date. Edit behaviour: when editing a recurring shift, the user is presented with three options — edit this occurrence only / edit this and all future occurrences / edit the entire series; each option has clear consequences described in the UI (e.g., “This will create an exception for just this date”). Delete behaviour: same three-option pattern. Recurring shift chips on the calendar display a repeat icon to distinguish them from single-occurrence shifts. Recurrence rules are stored as RRULE strings on the care_shifts table; individual occurrence overrides are stored as exception rows referencing the parent series shift_id.Future
REQ-CAL-10Structured shift handover form: at the end of each shift, the departing carer completes a configurable handover covering key clinical domains (pain score, medications given, bowel/bladder output, oral intake, skin check, mood, incidents, urgent flags). The handover record is linked to the outgoing shift and surfaced to the incoming carer. (Needed for UC-03, UC-04, UC-05)Future
REQ-CAL-11Handover acknowledgement: the incoming carer is prompted to read and acknowledge the handover note before their shift begins; acknowledgement timestamped and stored on the shift record.Future
REQ-CAL-12Urgent handover flag: a high-priority flag field on any handover triggers an immediate push notification to the incoming carer and the tenant admin.Future
REQ-CAL-13Shift clinical summary: a read-only auto-populated roll-up of all clinical activity during a shift (medications dispensed, vitals recorded, pain scores logged, observations made) drawn from existing module data and appended to the shift record; no manual entry required.Future
REQ-CAL-14Shift observation notes: a time-ordered log of freeform clinical observations within a shift, distinct from task checklists, accessible to all carers with patient access.Future

7.4 Medication dispensing (medication_dispensing)

Section titled “7.4 Medication dispensing (medication_dispensing)”
IDRequirementStatus
REQ-MED-01Medicines and reason types CRUD per tenant; active flags; 5-item cap on Essential.Done
REQ-MED-02Manual dose log: date, time, medicine, volume, optional reason, notes.Done
REQ-MED-03PRN (as_needed) medicines.Done
REQ-MED-04Tenant-configurable quick pills on the Log Dose screen.Done — manual_dose_quick_medicine_ids on tenant settings
REQ-MED-05Proof-of-dose photo (optional image attachment).Done — proof_image_url on dispensings; upload/clear API
REQ-MED-06Dose history with filters; edit/delete with audit; deletion requires a reason.Partial — medicine + reason filters render on all tiers in History.tsx; tier gating today only restricts edit/delete controls (historyEditable keyed off prescription_management). Audit + reason-on-delete: Done. Filter-tier gating itself: Future if the spec intent is that Essential users see no filters.
REQ-MED-07Analytics: heatmap, trend, daily summary, by-reason donut, timeline.Done — routers/analytics.py, Analytics.tsx
REQ-MED-08Analytics filters (date range, medicine, carer) gated at Family tier.Partial — date-range and medicine filters in Analytics.tsx; carer filter not built (no carer/user dimension in repositories/analytics.py or any dispensings join). Tier gating uses prescription_management proxy rather than explicit Family/Complete check. Carer filter depends on REQ-MED-13 (carer_id on dispensings).
REQ-MED-09Dashboard: today’s medication summary, overdue count, scheduled doses strip.Done — ScheduledDosesStrip.tsx
REQ-MED-10Medication schedule (/medication-schedule): named groups, scheduled time, week-wide grid.Done — routers/medication_groups.py, MedicationSchedule.tsx
REQ-MED-11Batch dispense (atomic server-side) and batch undo (admin, same-day, unedited).Done
REQ-MED-12Drag-and-drop reorder of schedule items with batch reorder endpoint.Done — @dnd-kit
REQ-MED-14Patient-scoped medicines list. Every medicine list, picker, row matrix, or dropdown displayed to a carer or admin in a patient-scoped page must show only medicines used by the active patient — defined as the union of medicines referenced by the patient’s active scripts, active schedule items, or any dispensing history. The tenant-wide medicines table remains the storage model; this is a read-path filter delivered as GET /api/patients/{patient_id}/medicines guarded by require_patient_access. The legacy GET /api/medicines endpoint is retained for catalogue-management entry points behind a visible “Tenant catalogue” badge, admin-only. No carer-facing flow may display medicines outside the active patient’s usage set. Plan: docs/plans/2026-05-29-medicine-row-source-fix.md.Done — backend/repositories/medicines.py, backend/services/medicines_service.py, routers/medicines.py; frontend lib/api.ts + Schedule/LogDose/Dashboard/History/Settings pages
REQ-MED-15Active-patient isolation for all aggregate and exported data. REQ-MED-14 scoped medicine pickers; REQ-MED-15 extends the same rule to every surface that aggregates, charts, counts, exports, or audits clinical data. When a person is selected in PatientContext, only that person’s data may be viewed or exported — no chart, heatmap, donut, trend, alert badge/inbox, export ZIP, or audit row may include another patient’s data. Backend: every dispensing-analytics endpoint (/api/analytics/*), /api/alerts + /api/alerts/open-count, /api/billing/export/download, and /api/audit accept an optional patient_id validated by ensure_patient_access; carer-facing SPA pages always send the active patient id and re-fetch on switch. Export is per-selected-person (the full-account ZIP remains only for the account-cancellation portability flow). The audit tab defaults to the selected person with an admin “All people” toggle (audit_log.patient_id, migration V099). dispensings.patient_id (V039, NOT NULL) is the canonical filter. Plan: docs/plans/2026-05-29-active-patient-isolation-sweep.md. Regression: backend/tests/test_patient_analytics_isolation.py.Done
REQ-MED-13Dispensing carer attribution and shift linkage: every dispensing record carries a carer_id (the user who logged the dose) and an optional shift_id. When a carer logs a dose while an active shift is in progress (i.e., the current time falls within a shift assigned to them), the current shift’s shift_id is automatically populated on the dispensing record — no manual selection required. When logged outside an active shift, shift_id remains null. The dose history list displays the carer’s display name on every row. Where a shift_id is present, the associated shift date and time slot are shown alongside the carer name to provide full traceability (“Given by Sarah during Mon 9am–3pm shift”). The shift clinical summary (REQ-CAL-13) reads shift_id-filtered dispensing records to auto-populate its medications section. Admin analytics (REQ-MED-07, REQ-MED-08) can filter and group dose history by carer. carer_id for existing historical dispensings must be backfilled from audit_log.performed_by where available.Partial — patient_id and script_id on dispensings present; carer_id and shift_id columns are Future
REQ-MED-16First-dose adverse reaction check. When a patient receives a medicine for the first time (first dispensings row for that patient + normalized medicine name, excluding pharmacy fills), the dispensing carer sees an immediate prompt: “Has there been any observable adverse reaction after this medicine was given?” with No — no adverse reaction seen and Yes — I noticed a reaction (reaction requires a short note). The same event raises a shared care alert (first_dose_reaction) visible to all carers with patient access so the team is notified even if the dispensing carer skips the prompt. Alerts cannot be marked Done without answering via the structured response flow. Answering No records adverse_reaction_observed = false on patient_medicine_first_dose_checks and never prompts again for that patient + medicine. Answering Yes records the observation, resolves the first_dose_reaction alert, raises an urgent team alert (adverse_reaction_reported), shows AdverseReactionDetailModal (exact note + Seek medical advice.), lists clinical Key Contacts by role (GP, Specialist, Palliative Specialist, Nurse, Pharmacist) with Call/Email when phone or email is present, and appends a coral-highlighted row to Dispensing and Adverse Reactions History Log (/history). Applies to manual log-dose and auto-dispense (single + batch). Migration V004; Key Contacts role palliative_specialist in V005.Done — first_dose_reaction_service.py, alert_service.alert_adverse_reaction_reported, FirstDoseReactionModal.tsx, AdverseReactionDetailModal.tsx, lib/contactRoles.ts, History.tsx, AlertRow.tsx
REQ-MED-17PRN and ongoing response capture (Future). Extend post-dose documentation beyond first-dose checks: optional PRN effectiveness follow-up (30–60 min), structured response chips per archetype, and linkage to clinical_episodes for serious events. See Palliative Care Archetypes §5.5.1.Future

7.5 Prescription management (prescription_management)

Section titled “7.5 Prescription management (prescription_management)”
IDRequirementStatus
REQ-SCRIP-01AI scan using LM Studio (Qwen2.5-VL, server-side); extract structured fields via SSE stream.Done — POST .../scripts/scan; services/lmstudio.py; scan_worker process
REQ-SCRIP-02Review/correct extracted fields before saving; scan does not persist a script row.Done
REQ-SCRIP-03Image stored with EXIF stripped; viewable in script detail.Done
REQ-SCRIP-04Tenant + patient scope; patient_access enforced.Done
REQ-SCRIP-05Fill tracking: record fills; fills vs authorised count.Done
REQ-SCRIP-06Stock on hand derived (fills × qty + stock_adjustment − dispensings by script_id).Done
REQ-SCRIP-07Dashboard alert banners for low stock and expiry-approaching.Done — tap-through to script detail
REQ-SCRIP-08Lifecycle statuses: active, paused, exhausted, expired, superseded, archived.Done
REQ-SCRIP-09Medicine summary: aggregated view across multiple scripts for the same medicine.Done — GET .../scripts/medicine-summary
REQ-SCRIP-10Scan worker: prescription scans run in a separate scan_worker process, not blocking API workers.Done — backend/workers/scan_worker.py
IDRequirementStatus
REQ-SLEEP-01Read/write sleep intervals per patient; 24-hour clock — press-and-rotate to select half-hour periods.Done — routers/sleep.py, SleepPattern.tsx, SleepDayClock.tsx. The manual “Fell asleep / Woke up” exact-time entry form (SleepPeriodAddForm.tsx) was removed 2026-07-29 — it silently failed to save any period crossing midnight (the default, most common overnight case), since addPeriod rejected end <= start on a single-day slot model, and it duplicated what the clock dial already does.
REQ-SLEEP-02Monthly calendar strip with total hours/percentage per day; selecting a day loads that day’s clock.Done — SleepMonthOverview.tsx, SleepInlineCalendar.tsx
REQ-SLEEP-0310-day trailing rolling average trend for bedtime and wake time; contiguous-block merge with ≤ 30-minute gap tolerance; curves clipped at the last day with logged sleep.Not currently surfaced in the UI — frontend/src/lib/sleepTrendHelpers.ts still implements the calculation (with tests), but its only renderer (SleepGrid.tsx) was legacy/unreferenced code removed 2026-07-28. Needs a reconciliation-doc decision: re-wire onto the new clock view, or formally retire.
REQ-SLEEP-04Observer read-only; carers/admins can write.Done — require_carer_role on write endpoints
IDRequirementStatus
REQ-VITALS-01Dedicated /vitals page; log pulse (bpm), SpO₂ (%), temperature (°C/°F).Done — routers/vitals.py, VitalsTracking.tsx
REQ-VITALS-02Multiple readings per day with HH:MM timestamp; partial-unique index prevents duplicate entries at same minute per vital type.Done
REQ-VITALS-03Five-tier clinical status classification (Normal → Critical) based on internationally recognised adult resting-value reference ranges; not jurisdiction-specific clinical advice.Done — VitalsBar.tsx; thresholds in VitalsTrendChart.tsx
REQ-VITALS-04Date navigation; observers view only; carers/admins can write.Done
REQ-VITALS-05Vitals embedded in Pain & Stats page for Complete-tier users.Done
REQ-VITALS-06Expanded vital sign types: respiratory rate (breaths/min), blood glucose (mmol/L or mg/dL), weight (kg), oxygen supplementation flow rate (L/min), seizure count per day. Clinical status thresholds and VitalsBar classification defined for each new type. (Needed for UC-02, UC-04)Future
REQ-VITALS-07Context note on vital readings: a freeform field on any reading capturing clinical context (e.g., “post-physiotherapy”, “during active respiratory infection”).Future
REQ-VITALS-08Configurable alert thresholds per patient per vital type: when a reading crosses the defined threshold, a push notification is sent to all carers with active patient access.Future
IDRequirementStatus
REQ-CONTACTS-01Per-patient contact directory with full contact fields and role tags.Done — routers/key_contacts.py, KeyContacts.tsx
REQ-CONTACTS-02Emergency contact flag; quick-dial widget on dashboard (up to 4 contacts).Done — GET /contacts/emergency; KeyContacts.tsx
REQ-CONTACTS-03Communication notes per contact: direction, channel, priority, follow-up date, author, timestamp.Done
REQ-CONTACTS-04File attachments on notes (PDF, JPEG, PNG, WEBP, DOC, DOCX, up to 20 MB).Done — UPLOADS_DIR/contact_attachments/
REQ-CONTACTS-05Module enabled on Family and Complete; write access for carers/admins; observers read-only via patient_access.Done — require_module("key_contacts") + require_carer_role on writes
REQ-CONTACTS-06MDT team view: contacts tagged as multidisciplinary team (MDT) members are surfaced in a dedicated MDT panel on the patient profile, showing role, visiting schedule, and next appointment date alongside their contact details. (Needed for UC-04, UC-06)Future
REQ-CONTACTS-07Appointment linkage: MDT contacts can be linked to patient_appointments records so appointment cards display the clinician’s contact details inline without the user needing to navigate away.Future
REQ-CONTACTS-08Escalation protocol per contact: structured “call when” conditions (e.g., “pain > 7 unresponsive to PRN for 30 minutes”, “temperature > 38.5°C”) linked to a specific contact; conditions are displayed on the dashboard emergency strip alongside the quick-dial button.Future
IDRequirementStatus
REQ-SHOP-01Patient shopping lists; multiple lists per care recipient; catalog and custom items.Done — routers/shopping.py, services/shopping_service.py
REQ-SHOP-02Item states (active/purchased); recurring items; daily reset job at 06:00.Done — services/scheduler.py APScheduler job
REQ-SHOP-03Real-time sync via Server-Sent Events; Redis-backed SSE tickets (anti-replay).Done
REQ-SHOP-04Shopping shift widget and dashboard widget.Partial — ShoppingDashboardWidget.tsx wired into Dashboard.tsx (2026-05-20, behind shopping module gate). ShoppingShiftWidget.tsx implemented but not imported anywhere in frontend/src/pages/; verified 2026-05-26 — needs explicit import into Calendar shift detail.
REQ-SHOP-05Super-admin: global catalog CRUD and user suggestion queue.Done — routers/admin_shopping.py, ShoppingCatalogAdmin.tsx
IDRequirementStatus
REQ-PAIN-01Body map: polygon zone system, pain level 0–10 per region; hotspot coordinate storage.Done — BodyMap.tsx, routers/pain.py, repositories/pain.py
REQ-PAIN-02Pain history navigation; carry-forward from prior day; 30-day trend per region.Done
REQ-PAIN-03Mind assessment: 7 clinical domains (0–4 each); one per patient per day (upsert).Done — routers/mind.py, services/mind_service.py
REQ-PAIN-0430-day trend charts: body (per region), mind (per domain), vitals (min/max band with scatter).Done — PainTrendChart.tsx, MindTrendChart.tsx, VitalsTrendChart.tsx
REQ-PAIN-05Tenant module settings (enable/disable pillars, module label, standalone flag).Done — tenant_pain_settings table; routers/pain_settings.py
REQ-PAIN-06Calibration tooling for body map polygon zones (user ID 1 only; all environments).Done — calibration overlay, 8-handle editing, Group Transform, bake + copy
REQ-PAIN-07Symptom burden score: a configurable composite daily score computed from peak body pain, mind assessment total, sleep quality (hours from sleep module), and vitals status classification; tracked longitudinally and plotted on the trend view as a daily burden index line. (Needed for UC-03, UC-04)Future
REQ-PAIN-08Functional decline markers: structured daily observations on mobility (independent/assisted/dependent), feeding method (oral/PEG/NG), communication energy (full/reduced/minimal), and continence; scores aggregated into a functional status index and trended over time alongside clinical domain scores.Future
REQ-PAIN-09Cross-domain trend view: a configurable chart showing up to 4 metrics from different modules (e.g., peak daily pain + average sleep hours + functional index + oral intake %) on a shared 30–90 day timeline; user-selectable domain combination.Future
REQ-PAIN-10Deterioration detection alert: when trend analysis detects worsening across two or more tracked domains over a configurable window (7/14/30 days), a dashboard badge appears on the Pain & Stats widget and an optional push notification is sent to the tenant admin.Future
REQ-PAIN-11Skeleton body view — add a fourth pill to the pain body map selector: [Front] [Back] [Skeleton] [Mind]. The skeleton view displays a simplified anatomical bone diagram (front-facing) with 15 tappable bone regions: skull, cervical spine, thoracic spine, lumbar/sacral spine, ribs (L/R), sternum, shoulders (L/R), upper arms (L/R), forearms (L/R), pelvis, hip joints (L/R), thighs (L/R), lower legs (L/R). Tapping a region opens the same intensity picker used on the soft-tissue body map. Entries stored as patient_pain_entries with body_layer = 'skeleton' discriminator column (migration adds column with DEFAULT 'surface'). Bone pain overlay uses the same warm-to-red heat scale as the existing map. Relevant to cancer bone metastases, multiple myeloma, osteoporosis, and Archetypes A, E, G.Done — V082/V092; SkeletonBodyMap.tsx. Implementation note: shipped UI uses three pills — [Body] [Bone] [Mind] — with front/back as a sub-toggle inside the Body map; equivalent function to the four-pill spec but a different selector layout. body_layer writes use front-skeleton / back-skeleton (V092). Layer-separation hardening 2026-05-28: GET /pain now returns body_layer (regression test added); PainBodyMapTab filters map entries by active layer so body and bone dots never co-render; entries list split into “Body Pain” + “Bone Pain” sections via PainEntrySection; carry-forward preserves body_layer; Body ⇄ Bone view transition cross-fades over ~300 ms. See 26-PAIN-STATS-MODULE.md §4.1 Layer separation.
REQ-PAIN-12Body map observation layers — the body map canvas supports switchable overlay layers beyond pain: stiffness (warm orange scale, Archetypes C/E), skin/pressure areas (purple scale, Archetypes C/F/G), and swelling/fluid accumulation (blue scale, Archetypes D/G). Layer selector is a secondary row of pills within the body map component. Each layer writes to patient_observations (REQ-OBS-01 §7.37) with a specific observation_type_id linked to the tapped body region and intensity — not to patient_pain_entries.Future — secondary observation-layer pills not yet implemented; PainBodyMapTab.tsx does not write to patient_observations. (Note: 04-ROADMAP.md Phase C8 previously claimed this Complete; corrected 2026-05-26.)
IDRequirementStatus
REQ-ALERT-01Shared alert queue: one open row per real-world issue (dedup_key); visible to all carers and admins with patient_access (not per-user fan-out).Done — care_alerts (V073), repositories/alerts.py, services/alert_service.py
REQ-ALERT-02Alert inbox in chrome: list open alerts, resolve with optional note, open-count badge (PWA Badging API).Done — AlertBell.tsx, AlertInbox.tsx, AlertRow.tsx, GET/POST /api/alerts/*
REQ-ALERT-03Resolve audit trail: who resolved which alert and when (care_alert_events).Done — POST /api/alerts/{id}/resolve, GET /api/alerts/{id}/events
REQ-ALERT-04Per-channel tenant alert settings (master switch + nine channels, incl. family help). Future (V115): tenth channel planning_ahead for Care Pathways stage acknowledge + undo (REQ-PATH-25).Done — tenant_notification_settings (V063 + V093), /admin/alert-settings, AlertSettings.tsx
REQ-ALERT-05Event triggers: shift reminder (24h), shift cancelled, calendar events, handover notes, shopping, high pain, elevated mind, overdue dose (hourly sweep on real medication_groups / dispensings), family help create/take, first-dose adverse reaction check (REQ-MED-16), adverse reaction reported (adverse_reaction_reported, urgent, on first-dose Yes); auto-resolve overdue alert after dispense; auto-resolve shopping alert when no active items remain. First-dose alerts require structured Yes/No response — generic resolve is blocked. Overdue dose: one consolidated open alert per patient per day with miss_count (V100 metadata), not one row per medication group. Shopping: one consolidated open alert per patient with item_count (V100 metadata), not one row per list item. Future (D31): pathway_stage_acknowledged and pathway_stage_undone on human stage placement change only (REQ-PATH-25).Done — alert_service, alert_scheduler, alert_dose_sync, alert_dose_helpers, alert_dose_hooks, alert_shopping_sync, alert_shopping_helpers, shopping_service, help_requests_service, first_dose_reaction_service
REQ-ALERT-06Web Push (VAPID) and per-device subscribe flow.Removed — replaced by in-app alerts + icon badge; legacy push_subscriptions / user_notifications tables retained but unused
REQ-ALERT-07Observers may view the shared alert queue but cannot resolve alerts.Done — routers/alerts.py _require_can_resolve; tests/test_alerts.py
REQ-NOTIF-01–04(superseded by REQ-ALERT-01–05)Retired — see §7.11 above
IDRequirementStatus
REQ-ONBOARD-01Getting Started checklist with 8 steps; progress tracked per tenant in tenant_onboarding_progress.Done — routers/onboarding.py, GettingStarted.tsx
REQ-ONBOARD-02Progress badge on the More page until all steps complete.Done — More.tsx
REQ-ONBOARD-03Post-signup redirect to /more?onboarding=1 after Stripe Checkout completes.Done — BillingSuccess.tsx → More.tsx
REQ-ONBOARD-04PWA install prompt — unified iOS and Android. After a user’s first successful login on a mobile device, display an install prompt if the app is not already running in standalone/installed mode (detected via window.navigator.standalone === true on iOS and window.matchMedia('(display-mode: standalone)').matches on Android). iOS Safari: show a bottom sheet containing: (a) a push-notification hook headline — “Install LynCareOS to receive shift alerts, handover notifications, and urgent care events. Push notifications only work when the app is installed to your home screen”; (b) three numbered visual steps using the rendered iOS Share button icon (provided as an inline SVG matching the native icon so users recognise it immediately) — Step 1: “Tap the Share icon in your browser bar”, Step 2: “Scroll the menu and tap ‘Add to Home Screen’”, Step 3: “Tap ‘Add’ to confirm”; (c) two buttons — “I’ve added it” (permanent dismiss) and “Remind me later” (7-day snooze). iOS does not expose a programmatic install API; this is a guided instruction UI only. Android Chrome: at application startup, listen for the beforeinstallprompt event and call event.preventDefault() to suppress the browser’s automatic banner; hold the event reference in module scope. On the dashboard (after first login), display a contextual install banner that triggers the native Android install dialog via deferredPrompt.prompt() on user tap. Await deferredPrompt.userChoice: on ‘accepted’, record permanent dismissal; on ‘dismissed’, apply a 7-day snooze. Listen for the appinstalled window event on both platforms to detect installation and permanently suppress all future prompts. Both platforms: store prompt state in localStorage under lyncare_install_prompt (dismissed permanently, or dismissed timestamp for snooze); never show the prompt while the user is viewing an active shift or any modal; gate the Android install banner on deferredInstallPrompt !== null (the event only fires when the Web App Manifest is valid and includes 192×192 and 512×512 PNG icons — verify manifest completeness as a prerequisite). Declare a local BeforeInstallPromptEvent TypeScript interface in frontend/src/types/pwa.d.ts as this type is not yet in the standard TS DOM lib.Future

7.15 Care Observations (care_observations — Complete)

Section titled “7.15 Care Observations (care_observations — Complete)”

Daily multi-domain clinical observations that fall outside pain scoring, vital signs, and medication logging but are essential for complex home care, particularly in palliative, paediatric, and disability support contexts. This module gives the incoming carer and the multidisciplinary team a single, structured view of the patient’s physical state across the domains most predictive of deterioration. (Primarily driven by UC-04; also needed for UC-02, UC-03, UC-05, UC-06)

IDRequirementStatus
REQ-COBS-01Bowel observation: frequency per day, Bristol stool scale score (1–7), volume estimation (small/medium/large), consistency notes, laxative or enema administered (boolean). One record per patient per day (upsert); date-navigable history.Future
REQ-COBS-02Bladder observation: output volume (ml or estimated), catheter status (IDC/SPC/intermittent/nil), urine colour (clear/yellow/amber/cloudy/blood-stained), UTI suspicion flag. One record per patient per day.Future
REQ-COBS-03Oral intake and nutrition: percentage of meal consumed (0–100%), fluid intake volume (ml), nutrition method (oral/PEG/NG/IV), appetite description (good/fair/poor/refused).Future
REQ-COBS-04Skin integrity check: configurable body sites (sacrum, heels, elbows, shoulders, occiput, custom); status per site (intact/at risk/reddened/blistered/broken/wound); optional photo attachment per site (stored in UPLOADS_DIR); repositioning log entries (time + position used) within the same record.Future
REQ-COBS-05Respiratory observation: secretion level (none/mild/moderate/heavy), cough effort (effective/ineffective/absent), suction required (yes/no), oxygen in use (yes/no), SpO₂ at time of assessment (cross-referenced to patient_vitals entry).Future
REQ-COBS-06Functional status snapshot: mobility level (independent/assisted/hoist-dependent/bed-bound), transfer ability, communication energy (full/reduced/minimal/non-verbal), level of alertness (alert/drowsy/confused/unresponsive). Note: daily self-care independence (bathing, dressing, eating, etc.) is tracked via REQ-OBS-13..17 (observation_types / §3.6) — not this Future snapshot. REQ-COBS-06 remains the optional MDT-oriented bundled functional assessment if built.Future
REQ-COBS-07Observation summary badge on shift cards: when a shift spans a day containing an observation record, a summary badge appears on the shift card; tapping expands the record inline without leaving the calendar.Future
REQ-COBS-08Observation trend charts for key domains: bowel frequency (daily count), oral intake percentage (daily), and functional status score (derived from functional snapshot) plotted over 30 days; surfaced in the Pain & Stats trend view under a new “Function” category tab.Future
REQ-COBS-09Observer read-only; carers and admins can create and edit. No hard-delete — soft-delete only; deletion requires a reason field.Future
REQ-COBS-10Full audit trail on every observation record creation and edit, consistent with REQ-AUD-01.Future

ID note (2026-05-26): these requirements were previously numbered REQ-OBS-01..10 and collided with the REQ-OBS-* IDs in §7.37 (Condition-Specific Observations / custom_observations). Renumbered to REQ-COBS-* (Care Observations) to disambiguate. The shipped custom_observations IDs in §7.37 remain REQ-OBS-*.


7.16 Therapy Records (therapy_records — Complete)

Section titled “7.16 Therapy Records (therapy_records — Complete)”

A session log and between-visit continuity tool for allied health professionals and family carers who carry forward therapy goals between professional visits. Ensures nothing is lost between the physiotherapist’s fortnightly visit and the daily routines the family must maintain. (Needed for UC-04, UC-06)

IDRequirementStatus
REQ-THERAPY-01Therapy session record: date, duration (minutes), therapy type (physiotherapy / occupational therapy / speech therapy / psychology / dietitian / other), conducted by (linked to patient_contacts record or free-text name), session goals addressed (free-text list), patient tolerance (excellent/good/fair/poor), pain during session (0–10), session narrative notes.Future
REQ-THERAPY-02Between-session home program: a structured list of daily or weekly exercises/activities prescribed at a session; items have a name, target frequency (e.g., “3× daily”), and instruction notes; carers log completion per day (date, repetitions completed, tolerance, carer notes).Future
REQ-THERAPY-03Therapy goals: named goals with a target date, therapy type association, and progress status (not started / in progress / achieved / discontinued); attached to the patient record and visible on the therapy session page.Future
REQ-THERAPY-04Calendar integration: completed therapy sessions appear as a distinct event type on the care calendar alongside shifts and appointments.Future
REQ-THERAPY-05Session history: paginated list; filterable by therapy type and date range; carers can view; observers can view.Future
REQ-THERAPY-06Full audit trail on all therapy session records and home program completion entries, consistent with REQ-AUD-01: every create, update, and delete action records the performing user, before/after snapshots, entity type, and timestamp. No hard-delete on therapy session records; soft-delete with reason required.Future
REQ-THERAPY-07Respiratory physiotherapy metrics on session record: Borg dyspnoea score pre-session (0–10) and post-session (0–10), walking distance achieved during session (metres), recovery time post-exercise (minutes), post-exertion SpO₂ nadir (%). Required fields when therapy type is physiotherapy or pulmonary physiotherapy. (UC-07)Future

7.17 Equipment & Supplies Management (equipment_management — Complete)

Section titled “7.17 Equipment & Supplies Management (equipment_management — Complete)”

A register for medical and assistive technology equipment items. Distinct from the shopping module (consumables), this tracks durable items with service schedules, funding references, and condition notes. (Needed for UC-04, UC-06)

IDRequirementStatus
REQ-EQUIP-01Equipment register per patient: item name, category (wheelchair / hoist / pressure mattress / standing frame / orthotics / communication device / feeding equipment / respiratory / shower/bath aid / other), supplier, model, serial number, acquisition date, next service due date.Future
REQ-EQUIP-02Service schedule and alerts: each item has a service interval (days); when the next service date is within a configurable warning window (default 14 days), a dashboard alert banner appears (same pattern as prescription banners); an optional push notification is sent to the admin.Future
REQ-EQUIP-03Equipment notes log: freeform observations per item (e.g., “right footrest cracked”, “pressure setting adjusted to 8”); date-stamped; author recorded. Multiple notes per item.Future
REQ-EQUIP-04Equipment status: in-use / under-repair / returned / retired; status changes audited. Retired items are soft-deleted and excluded from active views.Future
REQ-EQUIP-05Funding reference: optional funding source (free-text — e.g., disability support scheme, pharmaceutical benefits programme, accident compensation scheme, private insurance, self-funded) and a reference number per item for insurance, scheme audit, and funding review purposes. Free-text is used rather than a fixed list to accommodate regional scheme names across jurisdictions (see §1.8).Future
REQ-EQUIP-06Full audit trail on all equipment register mutations, consistent with REQ-AUD-01: every create, update, and status-change action records the performing user, before/after snapshots, entity type, and timestamp. No hard-delete on equipment records; retire rather than delete.Future

7.18 Goals of Care & Advance Care Planning (goals_of_care — Complete)

Section titled “7.18 Goals of Care & Advance Care Planning (goals_of_care — Complete)”

A structured, version-controlled record of the patient’s advance care wishes, escalation preferences, and comfort goals. The most safety-critical module in the platform — the document every carer needs to be able to find at 3am. (Needed for UC-03, UC-04; relevant for UC-06)

IDRequirementStatus
REQ-GOC-01Goals of care document per patient: primary care goal (comfort-focused / condition-directed / life-prolonging / undecided); hospital transfer preference (always transfer / transfer for reversible conditions only / prefer home / do not transfer); resuscitation status (for resuscitation / not for resuscitation / family to decide at time); name and role of the clinician who discussed and documented the plan; date of documentation.Future
REQ-GOC-02Escalation protocol: a structured “what to do if…” plan with up to 10 configurable trigger conditions (free-text condition description) each mapped to a named action (e.g., “call palliative nurse on-call”, “administer PRN midazolam as prescribed”, “call local emergency services”). Actions are free-text so families use the correct terminology for their region (see §1.8). Conditions displayed in priority order.Future
REQ-GOC-03Immutable versioning: a new document supersedes rather than overwrites the previous; the full version history is accessible to admin; superseded documents are never deleted.Future
REQ-GOC-04Family understanding field: a field on each document noting whether the patient and/or guardians have been briefed on the current plan and the family’s understanding rating (well understood / partially understood / not yet discussed).Future
REQ-GOC-05Dashboard prominence: the current resuscitation status and hospital transfer preference are displayed as a persistent banner on the patient’s dashboard when a document exists; visible to all carers with patient access regardless of time of day or device.Future
REQ-GOC-06File attachments: PDF copies of signed advance care directives, enduring power of guardianship, enduring power of attorney, or other legal documents can be attached; stored in UPLOADS_DIR/goals_of_care/; served via authenticated download only.Future
REQ-GOC-07Access control: all carers and observers with patient access can view the current document and escalation protocol; only admin-role users can create or supersede a goals of care document.Future
REQ-GOC-08Full audit trail on all goals of care record creations and supersessions, consistent with REQ-AUD-01: append-only; no update or delete on goals of care audit rows. Because the document itself is already immutable and versioned (REQ-GOC-03), the audit entry must additionally record the supersession reason and the user who authorised the change.Future
REQ-GOC-09ICU admission preference: explicitly preferred / acceptable if reversible cause / not preferred. Distinct from hospital transfer preference — a patient may accept a hospital admission but explicitly not want ICU escalation. (UC-07)Future
REQ-GOC-10Intubation and mechanical ventilation preference: acceptable / not preferred / only as bridge to recovery / family to decide at time. Distinct from resuscitation status. (UC-07)Future
REQ-GOC-11Non-invasive ventilation (NIV/CPAP/BiPAP) preference: trial acceptable / not preferred / already in use for symptom management. (UC-07)Future
REQ-GOC-12Preferred place of care: home / residential aged care / palliative unit / hospital / flexible. (UC-07, UC-08)Future
REQ-GOC-13Preferred place of death: home / residential aged care / palliative unit / hospital / no preference stated. Distinct from preferred place of care. (UC-07, UC-08)Future
REQ-GOC-14Artificial nutrition and hydration preference: PEG/NG feeding tube acceptable / comfort feeding only / IV fluids acceptable / comfort hydration only / family to decide at time. Clinically significant when oral intake deteriorates in dementia or advanced illness. (UC-08)Future
REQ-GOC-15Antibiotic and active treatment preference during infections: treat actively as per standard care / comfort-focused antibiotics only if improving symptoms / comfort care without antibiotics / family to decide at time. (UC-08)Future

7.19 Clinical Episodes (clinical_episodes — Complete)

Section titled “7.19 Clinical Episodes (clinical_episodes — Complete)”

A structured event log for significant clinical incidents — hospitalisations, serious infections, pain crises, falls, or other acute episodes — that form the episodic backbone of the longitudinal care narrative and are essential context for any specialist review. (Needed for UC-02, UC-03, UC-04)

IDRequirementStatus
REQ-EPI-01Episode record: episode type (hospitalisation / UTI / chest infection / wound infection / pain crisis / seizure / fall / skin breakdown / behavioural crisis / other); start date; end date (or ongoing flag); location (home / named hospital or clinic / other); outcome (resolved / ongoing / died); narrative notes.Future
REQ-EPI-02Episode trigger and resolution: structured fields for the identified trigger (e.g., “prolonged sitting without repositioning”), interventions applied, and resolution outcome notes.Future
REQ-EPI-03Medication change linkage: medications added, changed, or discontinued in direct response to an episode can be flagged as episode-linked in the dispensing log and medication schedule, creating a traceable cause-and-effect record.Future
REQ-EPI-04Episode timeline view: a visual chronological timeline of all episodes for a patient, navigable by year, with event chips coloured by episode type; displayable as a standalone view and embeddable in the care intelligence summary.Future
REQ-EPI-05Episode frequency analytics: automated counts of episode types over configurable periods (monthly, quarterly); surfaced in the care intelligence view as frequency trend lines.Future
REQ-EPI-06Readmission flag: if a new “hospitalisation” episode begins within 28 days of a previous hospitalisation discharge date, a dashboard alert is shown to the admin.Future
REQ-EPI-07Full audit trail on all episode record mutations, consistent with REQ-AUD-01: every create, update, and soft-delete action records the performing user, before/after snapshots, entity type, and timestamp. No hard-delete on episode records — soft-delete with reason required. Episode records must not be permanently removed as they form part of the longitudinal clinical history.Future

7.20 Caregiver Wellbeing (caregiver_wellbeing — Complete)

Section titled “7.20 Caregiver Wellbeing (caregiver_wellbeing — Complete)”

Tools for monitoring and protecting the sustainability of the care team. Caregiver fatigue is a primary systemic risk in family-delivered complex care, and its absence from clinical records means it is typically invisible until it becomes a crisis. (Needed for UC-03, UC-04, UC-05)

IDRequirementStatus
REQ-CW-01Carer self-report: any carer can log a post-shift wellbeing check-in (overall energy 0–10, stress level 0–10, rest hours in last 24h, optional freeform note). Check-in data is private to the individual carer by default; the admin sees only aggregated team data — never individual entries without explicit carer consent.Future
REQ-CW-02Consecutive shift alert: when a carer has completed shifts on 5 or more consecutive calendar days with no gap, the admin receives a push notification and a dashboard badge identifies the carer at potential fatigue risk.Future
REQ-CW-03Respite planning: a respite record per carer (scheduled respite start date, end date, coverage arrangement notes, government-funded flag — disability support scheme or government-funded aged care); respite periods appear in the care calendar as a distinct “respite” type and are excluded from coverage gap calculations.Future
REQ-CW-04Carer hours summary: admin-only view of total care hours delivered per carer per week and per month; breakdown by shift type; exportable as a summary suitable for scheme funding evidence and respite funding applications across jurisdictions (see §1.8 for regional scheme equivalents).Future
REQ-CW-05Team wellbeing indicator: when three or more carers have submitted low self-reports (energy ≤ 3) in a rolling 7-day window, a team-level burnout risk badge appears on the admin dashboard.Future
REQ-CW-06Carer equipment competency record: a structured confirmation that a carer has been shown how to operate specific clinical equipment (O₂ concentrator settings, portable cylinder valve, hoist, suction machine); date of training, trainer name or role, equipment item(s) covered. Required to be on file before a carer works their first solo shift with a patient using that equipment; visible on shift assignment view. (UC-07)Future

7.21 Patient Voice & Social Participation (patient_voice — Complete)

Section titled “7.21 Patient Voice & Social Participation (patient_voice — Complete)”

Enabling the person in care — particularly adolescents and adults with cognitive capacity — to contribute their own perspective to their record, and tracking quality-of-life indicators beyond clinical metrics. (Primarily driven by UC-04; also needed for UC-06)

IDRequirementStatus
REQ-PV-01Patient self-report: a person in care who holds a user account linked to their patient record (via a patient_access row with role self) can log their own pain score, mood rating (0–10), and a daily note. Self-report entries are visually distinguished from carer entries in the pain and mind views.Future
REQ-PV-02Social participation log: a daily or weekly record of social engagement — school or day-programme attendance (full/partial/absent), peer social contact (yes/no), community participation, a brief quality-of-life narrative note. Scores aggregated as a participation index and trended over 30 days.Future
REQ-PV-03Adolescent privacy tier: a patient flagged privacy_sensitive can have specific record types (e.g., psychology session notes, mental health entries) marked restricted_access. Restricted records are visible only to users with an explicit secondary patient_access grant of role clinical — not to all carers holding standard patient access.Future
REQ-PV-04Patient preferences record: a structured preferences document covering preferred name, communication preferences, comfort activities, cultural and spiritual practices, and the patient’s own articulation of “what makes a good day / bad day.” Displayed prominently at the top of the handover form and accessible from the patient profile.Future
REQ-PV-05Carer-proxied entry: when a carer enters data on behalf of the patient (e.g., for patients without motor capacity to self-enter), the entry records entered_by_user_id distinct from the patient user, with a clear “recorded by carer” indicator in the UI.Future

7.22 Longitudinal Care Intelligence (care_intelligence — Complete)

Section titled “7.22 Longitudinal Care Intelligence (care_intelligence — Complete)”

Cross-domain analytics and pattern detection that surfaces clinically meaningful insights from data already captured across all modules. The output is designed to inform MDT review meetings, specialist consultations, and families making difficult decisions about the trajectory of care. (Primarily driven by UC-04; valuable for UC-03, UC-05)

IDRequirementStatus
REQ-CI-01Unified patient timeline: a chronological timeline view of all clinical events (medications, pain scores, vitals, observations, episodes, therapy sessions, appointments) on a shared date axis; filterable by domain category; navigable across the full patient history.Future
REQ-CI-02Multi-domain trend chart: a configurable chart allowing the user to select up to 4 metrics from different modules (e.g., peak daily pain + average sleep hours + functional status index + oral intake %) and plot them on a shared 30–90 day timeline with independent Y-axes.Future
REQ-CI-03Functional decline index: a composite score derived daily from care observations (mobility score + feeding method score + communication energy score + continence flag); plotted as a line chart over time, with direction of change (improving/stable/declining) labelled on the most recent 30-day segment.Future
REQ-CI-04Infection frequency trend: episode records of infection type counted over rolling 30 and 90-day windows; displayed as a frequency chart with a configurable alert threshold that triggers a notification when exceeded.Future
REQ-CI-05MDT-ready care summary report: a formatted, printable/shareable patient summary covering the last 30 or 90 days across all tracked domains — medications, pain trend, functional trajectory, episode log, therapy progress, and social participation — suitable for presenting at an MDT review meeting or specialist consultation.Future
REQ-CI-06Deterioration detection: when trend analysis detects a negative direction across two or more tracked domains (pain, functional index, sleep, weight, oral intake) over a configurable window (7/14/30 days), a deterioration badge appears on the patient dashboard and an optional push notification is sent to the admin.Future

7.25 Respiratory & Oxygen Management (respiratory_oxygen — Complete)

Section titled “7.25 Respiratory & Oxygen Management (respiratory_oxygen — Complete)”

Primary symptom tracking and home oxygen therapy management for respiratory conditions including idiopathic pulmonary fibrosis, chronic obstructive pulmonary disease, and other chronic respiratory diseases. Breathlessness is to the respiratory patient what pain is to the palliative patient — the primary lens through which all other dimensions of wellbeing are understood. This module gives families the tools to track the daily burden, detect decline early, manage equipment, and have a clear plan for when things get worse. (Primarily UC-07; relevant for UC-04 respiratory complications)

IDRequirementStatus
REQ-RO-01MRC Dyspnoea Scale: a periodic or event-driven assessment using the 5-grade MRC scale (Grade 1 — not troubled by breathlessness except on strenuous exercise → Grade 5 — too breathless to leave the house); date, score, assessor (self/carer/clinician); 30/90-day trend view.Future
REQ-RO-02Daily breathlessness log: patient or carer-reported breathlessness at rest (0–10) and on minimal exertion (0–10); breathlessness distress score (0–10 — how frightening or overwhelming it feels, distinct from severity); optional trigger note (walking/showering/eating/talking/dressing/other); date and time.Future
REQ-RO-03Cough symptom tracking: frequency (episodes per hour or per day), severity score (0–10), disruptive to sleep (yes/no), disruptive to eating (yes/no), character (dry/productive); daily entry with 30-day trend.Future
REQ-RO-04Fatigue score: a daily 0–10 fatigue scale as a distinct tracked metric — separate from sleep quality (sleep module) and the mind assessment; 30-day trend.Future
REQ-RO-05Exertional performance log: walking distance (metres), activity performed (walking/showering/dressing/stairs/other), recovery time before breathing settles (minutes), post-exertion SpO₂ nadir (%); date and time-stamped; multiple entries per day; 30/90-day trend of walking distance and recovery time as primary decline indicators.Future
REQ-RO-06Oxygen therapy prescription: a versioned O₂ regime record — prescribed flow rate at rest (L/min), on exertion (L/min), nocturnal (L/min); equipment type in use (stationary concentrator / portable concentrator / liquid oxygen / cylinder / CPAP / BiPAP); created by and date; superseded rather than overwritten when changed; family can see the current prescription at a glance without locating a clinical document.Future
REQ-RO-07Daily O₂ use log: actual hours of oxygen used per day (compliance monitoring); freeform notes; 30-day trend showing prescribed vs actual hours.Future
REQ-RO-08Cylinder stock management: number of full cylinders available; days of supply auto-calculated at current daily use rate; configurable low-stock alert threshold (default: 2 cylinders remaining); low-stock alert appears on the dashboard and triggers push notification to admin; integrates with shopping module as a reorder prompt.Future
REQ-RO-09Equipment safety checklist: a per-patient configurable safety checklist for shifts where O₂ is in use (e.g., “no smoking within 3 metres”, “fire service notified”, “tubing and connections checked”, “spare cylinder accessible”); carers confirm completion at the start of each relevant shift; confirmation timestamped and attributed.Future
REQ-RO-10Breathlessness crisis plan: an operational bedside document — distinct from the Goals of Care ACP — containing numbered action steps for acute breathlessness (e.g., sit upright, fan or airflow, check O₂ tubing and flow setting, administer named PRN medication at named dose, call community palliative nurse, call local emergency services); links to the patient’s current PRN dyspnoea medication record; accessible from the patient dashboard as a prominent quick-access tile; printable as a single page for posting near the bed; version-controlled — any change to the crisis plan or linked PRN medication prompts an admin review notification.Future
REQ-RO-11Trend and deterioration view: respiratory metrics (MRC grade, peak breathlessness score, walking distance, O₂ flow rate, fatigue, recovery time) plotted on a shared timeline; surfaced in the Pain & Stats cross-domain trend chart (REQ-PAIN-09) as a selectable domain.Future
REQ-RO-12Full audit trail on all respiratory and oxygen management records — including MRC assessments, breathlessness logs, oxygen therapy prescriptions, daily use logs, cylinder stock changes, safety checklist completions, and crisis plan versions — consistent with REQ-AUD-01: every create, update, and soft-delete action records the performing user, before/after snapshots, entity type, and timestamp. Oxygen prescriptions and crisis plans are version-controlled (supersede rather than overwrite) as noted in REQ-RO-06 and REQ-RO-10; the audit trail is the secondary record of every such version change.Future

7.26 Behavioural Events (behaviour_tracking — Complete)

Section titled “7.26 Behavioural Events (behaviour_tracking — Complete)”

An event-driven log for behavioural incidents. For dementia and other conditions affecting behaviour and cognition, behaviour IS the primary symptom domain — it is not a side effect of something else. The orientation is entirely family-centric: families need to understand their person, learn what triggers distress, learn what resolves it, and detect whether patterns are changing. This module is the tool that turns weeks of difficult experiences into knowledge. (Primarily UC-08; relevant for UC-04 adolescent behavioural context)

IDRequirementStatus
REQ-BEH-01Behavioural event record: event type (agitation / aggression / wandering / sundowning / paranoia / hallucination / repetitive vocalisation / resistive care / night disturbance / screaming / withdrawal / sexual disinhibition / other); date and time; phase of day (morning routine / mealtime / afternoon / early evening / night).Future
REQ-BEH-02Trigger documentation: structured trigger selection (personal care / unfamiliar carer / noise or overstimulation / being rushed / pain / constipation / suspected infection / fatigue / hunger or thirst / medication effect / unknown / other); optional freeform context note.Future
REQ-BEH-03Severity and duration: severity (mild / moderate / severe); duration in minutes; whether PRN medication was administered (linked to dispensing record if yes).Future
REQ-BEH-04Intervention and outcome: intervention tried (music or familiar sounds / redirection / familiar object / one-to-one calm attention / environmental change / delayed the activity / PRN medication / called another carer / other); outcome (resolved quickly / resolved with time / did not resolve / escalated to call for help).Future
REQ-BEH-05Quick-entry mode: a behavioural event can be logged in under 30 seconds — type (tap), severity (tap), trigger (tap), outcome (tap); time auto-filled from device; narrative note optional. Designed for carers mid-shift who cannot pause for a form.Future
REQ-BEH-06Pattern analysis view: behavioural events shown on a 7-day and 30-day frequency chart per type; filterable by behaviour type, phase of day, and trigger; frequency trend over 30/90 days per type.Future
REQ-BEH-07Trigger learning surface: the most common trigger per behaviour type over the last 30 days is automatically surfaced (“Agitation: most common trigger this month — personal care”); shown on the care protocols page (§7.27) to inform protocol updates.Future
REQ-BEH-08Full audit trail on all behavioural event records, consistent with REQ-AUD-01: every create and update action records the performing user, before/after snapshots, entity type, and timestamp. No hard-delete; soft-delete with reason required. Behavioural event records must not be permanently removed as they are part of the longitudinal care history and may be relevant to future clinical reviews.Future

7.27 Care Protocols & Person-Centred Guide (care_protocols — Complete)

Section titled “7.27 Care Protocols & Person-Centred Guide (care_protocols — Complete)”

A living, family-maintained guide to caring for a specific person — their routines, preferences, triggers, calming strategies, and identity. This is the most distinctly family-centric module in the platform. It captures what a relief carer, an agency nurse, or a sibling coming in for the first time needs to know to care for the person with dignity and competence. It is not a clinical record — it is shared knowledge about a human being. (Primarily UC-08; also valuable for UC-04, UC-06)

IDRequirementStatus
REQ-PROT-01Care protocol record: named protocol with category (morning routine / bathing and personal care / meals and feeding / bedtime routine / behavioural response / mobility and transfers / medication / other); ordered step-by-step instructions; a “what to avoid” section; what tends to work well; date created; author.Future
REQ-PROT-02Person-specific tips field: a “notes to the carer” field within each protocol for the kind of knowledge families accumulate over time — e.g., “Don’t say the word ‘shower’, say ‘warm wash’”, “Always approach from the right side (her good hearing)”, “She responds to being asked to help, not being helped.”Future
REQ-PROT-03Calming strategies list: a dedicated, quickly accessible list of things known to calm or comfort this specific person — music playlists, familiar objects, comfort phrases, activities, sensory inputs, people to call. Displayed prominently during a shift when a behavioural event is active.Future
REQ-PROT-04Familiarity and identity record: important people (names, relationship, optional photo), meaningful places or memories, personal history notes that help carers connect authentically — e.g., “She was a district nurse for 30 years and responds well when you treat her knowledge and history with respect.”Future
REQ-PROT-05Protocol access from shift view: carers can access the care guide from within their active shift without navigating away; newly updated protocols are highlighted at the top of the guide with the date of the change.Future
REQ-PROT-06Handover integration: the handover form (REQ-CAL-10) includes a “Care guide” link for the incoming carer; protocols updated since the last shift are flagged.Future
REQ-PROT-07Protocol change log: every edit to a care protocol records the date, author, and previous content; full version history accessible to admin.Future

7.28 Non-Verbal Pain & Distress Assessment (observational_pain — extension of pain_tracking — Complete)

Section titled “7.28 Non-Verbal Pain & Distress Assessment (observational_pain — extension of pain_tracking — Complete)”

An observational pain assessment tool for people who cannot reliably self-report pain — including people with advanced dementia, severe intellectual disability, reduced consciousness, or significant communication impairment. The body map requires the person to identify and locate pain; this module is for when that is not possible. Pain in a non-communicative person manifests as behaviour: aggression during personal care, withdrawal, grimacing, restlessness. Without a tool to recognise and score this, it goes untreated. (Primarily UC-08)

IDRequirementStatus
REQ-NVPAIN-01Observational pain assessment: a structured carer-scored assessment modelled on validated tools (Abbey Pain Scale / PAINAD); scored observable domains: vocalisation (none / moaning / crying / screaming, 0–3); facial expression (calm / grimacing / frowning / frightened, 0–3); body language (relaxed / tense / guarding / rigid, 0–3); restlessness (none / occasional / frequent / constant, 0–3); consolability (not needed / easily consoled / hard to console / inconsolable, 0–3); physiological indicators (normal / changed breathing / pallor / sweating, 0–3); composite score 0–18; clinical tier label (no pain / mild / moderate / severe) shown alongside the score.Future
REQ-NVPAIN-02Gentle nudge prompt: when a carer logs a behavioural event (REQ-BEH-01) with type aggression, withdrawal, or screaming, the app prompts “Could this be pain? Complete a pain observation?” — one tap to proceed, one tap to dismiss.Future
REQ-NVPAIN-03Daily peak observational score trended over 30 days; surfaced on the Pain & Stats trend view alongside or instead of the body map score, depending on whether the patient has self-report capacity (configured in pain settings).Future
REQ-NVPAIN-04Assessment mode configuration: in patient pain settings, admin configures whether the body map (self-report), the observational assessment, or both are shown; the appropriate tool defaults on the pain page for that patient.Future
REQ-NVPAIN-05Full audit trail on all observational pain assessments, consistent with REQ-AUD-01: every create and update action records the performing user, before/after snapshots, entity type, and timestamp. No hard-delete; corrections must create a new assessment record rather than overwrite the original.Future

7.29 Swallowing Safety (swallowing_safety — Complete)

Section titled “7.29 Swallowing Safety (swallowing_safety — Complete)”

Swallowing assessment and texture modification tracking for patients at risk of dysphagia and aspiration. Swallowing safety is simultaneously a safety-critical concern (preventing aspiration pneumonia) and a dignity concern (every carer must know the correct food and fluid consistency without being told each time). A carer who unknowingly pours a normal glass of water for someone on honey-thick fluids puts the patient at risk. (Primarily UC-08; also relevant for UC-04 neurological conditions)

IDRequirementStatus
REQ-SWALLOW-01Swallowing safety classification: current classification from speech therapy or clinical assessment (safe for normal diet / soft diet required / minced and moist required / pureed required / fluids only — no solids / high aspiration risk — nil by mouth); fluid consistency requirement (normal / nectar-thick / honey-thick / extremely thick / nil oral fluids); feeding assistance level (independent / needs prompting / hand-over-hand guidance / full carer assistance); assessed by and date.Future
REQ-SWALLOW-02Prominent display: current texture classification and fluid consistency displayed prominently on the care observations page, the handover form, and the patient profile — visible without navigating into a swallowing sub-section. A carer should not need to search for this information before preparing a meal.Future
REQ-SWALLOW-03Meal observation log: for each meal — meal type (breakfast/lunch/dinner/snack), coughing during meal (yes/no and frequency count), duration of meal (minutes), percentage consumed, aspiration event (yes/no); date and time-stamped; multiple entries per day.Future
REQ-SWALLOW-04Swallowing deterioration alert: when the classification changes to a higher aspiration risk tier, a push notification is sent to all carers with patient access and the change is noted on the dashboard. Previous classifications are retained in version history.Future
REQ-SWALLOW-05Swallowing history: date-navigable history of classifications and meal observations; classification changes shown as a timeline of increasing restriction.Future
REQ-SWALLOW-06Full audit trail on all swallowing classification records and meal observation logs, consistent with REQ-AUD-01: every create and update action records the performing user, before/after snapshots, entity type, and timestamp. Classification records are immutable once created (changes create new records per REQ-SWALLOW-04); meal observation records support soft-delete with reason required.Future

7.30 Falls Tracking (falls_tracking — Complete)

Section titled “7.30 Falls Tracking (falls_tracking — Complete)”

Individual falls event logging with circumstances, injury assessment, and frequency trending. Falls are one of the most common and consequential events in elderly care, dementia, and neurological conditions. The cumulative picture — falls increasing from 1 per month to 5 per month — is a critical trajectory indicator. Each fall is a discrete event carrying information about what went wrong, not just a number in a monthly tally. (Primarily UC-08; also UC-04, UC-05, UC-07)

IDRequirementStatus
REQ-FALLS-01Falls event record: date and time; location (bedroom / bathroom / hallway / lounge / kitchen / garden / other); circumstances (getting up unassisted / nocturnal toileting attempt / wandering / transferred by carer / standing from chair / tripped / other); who was present (alone / family member / carer); near-miss flag (person caught before hitting the ground).Future
REQ-FALLS-02Injury assessment: injury level (no injury / minor bruising / skin tear / wound / suspected fracture / confirmed fracture / head injury / loss of consciousness); medical attention required (yes/no); resulted in hospital visit (yes/no — if yes, link to clinical episode record).Future
REQ-FALLS-03Immediate response log: actions taken (rest and monitoring / ice or wound care / vital signs checked / GP contacted / ambulance called); freeform notes.Future
REQ-FALLS-04Environmental safety observation: optional field per event documenting any identified hazard (loose mat / poor lighting / no grab rail / wet floor / unsupervised) and whether corrective action was taken or requested.Future
REQ-FALLS-05Falls frequency trend: monthly fall count plotted over time; near-misses shown as a separate line; a configurable alert threshold (default: 3 falls in 30 days) triggers a dashboard badge and push notification to admin.Future
REQ-FALLS-06Integration with clinical episodes: a fall resulting in a hospital visit creates or links to a clinical episode; the episode card shows the falls detail inline.Future
REQ-FALLS-07Full audit trail on all falls event records, consistent with REQ-AUD-01: every create and update action records the performing user, before/after snapshots, entity type, and timestamp. No hard-delete; soft-delete with reason required. Falls event records must not be permanently removed as they form part of the injury and incident history that may be required for legal or insurance purposes.Future

7.31 Cognitive Status Assessment (cognitive_tracking — Complete)

Section titled “7.31 Cognitive Status Assessment (cognitive_tracking — Complete)”

Periodic cognitive status snapshots for conditions affecting cognition — primarily dementia but also relevant for delirium, acquired brain injury, and post-operative confusion. Captures the family’s observed picture of how the person is functioning cognitively at a given time. Not a replacement for clinical assessment tools — a simple, repeatable family-facing check that creates a longitudinal record of cognitive change. (Primarily UC-08)

IDRequirementStatus
REQ-COG-01Cognitive status snapshot: periodic assessment (weekly or event-driven); orientation domains scored individually: to person (knows own name — yes / sometimes / no), to place (knows where they are — yes / sometimes / no), to time (knows approximate time of day — yes / sometimes / no; knows day/date — yes / sometimes / no); recognition of familiar people (recognises all regular carers and family / recognises some / recognises no one today); able to follow simple instructions (yes / sometimes / no).Future
REQ-COG-02Delirium flag: an acute confusion entry — distinct from baseline dementia tracking — flagging a sudden-onset change in alertness or confusion notably worse than the person’s usual baseline; onset time noted; prompts a note to contact GP or community nurse; colour-coded differently from routine cognitive entries to prevent conflation with chronic decline.Future
REQ-COG-03Cognitive trend: orientation domain scores and recognition ratings plotted over 30/90 days; a sustained decline in recognition of family members is flagged with a notification (“Recognition of family: declining — first noted [date]”).Future
REQ-COG-04Access control: carers and admins can create and edit cognitive status assessments; observers can view but not write. All entries are timestamped at creation and attributed to the recording carer (recorded_by_user_id); the recording carer’s display name is shown alongside each entry in the history.Future

7.32 Shared Family Narrative (family_journal — Family, Complete)

Section titled “7.32 Shared Family Narrative (family_journal — Family, Complete)”

A light, human-facing shared journal layer that sits alongside the clinical record. Captures moments, positive experiences, difficult days, and family-to-family communication. Its purpose is to preserve the person’s identity and the family’s relationship with them throughout the care journey — ensuring the record is not only about decline, and ensuring carers don’t feel invisible or unseen in the work they are doing. (Valuable across all use cases; most critical for UC-08)

IDRequirementStatus
REQ-JOUR-01Journal entry: freeform text note; optional photo attachment (JPEG/PNG, stored in UPLOADS_DIR/journal/); author (the logged-in family member’s display name); date and time; visible to all care circle members with patient access.Future
REQ-JOUR-02Entry tagging: optional tag on each entry (good day / hard day / milestone / memory / gratitude / question for the team); filterable in the journal feed.Future
REQ-JOUR-03Journal feed: reverse-chronological list per patient; filterable by tag and author; accessible from the patient profile page and as an optional home screen widget.Future
REQ-JOUR-04Care circle acknowledgement: other family members can acknowledge a journal entry with a single-tap response (a simple care symbol — no text required); the original author receives a push notification when acknowledged; acknowledgement visible on the entry. This small gesture matters — it tells a carer working alone that their family sees and values what they are doing.Future
REQ-JOUR-05Privacy and scope: journal entries are scoped to the care circle (tenant_id + patient_access) and are not included in clinical exports, audit summaries, or any external data; the journal is a family-private space. Available at Family and Complete tiers.Future

7.33 Preventive Care & Vaccinations (preventive_care — Family, Complete)

Section titled “7.33 Preventive Care & Vaccinations (preventive_care — Family, Complete)”

A vaccination record and preventive care log. Simple but genuinely absent from family care management. For elderly and immunocompromised patients, flu, pneumococcal, COVID, and shingles vaccinations are clinically important and their absence creates measurable risk. Families often cannot reliably answer “when did Dad last have his flu shot?” without this record. (Relevant for UC-05, UC-07, UC-08)

IDRequirementStatus
REQ-VACC-01Vaccination record per patient: vaccine name (influenza / pneumococcal / COVID-19 / shingles/zoster / tetanus / RSV / other); date given; given by (GP / pharmacy / hospital / community nurse / other); batch/lot number (optional); next due date (manually entered or auto-calculated from recommended interval).Future
REQ-VACC-02Due date alerts: when a vaccination’s next due date is within 30 days, a dashboard alert banner appears; a push notification is sent to the admin; alert dismissed once the vaccination is recorded as given.Future
REQ-VACC-03Broader preventive care log: a record for other periodic health checks — annual GP health assessment, dental review, audiology review, ophthalmology check, skin cancer check; date completed; provider name; next due date. Same alert pattern as vaccinations.Future
REQ-VACC-04No hard delete: vaccination records are immutable once created; corrections via a new record with a note field.Future

7.35 Internationalisation and Localisation

Section titled “7.35 Internationalisation and Localisation”

Canonical breakout: Full international language specification — requirements, language switcher UX, rollout waves, translation tiers, and delivery phases — lives in 03-REQUIREMENTS-INTERNATIONAL-LANGUAGE.md. This section remains the master REQ-ID index; keep both documents in sync when adding or changing REQ-I18N-*.

A platform capability, not a subscriber module. Internationalisation (i18n) is the architectural work that makes the platform able to support multiple languages and locales. Localisation (l10n) is the operational work of adding each specific language. Done correctly, adding a new country requires no application code changes — only a translation file, a locale config entry, and a Stripe geography/currency configuration. (Addresses NFR-11, NFR-12; directly enables global distribution strategy)

Production today: English UI only; multi-currency Stripe billing (USD + seven presentment currencies) is live and is not UI localisation — see doc 03 §3.6.

Implementation order (2026-06-04): I18N-P0 = full framework + en-AU extraction → I18N-P1 = fr-FR + language switcher → I18N-P2a/P2b = remaining Wave 1b locales as plug-ins (JSON + config only). Marketing (I18N-M1) and backend templates (REQ-I18N-11) may trail P1. Detail: 03 §2.1.

IDRequirementStatus
REQ-I18N-01All user-facing strings in the frontend are externalised from React components and TypeScript modules into locale-specific JSON translation files. No hardcoded English strings in src/pages/, src/components/, or src/lib/ (developer-facing console errors may remain in English). The i18n library is react-i18next backed by i18next — the industry-standard choice for React applications with mature TypeScript support, namespace splitting, and lazy-loading of language bundles.Partial — P0 extraction + ESLint ratchet; not all pages migrated
REQ-I18N-02Translation file structure: canonical path frontend/src/locales/{locale}/ (not frontend/public/locales/). Core namespaces: common.json, clinical.json, errors.json, notifications.json; optional modules/{module-slug}.json for large domains. Lazy-load per namespace.Future
REQ-I18N-02aDual-key convention for clinical terms: every clinical domain string has two keys — key (plain lay-carer language, default) and key_clinical (precise clinical terminology, used when clinical view is active). Example: mobility.assisted → “Needs help getting around” and mobility.assisted_clinical → “Assisted mobility — one-person assist”. Both keys exist in every locale’s translation file. The stored database value is always the internal code ("assisted"), never the display label. Both keys required in en-AU before enabling other locales.Future
REQ-I18N-03Runtime fallback chain: active locale → extends parent → base language (e.g. fr before fr-FR) → en-AU → [MISSING: key] sentinel. Clinical view: key_clinical → plain key → same chain. Tier 3 scales: validated translation or English. Dev logs warnings; prod logs silently; UI must not collapse.Future
REQ-I18N-04TypeScript key safety: translation keys are typed using i18next type generation so that t('nonexistent.key') is a compile-time error. This prevents silent translation regressions when keys are renamed or removed.Future
IDRequirementStatus
REQ-I18N-05Locale config file: a single frontend/src/locales/locales.config.json file defines every supported locale with all required fields: locale code (e.g., en-AU), language code (en), country code (AU), nativeDisplayName (primary label and alphabetical sort key), flagEmoji (Unicode flag emoji — supplementary only, with native name always shown), date format (DD/MM/YYYY), time format (12h or 24h), first day of week (Monday or Sunday), decimal separator (. or ,), thousands separator (, or .), emergency services number (000), direction (ltr/rtl), enabled, optional marketingEnabled, and a terminology object containing regional overrides for the terms listed in §1.8. Adding a new country means adding one entry to this file and supplying a translation file.Future
REQ-I18N-06Language-variant inheritance: a locale can declare a extends parent (e.g., en-CA extends en). Only the strings that differ from the parent need to be defined; the rest inherit. A new English-speaking country (e.g., en-IE) requires only the differing strings (e.g., regional terminology overrides) — not a full retranslation of all ~1,000+ keys.Future
REQ-I18N-07Date, time, and number formatting: all dates, times, durations, and clinical measurement values rendered in the UI use the active locale’s format via the browser-native Intl.DateTimeFormat and Intl.NumberFormat APIs, driven by the locale config. The API always returns UTC ISO 8601 timestamps and raw numeric values — all display formatting is handled client-side only.Future
REQ-I18N-08Regional terminology overrides in UI: clinical and domain terms that vary by country (see §1.8 — e.g., “GP” vs “family doctor”, scheme names, legal document names) are rendered from the locale config’s terminology map rather than hardcoded. The UI shows the locale-appropriate term transparently.Future
IDRequirementStatus
REQ-I18N-09Tenant locale: each tenant record has a locale field (default en-AU); the app UI defaults to that locale for all users of the tenant. Set at signup (detected from browser locale or Stripe geography) and configurable by the tenant admin in Settings. Does not determine PHI storage region (REQ-I18N-38).Future
REQ-I18N-10User locale override: individual users can override the tenant locale to their personal preference in their account settings (e.g., a French-speaking carer on an English tenant). The override is stored on the user record and does not affect other team members.Future
REQ-I18N-11Backend localisation: push notification content, API user-facing error messages, and any server-rendered text (e.g., email content) use the target user’s or tenant’s locale. System/developer error messages and logs remain in English at all times. Backend translation strings live in backend/locales/{locale}.json with the same namespace structure as the frontend.Future
IDRequirementStatus
REQ-I18N-12CSS logical properties: from the first i18n implementation, all new and refactored Tailwind CSS classes must use logical properties — ms-*/me-* (margin-start/end), ps-*/pe-* (padding-start/end), start-*/end-* (position) — rather than physical left/right equivalents. This ensures RTL locales (Arabic, Hebrew, Farsi, Urdu) render correctly without per-component rewrites when added.Future
REQ-I18N-13RTL layout rendering: when the active locale has direction: rtl in its config, the <html> element receives dir="rtl" and all logical-property layouts mirror automatically. Full RTL testing and sign-off is required before any RTL locale ships to subscribers.Future

7.35.5 Adding a new country — operational checklist

Section titled “7.35.5 Adding a new country — operational checklist”

The following is the complete list of steps required to add a new country to the platform. If all i18n requirements above are met, no application code changes are needed for steps 1–5.

StepActivityWho
1Add a locale config entry to locales.config.json with all required fields (date/time format, terminology map, emergency number, currency)Engineer
2Create translation files for the new language (if new language) by copying the en-AU base and replacing all values; or create a language-variant file (if new country for existing language) with only the overriding stringsTranslator / localisation team
3Add the country/currency to Stripe geography and pricing configurationEngineer / billing admin
4Update §1.8 Terminology table in this document with the new country columnProduct owner
5Add the country to the Stripe allowed_countries list on the Checkout session and FX preview endpointEngineer
6Test: verify date/time rendering, number formatting, all clinical terminology overrides, push notification content, and (if RTL) layout directionQA
7(Optional) Add country-specific onboarding copy and pricing to the marketing siteMarketing
8(Optional) If distributing through a country operator: provision operator tenant account (see REQ-I18N-14)Ops
IDRequirementStatus
REQ-I18N-14Country operator tenant type: a future operator tenant tier enables a country-level distribution partner to create and manage subscriber family tenants within their assigned country or region. Operator accounts see a management console (subscriber list, usage summary, billing pass-through) rather than the family care interface. The operator has no access to subscriber clinical data — they see only billing and account metadata.Future
REQ-I18N-15Operator provisioning: super-admin creates an operator tenant, assigns one or more country codes, and sets a billing rate (revenue share or fixed). Operators receive an invite link they distribute to families in their market. Tenants created through an operator link are tagged with the operator_tenant_id for reporting and billing.Future

7.35.7 Plain language design principle and clinical view

Section titled “7.35.7 Plain language design principle and clinical view”

The single most important i18n-adjacent design decision. The platform serves family carers first — people who may have no clinical background. Clinical precision must not be sacrificed, but it must not be imposed on the primary user experience either.

IDRequirementStatus
REQ-I18N-16Frame vs content separation: the platform translates only the structural frame it generates — labels, prompts, dropdown options, structured field choices, scale descriptors, error messages, and notification templates. All free-text fields entered by users (care notes, shift narratives, medication names, journal entries, care protocol steps, any notes field throughout the app) are stored as Unicode and displayed exactly as typed. The platform never attempts to translate user-entered content.Future
REQ-I18N-17Plain language default: all clinical labels, assessment scale options, domain terminology, and observation prompts default to simple, conversational lay-carer language — the language a family member without clinical training naturally uses. Examples: “How is their breathing today?” not “Dyspnoea assessment”; “Needs help getting around” not “Assisted mobility (ADL)”; “Did they have a bowel movement?” not “Bowel habit assessment — Bristol stool scale”. The plain language default applies in every locale; clinical language is optional.Future
REQ-I18N-18Clinical view toggle: a user-level setting (“Show clinical terminology”) switches the entire interface to precise clinical language — clinical scale names, medical terminology, technical option labels — for users with professional background who prefer or require clinical precision. Off by default for all users. When active, the _clinical translation key variant is used in place of the plain key throughout. The toggle state is stored on the user record and does not affect other members of the same tenant.Future
REQ-I18N-19Clinical reference (i) button: a small information icon placed beside any structured field, assessment question, or dropdown option that has a clinical reference. On mobile (primary device), tapping opens a bottom sheet or compact popover showing: the clinical term or scale name, the clinical description, and optionally a “what to tell your doctor/nurse” note. On desktop, the same popover is triggered on hover or click. The (i) button is shown on both plain and clinical views, allowing users in plain mode to look up clinical context on demand without switching views.Future
REQ-I18N-20User-entered content direction: all text input and textarea elements carry dir="auto" so that user-typed content in right-to-left scripts (Arabic, Hebrew) renders correctly within an otherwise left-to-right UI. This is handled at the HTML element level — no JavaScript or server logic required.Future

Three distinct tiers of content require different translator qualifications and review processes. Conflating them produces either clinical errors or poorly understood lay language.

TierContent typeExamplesTranslator requirementReview process
Tier 1 — UI chromeNavigation, buttons, settings, error messages, onboarding copy“Save”, “Add medication”, “Your session is about to expire”Professional software translator, native speakerStandard software l10n review
Tier 2 — Plain clinical languageAssessment prompts, observation labels, dropdown options in plain mode“How is their breathing today?”, “Watery, no solid pieces”, “Needs full assistance”Native-speaking lay carer OR professional translator with lay-carer sign-off(1) Professional translator for initial version; (2) native-speaking lay carer reviews — “does this sound natural to someone without medical training?”; (3) clinical professional confirms nothing is misleading
Tier 3 — Standardised clinical scalesClinical view toggle labels; validated assessment scale descriptorsMRC Dyspnoea Scale grades, Rockwood CFS descriptors, Borg scale anchors, Abbey Pain Scale domain labelsOfficial validated translations only — sourced from the scale’s publishing body or an officially validated translation studyNo custom translation permitted; if no validated translation exists for a language, the English scale labels are displayed for that locale until a validated translation is available

Note for product owners commissioning translation: Tier 2 is the hardest and most important. It requires understanding the family carer’s perspective in each target culture — not just linguistic accuracy. A medically accurate translation that no lay carer would naturally say defeats the purpose of plain language design. Commission Tier 2 translations with native-speaker lay review, not just professional translation.

Note on Latin/Greek clinical terminology: The majority of clinical terms used in professional medical education worldwide derive from Latin and Greek roots. “Dyspnoea” is “dyspnée” in French, “Dyspnoe” in German, “disnea” in Spanish. This near-universal consistency means the clinical toggle view (Tier 3 equivalent for domain terms) is inherently more stable across languages than plain language. Medical professionals in Arabic-speaking and Hindi-speaking countries are typically trained using these same Latin/Greek-rooted terms. The translation challenge is greatest in the plain language tier, not the clinical tier.

Target language rollout is phased by market priority, script complexity, and translation process maturity.

WaveLocale(s)LanguageScriptRTLPrimary marketsNotes
Wave 1 — Launchen-AU, en-GB, en-US, en-NZ, en-CA, en-IEEnglishLatinNoAU, UK, US, NZ, CA, IEBase locale; all other locales inherit from en
Wave 1 — Launchfr-FR, fr-CA, fr-BEFrenchLatinNoFrance, Quebec, Belgiumfr-CA and fr-BE extend fr-FR with overrides
Wave 1 — Launches-ES, es-MX, es-419SpanishLatinNoSpain, Mexico, Latin America, US Hispanices-419 covers Latin American variants
Wave 1 — Launchnl-NL, nl-BEDutchLatinNoNetherlands, Belgiumnl-BE extends nl-NL
Wave 1 — Launchde-DE, de-AT, de-CHGermanLatinNoGermany, Austria, Switzerland
Wave 1 — Launchit-ITItalianLatinNoItaly, Switzerland
Wave 1 — Launchpt-PT, pt-BRPortugueseLatinNoPortugal, Brazilpt-BR has significant vocabulary differences
Wave 1 — Launchru-RURussianCyrillicNoRussia, CIS countriesRequires Cyrillic font rendering
Wave 2arArabicArabicYesMiddle East, North Africa, Arab diasporaRTL layout required; dir="rtl" on <html>; validated scale translations required
Wave 2hi-INHindiDevanagariNoIndia, Indian diasporaDevanagari script rendering; medical education in English reduces clinical toggle translation urgency
Wave 2ja-JPJapaneseCJK (Kanji/Hiragana/Katakana)NoJapanHighest-priority non-European addition — world’s oldest population (29% over 65), very high disposable income, deep family care culture, no adequate existing equivalent. CJK rendering requires font and character density UI considerations.
Wave 3ko-KRKoreanHangulNoSouth KoreaAging rapidly; strong filial care tradition; very high tech adoption
Wave 3zh-TW, zh-HKTraditional ChineseCJK (Traditional)NoTaiwan, Hong Kong, Chinese diasporaHigh income markets; shares CJK rendering work from Wave 2 Japanese

Simplified Chinese (zh-CN) is not on the roadmap until mainland China’s health data sovereignty and app licensing requirements are assessed. The Chinese diaspora in English-speaking markets is served by the Traditional Chinese locale.

The language switcher lets a carer use a different UI language than the household default (e.g. French tenant UI while one member switches to Russian). UX rules (emoji flag + native name; alphabetical picker) are in 03-REQUIREMENTS-INTERNATIONAL-LANGUAGE.md §5.1–6.

IDRequirementStatus
REQ-I18N-21A Language control is visible in authenticated app chrome on mobile and desktop (top app bar; duplicate under Settings → Language).Future
REQ-I18N-22Closed state shows flagEmoji + native language name (e.g. 🇫🇷 Français) and chevron. Emoji never without native name.Future
REQ-I18N-23Open picker lists every enabled locale: flagEmoji, native name (primary), gloss (secondary), checkmark; sorted alphabetically by native name (REQ-I18N-31).Future
REQ-I18N-31Picker sorts enabled locales A→Z by nativeDisplayName (Intl.Collator); never by flag, country, or market priority.Future
REQ-I18N-24Selection immediately switches UI (changeLanguage), updates lang/dir on <html>, persists users.locale_override via API, no logout; other household members unaffected.Future
REQ-I18N-25When override differs from tenant default, Settings explains the difference and offers Reset to family default.Future

The public landing page (lyncareos.com) must show a Language control listing every enabled locale so visitors can override wrong auto-detection (VPN, travel, diaspora). Browser/country hints set the initial default only. The pricing currency picker remains separate. Full spec: 03-REQUIREMENTS-INTERNATIONAL-LANGUAGE.md §6b.

IDRequirementStatus
REQ-I18N-26Language control always visible on marketing header when ≥2 locales enabled; lists all enabled locales (flagEmoji + native name + gloss); same UX and alphabetical sort as app (REQ-I18N-31).Future
REQ-I18N-27Picker shows exactly supported/enabled marketing locales only — none omitted because auto-detect chose another language.Future
REQ-I18N-28Auto-detect is hint only: saved preference → Accept-Language → optional country map → en-AU; picker stays visible regardless (VPN-safe).Future
REQ-I18N-29Manual choice persists in lyncareos_marketing_locale (localStorage + cookie); overrides detect on return visits.Future
REQ-I18N-30Pricing region/currency picker independent — changing language does not change Stripe currency and vice versa.Future
REQ-I18N-32Marketing uses shared locales.config.json and picker rules; I18N-M1; Tier 1 marketing strings; bundle sync per REQ-I18N-37; English marketing does not block A6.Future
IDRequirementStatus
REQ-I18N-33Plug-in locale model: after P0/P1, new Wave 1 locale = JSON files + config enabled: true + CI coverage — no app code changes.Future
REQ-I18N-34CI locale_coverage.json; ≥95% Tier 1 per namespace; 100% Tier 2 plain + _clinical; en-AU 100% before P1.Future
REQ-I18N-35Lazy-load failure: 3s timeout → en-AU namespace fallback; no shell break.Future
REQ-I18N-36TMS optional from I18N-P2a; git JSON sufficient for P0/P1 (incl. French).Future
REQ-I18N-37Marketing locale bundles synced via CI when marketingEnabled: true — no manual-only drops.Future
REQ-I18N-38Locale restrictions register (e.g. zh-CN excluded until legal review); locale ≠ data residency.Future

LynCareOS is currently delivered as a Progressive Web App. A native store presence is a planned distribution and engagement strategy — drivers: Play/App Store discoverability, native push (APNs/FCM), and later HealthKit / Health Connect. The path is Capacitor wrapping the existing React/Vite SPA (no frontend rewrite).

Commerce posture (authoritative, 2026-08-06): Subscribe, upgrade, Care Profile purchase, and billing portal remain on the LynCareOS website (Stripe). Google Play and Apple App Store clients are free, consumption-only binaries: login / free signup and use entitled modules; no in-app Stripe Checkout or payment deep links. Tenant entitlement flags unlocked by website purchase apply to the whole care circle. Design: native-store-clients design. Delivery order: Android (Play) first, then iOS.

IDRequirementStatus
REQ-NATIVE-01Strategic intent and trigger conditions: the native app build is a planned future investment, not an immediate deliverable. The decision to initiate the build is triggered by one or more of: (a) monthly active subscriber growth crosses 500 — at which point App Store discoverability becomes a primary acquisition lever; (b) iOS PWA push notification limitations are identified as a measurable churn or engagement factor from user feedback or analytics; (c) a strategic partnership or country operator (REQ-I18N-14) requires an App Store presence as a condition of distribution; (d) product owner override to start Play-first distribution earlier. The product owner records the decision trigger and sign-off before engineering begins.Future
REQ-NATIVE-02Capacitor wrapper build (preferred first path): Capacitor wraps the existing React/Vite SPA in a native WKWebView (iOS) and Android WebView shell, producing App Store-submittable .ipa and .aab binaries without rewriting the frontend or the FastAPI backend. The frontend codebase is unchanged except for the addition of Capacitor plugin bridge calls where native APIs are used. The backend API contract is unchanged. Capacitor plugins replace the following web APIs in the native build: @capacitor/push-notifications (APNs on iOS, FCM on Android) replacing VAPID Web Push; @capacitor/camera enhancing the prescription scan camera flow; @capacitor/preferences (or equivalent secure native store) for session material that cannot use web HttpOnly cookies in a bundled WebView. All other application behaviour, routing, and UI is identical to the PWA except commerce CTAs gated per REQ-NATIVE-08/10. Ship Android before iOS. Functional shell estimate excludes store review.Future
REQ-NATIVE-03Native push delivery (optional add-on to care alerts): when the Capacitor build ships, extend alert_service (or a dedicated native_push_service) to mirror new open care_alerts to APNs/FCM device tokens. The PWA continues to use in-app alerts + icon badge only — no VAPID Web Push revival. Device tokens are stored in a revived push_subscriptions table (or successor) with delivery_type (apns / fcm) and user_id; native push is a lock-screen nudge, not the source of truth (PostgreSQL care_alerts remains authoritative).Future
REQ-NATIVE-04App Store presence and listing requirements: when the native build is released, the app is submitted to the Google Play Store first and the Apple App Store second under the LynCareOS brand as a free download. Metadata must comply with Apple App Store Review Guidelines §5.1 / §5.1.3 and Google Play Developer Policy. Listing must include a privacy policy link and describe LynCareOS as a family support care solution without medical-device / diagnose / treat / cure claims. Prefer “Health & Fitness” (or equivalent family-support) category. Provide reviewer demo credentials.Future
REQ-NATIVE-05Health data integration (post-native build): once a native build exists, Apple HealthKit (iOS) and Google Health Connect (Android) integrations become technically available. A future module enhancement to vitals_tracking will allow the patient’s connected wearables and health apps (Apple Watch, Fitbit, Garmin, Samsung Health, etc.) to push daily readings — heart rate, SpO₂, blood glucose, weight, step count, sleep stages — directly into the corresponding LynCareOS vitals records. Health Connect and HealthKit data is treated as supplementary patient-attributed data; it carries a source: 'health_platform' flag and is visually distinguished from carer-recorded readings in the vitals view. It cannot substitute for clinician-verified readings in compliance contexts and is excluded from audit-grade clinical exports. Requires user consent per Apple and Google health data permission requirements.Future
REQ-NATIVE-06Architecture preservation rules — must not be violated before the native build: engineers must not introduce patterns that would complicate or require rework for a Capacitor build. Specifically: (a) all API calls must use relative URLs via lib/api.ts — no hardcoded absolute hostnames or protocol-relative URLs in component code; (b) authentication tokens must remain in tokenStore / HttpOnly cookies — never scattered in React component state or window globals; (c) file attachment viewing must use server-side authenticated download endpoints — no blob: or data: URI construction in component code; (d) any use of browser-specific globals (window.print(), window.open() for popups, navigator.clipboard) must be wrapped in a capability check so the Capacitor equivalent can be substituted without touching business logic; (e) fixed headers, footers, and modals must use env(safe-area-inset-*) CSS variables for iPhone notch and home-indicator clearance — this is already implemented in the current layout and must be maintained in all future components; (f) new billing / upgrade CTAs must be wrap-able behind a store-build gate (REQ-NATIVE-10) so website Stripe flows are not hard-wired into every surface.Ongoing
REQ-NATIVE-07React Native evaluation gate: if the Capacitor wrapper approach reveals significant limitations — complex native animations, deep HealthKit integration requiring native modules not available as Capacitor plugins, or performance issues in the prescription scan camera flow — a React Native rewrite evaluation is triggered. The evaluation must produce a written assessment covering: performance benchmark comparison (Capacitor WebView vs React Native bridge), developer effort to parity, third-party Expo SDK availability for all required native modules, and timeline to App Store submission. No React Native rewrite work begins without a documented evaluation outcome and explicit product owner sign-off. React Native is a higher-investment path that delivers a fully native UI layer; it is not the default choice and should not be assumed.Future
REQ-NATIVE-08Website-first commerce (consumption-only store clients): Stripe on the LynCareOS website remains the sole system of record for subscription tiers, upgrades, Care Profile one-time purchases, and billing portal. Store-distributed Android/iOS binaries must not open Stripe Checkout, payment WebViews, or Customer Portal payment flows. Entitlements written by existing Stripe webhooks continue to gate modules for all tenant members. Outside the store binary (website, email, store listing text), LynCareOS may sell and promote website checkout freely.Future
REQ-NATIVE-09Free client listings and multi-client download chooser: Google Play and Apple App Store listings are free (no paid download price). After website account creation or purchase, the website offers a “Get the apps” chooser: continue in browser, Windows installer (direct from LynCareOS), Android (Play Store link), iOS (App Store link — no public .ipa hosted on the site). Windows distribution is website-first; Microsoft Store is optional later and out of scope for Play/Apple fee avoidance.Future
REQ-NATIVE-10Store-build onboarding and upgrade messaging: a free store download must install and launch without prior purchase. Users may sign in or create a free account in-app; unpaid/locked modules show clear empty states. Upgrade guidance in store builds may use informational copy (e.g. “Go to lyncareos.com to upgrade”) without payment deep links or buttons that lead to alternate payment methods, consistent with Google Play consumption-only guidance. Apple v1 uses the same no-payment-CTA posture.Future
REQ-NATIVE-11Delivery sequence: implement and submit Google Play (Android) first; stabilise auth, commerce gating, and listing compliance; then ship Apple App Store (iOS) with the same consumption-only commerce rules. Optional native push may follow Play v1.Future
REQ-NATIVE-12Optional later store billing rails: Play Billing and/or Apple IAP (or enrolled Google Billing Choice / external-link programs) may be added only after product-owner sign-off based on measured conversion need. Any such path must dual-write or reconcile entitlements with the existing Stripe tenant module model and must not silently replace website Stripe for web users. Default remains REQ-NATIVE-08.Future

7.34 Frailty Assessment (frailty_tracking — Complete)

Section titled “7.34 Frailty Assessment (frailty_tracking — Complete)”

Periodic frailty scoring for elderly patients. A single composite indicator that summarises overall physical reserves, widely used in geriatric palliative care to contextualise treatment decisions and inform escalation planning. Distinct from specific domain scores — it is the question “how robust is this person overall right now?” (UC-05, UC-07, UC-08)

IDRequirementStatus
REQ-FRAILTY-01Frailty score record: Rockwood Clinical Frailty Scale score (1–9 with full descriptor labels: 1 Very Fit / 2 Well / 3 Managing Well / 4 Vulnerable / 5 Mildly Frail / 6 Moderately Frail / 7 Severely Frail / 8 Very Severely Frail / 9 Terminally Ill); date of assessment; assessed by (carer observation / GP / allied health); optional notes. Multiple assessments over time.Future
REQ-FRAILTY-02Frailty trend: score plotted over time as a simple line chart; direction label on the most recent 30-day segment (stable / worsening); a score of 8 or 9 surfaces a prompt to review goals of care if no GoC document has been created or reviewed in the last 90 days.Future
REQ-FRAILTY-03Integration with care intelligence: frailty score included as a selectable metric in the multi-domain trend chart (REQ-CI-02) and the MDT care summary report (REQ-CI-05).Future
REQ-FRAILTY-04Full audit trail on all frailty assessment records, consistent with REQ-AUD-01: every create and update action records the performing user, before/after snapshots, entity type, and timestamp. Frailty assessments are immutable once created (corrections require a new assessment record with a note explaining the correction); the full assessment history is retained as it forms a prognostically significant longitudinal record.Future

IDRequirementStatus
REQ-MOD-01Eleven implemented module slugs: medication_dispensing, care_calendar, shopping, prescription_management, sleep_tracking, pain_tracking, vitals_tracking, key_contacts, condition_templates, custom_observations, family_help.Done — all eleven routers, gates, and subscription rows implemented (REQ-MOD-24..27 below).
REQ-MOD-02Admin UI to view and manage subscription status; locked modules shown with upgrade CTAs.Done — Settings → Subscriptions
REQ-MOD-03care_services placeholder slug (legacy subscriptions / schema CHECK only; not in tiers.json or new provisioning).Partial — no router; old rows may exist; see 04-ROADMAP.md Phase 7b
REQ-MOD-04New module slug care_observations: daily multi-domain clinical observations (bowel, bladder, nutrition, skin, respiratory, functional status). Router, gate, and subscription row. (See §7.15)Partial (schema only) — care_observations table + tier-pack rows seeded by V083; no router, no service, no UI.
REQ-MOD-05New module slug therapy_records: therapy session log, between-session home program, and therapy goals. Router, gate, and subscription row. (See §7.16)Partial (schema only) — therapy_records table seeded by V083; no router/UI.
REQ-MOD-06New module slug equipment_management: durable equipment register with service schedule, condition notes, and funding scheme references (free-text, jurisdiction-neutral — see §1.8). Router, gate, and subscription row. (See §7.17)Partial (schema only) — equipment_register + service log tables seeded by V083; no router/UI.
REQ-MOD-07New module slug goals_of_care: advance care planning document, escalation protocol, and immutable version history. Router, gate, and subscription row. (See §7.18)Partial (schema only) — goals_of_care table + version history seeded by V083; no router/UI.
REQ-MOD-08New module slug clinical_episodes: structured event log for hospitalisations, infections, pain crises, and other acute incidents. Router, gate, and subscription row. (See §7.19)Partial (schema only) — clinical_episodes table seeded by V083; no router/UI.
REQ-MOD-09New module slug caregiver_wellbeing: carer self-report check-ins, consecutive shift alerts, respite planning, and team wellbeing indicator. Router, gate, and subscription row. (See §7.20)Partial (schema only) — caregiver_wellbeing_checkins table seeded by V083; no router/UI.
REQ-MOD-10New module slug patient_voice: patient self-report, social participation log, adolescent privacy tier, and patient preferences record. Router, gate, and subscription row. (See §7.21)Partial (schema only) — patient_voice_* tables seeded by V083; no router/UI.
REQ-MOD-11New module slug care_intelligence: unified timeline, multi-domain trend chart, functional decline index, infection frequency trend, MDT-ready care summary, and deterioration detection. Router, gate, and subscription row. (See §7.22)Future — derived module; depends on REQ-MOD-04..10.
REQ-MOD-12Tier assignment for all new modules: all new modules (care_observations through care_intelligence) are provisioned at the Complete tier; lower tiers see locked module cards with upgrade CTAs consistent with existing ModuleGate pattern.Partial — tiers.json Complete tier lists slugs; module cards / ModuleGate UX cannot be exercised end-to-end until the routers (REQ-MOD-04..11) are built.
REQ-MOD-13New module slug respiratory_oxygen: respiratory symptom assessment (MRC/Borg/breathlessness/cough/fatigue), exertional performance log, O₂ therapy prescription management, daily use compliance, cylinder stock, equipment safety checklist, and breathlessness crisis plan. (See §7.25)Partial (schema only) — V084.
REQ-MOD-14New module slug behaviour_tracking: event-driven behavioural incident log with type, trigger, severity, intervention, outcome, pattern analysis, and quick-entry mode. (See §7.26)Partial (schema only) — V084.
REQ-MOD-15New module slug care_protocols: person-centred care guide with named protocols, person-specific tips, calming strategies list, and familiarity and identity record. (See §7.27)Partial (schema only) — V084.
REQ-MOD-16New module slug observational_pain: carer-scored observational pain and distress assessment (Abbey/PAINAD-modelled) for non-communicative patients; integrates with pain_tracking as a configurable alternative to the body map. (See §7.28)Partial (schema only) — V084.
REQ-MOD-17New module slug swallowing_safety: swallowing classification, prominent display on handover and observations, meal observation log, deterioration alert, and version history. (See §7.29)Partial (schema only) — V085.
REQ-MOD-18New module slug falls_tracking: individual falls event log with circumstances, injury, environmental observation, frequency trend, and clinical episode linkage. (See §7.30)Partial (schema only) — V085.
REQ-MOD-19New module slug cognitive_tracking: periodic cognitive status snapshots, delirium flag (distinct from baseline), recognition trend, and decline notification. (See §7.31)Partial (schema only) — V085.
REQ-MOD-20New module slug family_journal: shared family narrative with photo attachments, tagging, feed view, and care circle acknowledgement. Available at Family and Complete tiers. (See §7.32)Partial (schema only) — V086.
REQ-MOD-21New module slug preventive_care: vaccination record with due-date alerts, and broader preventive health check log. Available at Family and Complete tiers. (See §7.33)Partial (schema only) — V086.
REQ-MOD-22New module slug frailty_tracking: Rockwood CFS periodic assessments, trend chart, and GoC review prompt at high frailty scores. (See §7.34)Partial (schema only) — V086.
REQ-MOD-23Tier assignment for new modules: respiratory_oxygen, behaviour_tracking, care_protocols, observational_pain, swallowing_safety, falls_tracking, cognitive_tracking, frailty_tracking provisioned at Complete tier. family_journal, preventive_care, and care_pathways available at Family and Complete tiers.Future
REQ-MOD-24New module slug condition_templates: care archetype onboarding, Care Profile library (unlock + Care Start apply), tenant pack purchase ledger. (See §7.36, 35-CARE-PROFILE-CATALOGUE.md)Partial — unlock + apply Done on VPS; open C1d, prod paid pack checkout
REQ-MOD-25New module slug custom_observations: condition-specific and user-defined daily observation types beyond standard vitals; family-friendly input forms with plain language prompts; per-patient observation dashboard with trend lines per observation type. (See §7.37)Partial — API + components; dashboard route pending
REQ-MOD-26Tier assignment for template and observation modules: condition_templates available at all tiers (2 starter packs included free; additional packs via one-time purchase or bundled into Complete annual). custom_observations available at Family and Complete tiers.Done — tiers.json
REQ-MOD-27New module slug family_help: family help request library, volunteer/take-ownership flow, calendar integration, and care alert notifications for request lifecycle events. Available at Family and Complete tiers. (See §7.38)Partial — page + API; nav + calendar pending
REQ-MOD-28New module slug care_pathways: staged Care Pathway (Planning Ahead) per archetype — self-declare + undo, consideration cards (curated + family-added), planning task ownership, data nudges (nav only), care alerts on stage placement change. Available at Family and Complete tiers. (See §7.40, 33-CARE-PATHWAYS-MODULE.md)Future — spec + mockup complete 2026-06-04; implementation D31
IDRequirementStatus
REQ-PLAT-01Web app works on modern desktop and mobile browsers; installable as a PWA.Done
REQ-PLAT-02Deployable with Docker Compose (production profile on the operations host).Done — 03%20-%20DEPLOYMENT%20AND%20PRODUCTION/20-PRODUCTION-DEPLOYMENT-GUIDE.md
REQ-PLAT-03Cloudflare Tunnel in front of uvicorn; optional Cloudflare Access for the app subdomain.Operational — [../04 - OPERATIONS/07-PLATFORM-RUNBOOK.md](../04 - OPERATIONS/07-PLATFORM-RUNBOOK.md)
REQ-PLAT-04Background jobs (APScheduler + Postgres job store): timezone-aware per-tenant 06:00 recurring-item resets.Done — services/scheduler.py
REQ-PLAT-05PgBouncer and read-replica profiles in docker-compose.yml; opt-in without code changes.Done — 17-HARDENING-SCALE-RUNBOOK.md Part II
REQ-PLAT-06Redis for SSE ticket anti-replay, rate-limiting key store, billing tier/FX rate cache.Done
REQ-PLAT-07Sequential numbered database migrations auto-applied on startup.Done — backend/migrations/runner.py
REQ-PLAT-08Marketing site: tier catalog, FX preview, signup modal (password + Google), private-beta worker gate.Done — marketing/palliative/; Cloudflare Pages deployment
REQ-PLAT-09CI quality gates: ruff check . (backend), npm run lint:strict + npm run test (frontend), Docker build.Done — 02 - ARCHITECTURE_DESIGN/12-CI-REFERENCE.md
REQ-PLAT-10OpenAPI-driven frontend type generation: replace manually maintained TypeScript interfaces in frontend/src/lib/api.ts with auto-generated types produced by openapi-typescript from the FastAPI OpenAPI schema (GET /api/openapi.json). The generated output is committed to source control at frontend/src/lib/api.types.ts; api.ts imports and re-exports from this file rather than defining response shapes inline. A package.json script — "generate:types": "openapi-typescript http://localhost:8021/api/openapi.json -o src/lib/api.types.ts" — regenerates the file against a running backend. The CI quality gate adds a step that runs generate:types against the containerised backend and fails the build if the committed api.types.ts differs from the freshly generated output; this prevents the common failure mode where a backend Pydantic model changes but the frontend TypeScript interface is not updated. Manual type definitions in api.ts are progressively migrated to use generated types as each module is next touched during development — no big-bang migration required. any and @ts-ignore usage introduced during the migration must be removed before the PR is merged; the existing ESLint rule @typescript-eslint/no-explicit-any → error already enforces this. As the Future module build wave adds 20+ new Pydantic models, type generation becomes the primary mechanism for keeping the frontend contract in sync without manual effort.Future

7.36 Condition Care Profiles & Template Packs (condition_templates)

Section titled “7.36 Condition Care Profiles & Template Packs (condition_templates)”

Full specification in Palliative Care Archetypes.md. This section records the formal functional requirements.

Background: Research across 50 palliative care scenarios identifies 7 dominant coordination patterns (Care Archetypes) that cut across diagnosis lines. Families of an IPF patient and families of a cystic fibrosis patient share an almost identical daily care coordination structure. Pre-built condition template packs remove the blank-canvas problem for new families and constitute a separate revenue stream.

IDRequirementStatus
REQ-TMPL-01During new patient setup, the family is offered an archetype selection step. Selecting an archetype shows a description of daily life in that archetype in plain language, and recommends the matching Care Profile(s) from Palliative Care Archetypes.md §3.2.1.Partial — API + archetype catalogue on dev; family UI withdrawn 2026-06-26 (CarePatternPanel, ArchetypeOnboarding deleted; Add Person is demographics only)
REQ-TMPL-02Care Start apply: when a Care Profile is applied to a patient, apply_care_start_pack() seeds tenant reason types, enables observation types, and shift task templates in one transaction. Idempotent; editable after apply. Spec restored 2026-06-02 (was removed 2026-05-26).Done — VPS 2026-06-04; open C1d before family-visible seed changes
REQ-TMPL-03All seeded items are editable by the family after Care Start apply.Done — apply path on dev and VPS
REQ-TMPL-04A tenant pack purchase table (tenant_pack_purchases) records which Care Profiles a tenant has unlocked: free starter, paid (Stripe Checkout), tier bundle, or admin grant.Done
REQ-TMPL-05Care Profile library: twelve profiles with canonical slugs in 35-CARE-PROFILE-CATALOGUE.md §3.2. Definitions in condition_packs, pack_reason_types, pack_shift_tasks, pack_observation_type_links — not hard-coded in application logic.Done — V007–V010 on dev and VPS
REQ-TMPL-06Two free starter profiles (general_palliative, medication_orchestra) at all tiers. Paid Care Profiles are purchased à la carte on every tier at prices in §3.2 (condition_packs.price_aud). Board + Subscriptions offer go live together per backend/care_modules/go_live.json.Partial — à la carte + go-live gates Done (2026-08-03); catalogue on dev via V007
REQ-TMPL-07All user-visible text within profiles (reason type labels, observation prompts, shift task text) must comply with the plain language standard in 35-CARE-PROFILE-CATALOGUE.md §4. Clinical terms are not permitted in family-facing labels.Partial — seed on VPS; C7 automated PASS; C1d human sign-off open
REQ-TMPL-08A family may apply multiple Care Profiles to the same patient; merge dedupes by plain label / slug.Partial — idempotent merge in apply service on dev
REQ-TMPL-09Subscriptions UI lists available profiles with Included / Purchased / Buy once; preview before purchase.Done — Subscriptions.tsx + ConditionPackPreviewDialog
REQ-TMPL-10Profile metadata (name, archetype, conditions covered, seeded counts) visible in preview for families who have not yet purchased.Done — preview endpoint (content on dev after V008)
REQ-TMPL-11Stripe one-time Checkout for paid profiles; webhook inserts tenant_pack_purchases. FX via existing service.Done
REQ-TMPL-12Care Start apply writes an audit row (entity_type=care_start_applied). Pack purchase audited via condition_pack_purchase.Done
REQ-CARE-START-01Subscription checkout may include Palliative Care Start bundle (palliative_care_start) — stores tenants.pending_care_start_pack_slug and auto-applies on first patient when confirmed.Done — C4a; prod paid pack checkout still gated
REQ-CARE-START-02Reconcile pack catalogue + seed content (C1b, C1c) — 35 §7.0.3–7.0.4. Sequence: 04 §Master Phase 1.Done — VPS 2026-06-04
REQ-CARE-START-03Reconcile archetype copy (C1a, REQ-CARE-START-03) — 35 §7.0.2.Done — VPS 2026-06-04
REQ-CARE-START-04Non-destructive archetype / Care Profile correction (per patient). Changing patients.archetype_id or applying a different unlocked profile must not delete dispensings, observations, pain/vitals/mind, calendar, contacts, shopping, or audit history. Care Pathway: archive prior placement; fresh stage catalogue for new archetype; retain planning tasks and card dismiss prefs (REQ-PATH-11, 33 §5.6). Care Start seed: idempotent merge only — add missing reason types / observation types / shift tasks; deactivate or hide unused seeded labels (zero linked records); never bulk-delete labels with dispense or observation history. UX: patient-scoped correction UI withdrawn 2026-06-26 (was Our care pattern); policy copy remains in Palliative §7.5. API: PATCH /api/patients/{id}/care-pattern; audit care_pattern_changed. Destructive reset care configuration is a separate rare admin action (export + confirm) — not the default archetype change. Overlap: prefer add secondary archetype or second profile apply (Palliative §3.2.1).Partial — API on dev; family UX withdrawn 2026-06-26

7.37 Condition-Specific Observations (custom_observations)

Section titled “7.37 Condition-Specific Observations (custom_observations)”

Full specification including per-archetype observation types in Palliative Care Archetypes.md §3.4–§3.6. This section records the formal functional requirements.

Background: The current patient_vitals table captures pulse, SpO₂, and temperature — sufficient for a general vitals check but inadequate for palliative care coordination. Families need to track bowel movements, fluid intake, breathlessness scores, feeding tolerance, seizure counts, weight, and many other condition-specific daily observations. These must use plain-language prompts and family-friendly input types, not clinical forms.

IDRequirementStatus
REQ-OBS-01An observation_types table stores the definition of each trackable observation: display name (plain language), input prompt, input type (slider 0–10, dropdown with options, number field, yes/no toggle), optional unit, and display order. System-wide observation types (tenant_id IS NULL) are defined by packs; tenant-scoped types are custom-created by the family.Done
REQ-OBS-02A patient_observations table stores one recorded value per observation type per patient per date (multiple per day allowed where appropriate). Columns: tenant_id, patient_id, observation_type_id, recorded_by, date, recorded_time, value_text, value_number, value_boolean, notes.Done
REQ-OBS-03The daily observations entry form presents active observation types for this patient as a structured card list in family-friendly language. Input types render as appropriate UI elements: sliders for pain/breathlessness, dropdowns for categorical observations, number fields for weight/fluid/distance, toggles for yes/no.Partial — /observations dashboard
REQ-OBS-04Observation type labels must not contain medical abbreviations. Wherever a score is requested, the label must explain the scale: e.g. “How hard was it to breathe just sitting still? (1 = easy, 5 = very hard)”. This is a content rule enforced in the pack seeding data and the family-language standard.Done (seed data)
REQ-OBS-05Per-patient observation dashboard: one trend line chart per observation type over the selected date range. Any observation type that has been recorded at least once for a patient is shown. Exportable as part of the care summary report.Partial — trend API + chart component; export Future
REQ-OBS-06Families and admins may create custom observation types scoped to their tenant. Custom types have the same schema as pack-seeded types. Family-language compliance is strongly recommended in the admin UI but not enforced on custom types.Future
REQ-OBS-07Observation entries are subject to REQ-AUD-01 audit trail. Soft-delete only — no hard deletion of clinical observation records.Done
REQ-OBS-08The custom_observations module is gated at Family and Complete tier. A family on Essential sees a locked module card with an upgrade CTA consistent with the existing ModuleGate pattern.Done
REQ-OBS-09Observation cards — multi-card layout. The daily observations entry view renders 2–3 cards simultaneously on mobile (vertical scroll), a 2-column grid on tablet, and a 3-column grid on desktop. Cards are not paginated one-at-a-time. Carers fill cards in any order. Each answered card remains visible in a completed (softened + tick) state so the carer sees at a glance what has and has not been filled in.Done — /observations
REQ-OBS-10Multi-entry per day. Each observation card shows an “Add another reading” link once answered. Tapping it creates a new patient_observations row for the same observation_type_id and date with a new recorded_time (defaults to now, editable). Intraday multiple entries are displayed as individual data points on the trend chart at their actual recorded times.Done (API)
REQ-OBS-11Bollinger-style trend banding. The per-observation trend chart renders: a rolling N-day average (centre line, default 14-day window); upper band (mean + 1 SD); lower band (mean − 1 SD). Bands self-calibrate to the individual patient’s history. A single out-of-band reading generates a yellow care alert; two consecutive out-of-band readings on the upper band generate an amber alert. Alert thresholds configurable per observation type.Partial — chart + bands; alert wiring Future
REQ-OBS-12Post-capture summary card. After completing a set of observations, a summary card appears below the filled cards showing all entries grouped by recorded time. “Edit anything” scrolls back to the cards; “All looks good” dismisses and returns to dashboard. Out-of-band alerts appear inline in the summary before action buttons. Summary is a confidence check — data is already saved; dismissal is not required.Done — /observations
REQ-OBS-13Daily self-care observation types (system seed). Six core selfcare_* types per 35 §3.6.1: bathing, grooming, dressing, toileting, eating, mobility — each value_type='choice' with shared independence scale (independent / some_help / full_help / not_today). Extended Tier-2 types per §3.6.2 where pack matrix requires. Seeded in V008; not a separate module slug — uses existing observation_types + patient_observations. Family UI group label Daily self-care — never “ADL” (REQ-I18N-17).Done — V008 on dev and VPS
REQ-OBS-14Care Start enables self-care checks. apply_care_start_pack() links pack-appropriate §3.6 types via pack_observation_type_links. Care Start preview shows count line (e.g. “6 daily self-care checks”) alongside reason types and observations. No standalone ADL SKU — bundled in Care Profile.Done — apply + links on dev and VPS
REQ-OBS-15Optional baseline week. First seven days after Care Start apply, /observations may show a one-time soft prompt to record each enabled self-care domain once — skippable; not required for pathway or alerts.Future
REQ-OBS-16Self-care trend summary for coordination surfaces. Per enabled domain: 14-day direction arrow (stable / worsening / improving) derived from independence scale ordinals; worst domain today on dashboard mini-summary and shift handover snippet when observations module active. Feeds pathway nudge engine (REQ-PATH-31) — does not raise care alerts on its own.Future
REQ-OBS-17Katz proxy (export only). Backend may derive Katz loss-band summary from self-care observations for MDT PDF / care_intelligence export (R3). Never displayed to families; no auto-stage assignment.Future

Background: Families coordinating the care of a seriously ill person often have other household and family responsibilities running in parallel — healthy children, elderly parents, domestic tasks. There is currently no mechanism for a family member to signal they need help and for other care circle members to volunteer. This feature brings the care circle’s capacity to help to the surface, reducing isolation and distributing load.

IDRequirementStatus
REQ-HELP-01A family_help_requests table stores requests: tenant_id, patient_id (optional context), requested_by_user_id, request_type_id, description (free text note), requested_for_date, requested_for_time (both optional), status (open / taken / completed / cancelled), taken_by_user_id (NULL when open), taken_at, completed_at, created_at.Done
REQ-HELP-02A help_request_types table stores the library of request types: tenant_id (NULL = system default), name, category, icon_slug, display_order, active. System default types are seeded at migration time (see REQ-HELP-03). Tenants may add custom types.Done
REQ-HELP-03Default request type library (seeded at migration, 28 types across 5 categories): Children & school: school drop-off, school pick-up, after-school / childcare pick-up, sports event transport, school excursion help, homework help, school lunch preparation. Home: grocery shopping, meal preparation / cooking dinner, laundry, dishes / kitchen tidy, general house tidy, garden / outdoor maintenance, pet care. Errands: pharmacy / prescription collection, medical appointment transport, administrative help (forms/calls), bill payment assistance. Direct care support: company / sitting with the person in care, overnight care cover, weekend shift cover, respite cover (hours). Wellbeing: someone to talk to, spiritual or prayer support, financial guidance, meal delivery, transport to a personal appointment, other (free text).Done — V080 seeds 28 types; verified by SQL count 2026-05-26.
REQ-HELP-04Creating a help request: carer taps a request type from the library, optionally adds a date, time, and note, then confirms. The request is created with status = open. All other care circle members receive a care alert (new_help_request, dedup new_help_request:{id}) when the family help channel is enabled.Done — help_requests_service + alert_help_request after commit
REQ-HELP-05Volunteering / taking ownership: any care circle member can tap “I’ll do this” on an open request. This sets taken_by_user_id to the current user and status = taken. The open new_help_request alert is resolved; a help_request_taken alert is raised for the circle.Done
REQ-HELP-06A volunteer may un-volunteer (release ownership) up to 4 hours before the requested date/time. Un-volunteering resets the request to open and re-alerts all care circle members. After the 4-hour threshold, un-volunteering requires an admin to reassign.Future
REQ-HELP-07The request creator or any admin may mark a request as completed. Marking as completed generates a brief positive acknowledgement in the care alert feed: “[Request type] completed — thank you, [Volunteer].”Partial — complete API + audit shipped; completion acknowledgement alert not yet raised
REQ-HELP-08Help requests with a requested_for_date appear on the care calendar as a distinct entry type (distinct colour and icon from shifts, appointments, and tasks). In the calendar list/agenda view, help requests are grouped in a “Help needed” section per day.Future
REQ-HELP-09The Help Requests view shows three tabs: Open (unvolunteered), Taken (assigned), Completed (recent 30 days). Each request card shows: request type icon, description, requested date/time, requester name, and (when taken) the volunteer’s name and avatar.Done
REQ-HELP-10Help request entries are subject to REQ-AUD-01 audit trail. Status transitions (open → taken → completed / cancelled) are recorded.Done
REQ-HELP-11The family_help module is available at Family and Complete tiers. Essential tier sees a locked module card.Done
REQ-HELP-12UI standard: All request type labels use plain, everyday language. Icons are warm and approachable — not clinical. The “I’ll do this” button is prominent and affirming. The overall tone of the feature is mutual support, not task management.Done

7.39 Calendar — sections, filtering, and item ownership

Section titled “7.39 Calendar — sections, filtering, and item ownership”

Background: The care calendar currently shows shifts, tasks, and appointments in a single undifferentiated view. As new item types (handovers, help requests, clinical episodes) are added, the calendar needs a structured filtering model. Equally, key calendar items — appointments, help requests, shift tasks — need an ownership/volunteer mechanism so carers can signal who is handling what and the whole care circle can see it.

IDRequirementStatus
REQ-CAL-15Calendar section navigation pills. A sticky row above the calendar: [All] [Appointments] [Tasks] [Handovers]. Pills are scroll anchors — all sections stay visible; selecting a pill smooth-scrolls that section’s heading to sit under the sticky dock. “All” scrolls back to the month grid. This replaces the earlier “hide other types” filter design.Done — Calendar.tsx (handleCalFilterClick, computeRegionScrollTop, trailing scroll spacer)
REQ-CAL-16Calendar list view sections. In the agenda/list view (/schedule), items for each day are grouped into labelled sections: Care team & shifts, Appointments, Shift tasks, Handover notes, Help needed. Empty sections are hidden.Future
REQ-CAL-17Appointment ownership — “I’ll take them”. Each appointment entry has an “I’ll take them” (or “I’ll attend”) button visible to all care circle members when no owner is assigned. Tapping assigns escort_user_id on the patient_appointments table and sends a care alert to the rest of the care circle: “[Name] is taking [patient] to [appointment].” Assigned appointments show the owner’s name and avatar on the calendar entry.Future
REQ-CAL-18Shift task ownership — “I’ll do this”. In the shift task list, each task that is not yet assigned or completed shows an “I’ll do this” button. Tapping assigns assigned_to_user_id on the shift_tasks table. Assignment is visible to all care circle members with access to this patient.Future
REQ-CAL-19Help request ownership on calendar. Help request calendar entries (REQ-HELP-08) show the volunteer’s name when taken, or a prominent “Can you help?” CTA when open. Tapping the CTA from the calendar view triggers the take-ownership flow without leaving the calendar.Future
REQ-CAL-20Ownership visibility rule. For any calendar item type that supports ownership (appointments, shift tasks, help requests), the assigned person’s name and avatar are visible to all care circle members — not just admins. Unassigned items display a quiet “Nobody assigned yet” indicator as a low-priority nudge. The identity of the assigned person is never hidden.Future
REQ-CAL-21Dashboard week-at-a-glance. On Home, when care_calendar is enabled: a Monday–Sunday strip for the selected week with prev/next navigation, “Today” reset, carer initial chips (first letter of login username on profile colour), compact activity markers, single-line footer summary + “Open calendar” link (no wrap on mobile), tap day → /calendar?date=.Done — WeekAtAGlance.tsx, lib/weekGlanceHelpers.ts

7.40 Care Pathways — Planning Ahead (care_pathways)

Section titled “7.40 Care Pathways — Planning Ahead (care_pathways)”

Full specification in 33-CARE-PATHWAYS-MODULE.md. Illustrative UI: docs/01 - BUSINESS REQUIRMENTS/assets/planning-ahead-mockup.html (asset not currently in repo).

Background: Care Archetypes and Care Start address what to track each day; families also need a reflective, staged guide for what they might consider preparing as care changes — anticipatory medicines, equipment, wishes, crisis plans — without the system inferring clinical stage from medication data alone. Stages are informative and optional; placement is self-declared by any carer or admin after reading; undo is always available. Families may add their own topics to any stage; custom items are managed like curated cards (tasks, dismiss, ownership). Data trends may suggest reading a section, never auto-assign a stage.

IDRequirementStatus
REQ-PATH-01Fourth product layer: per-patient Care Pathway scoped to the patient’s Care Archetype — ordered stages (4–5 per archetype) with family-language narrative (R2), curated consideration cards, and family-added topics per stage. Canonical content in 33-CARE-PATHWAYS-MODULE.md §6.Future
REQ-PATH-02Dedicated UI surface at /planning-ahead — distinct from Home daily care and from Subscriptions Care Profiles browse. Calm Care design tokens; journey rail + stage list + stage detail.Future
REQ-PATH-03Stage self-declaration: after reading a stage, carer or admin may tap “Do you think you’re approaching this stage?” — highlights that stage and all prior stages for the whole care circle. Quiet attribution (user + date). Observers read-only. Raises shared care alert (pathway_stage_acknowledged, REQ-PATH-25) — only on this human action, never on data nudges.Future
REQ-PATH-04Stage undo: acknowledged stage may be reversed via “We’re not at this stage after all” — clears current and later highlights; restores previous placement or none. Does not delete planning tasks or card dismiss states. Audit trail required. Raises shared care alert (pathway_stage_undone, REQ-PATH-25) — only on this human action.Future
REQ-PATH-05Peer-level authority: any carer or admin with patient access may acknowledge or undo; system does not weight one user over another. Assumes family dialogue off-app.Future
REQ-PATH-06Consideration cards: each curated or family-added card offers Add to our tasks (prominent, shared) or Not for us right now (dulled ~55% opacity, still visible, reversible). No compulsory completion.Future
REQ-PATH-07Planning tasks: Add to our tasks creates a patient-scoped planning task (pathway_planning_tasks) listed in Planning Ahead; I'll take this on ownership with assignee visible to care circle (REQ-PATH-28); optional future sync to shift tasks / calendar.Future
REQ-PATH-08No pharmacological stage inference: medication frequency or PRN counts must not auto-assign stages (same drug, multiple intents).Future — policy
REQ-PATH-09Data nudges (navigation only): configurable rules may surface a single quiet banner linking to a relevant stage (e.g. breakthrough doses ↑ → read “Preparing for harder days”). Nudge dismiss snooze per user (7 days). Never auto-acknowledge stage.Future
REQ-PATH-10Discovery: More menu row; optional Home card when nudge active or pathway unset after 14 days; link from Subscriptions or observation summary when rule fires. Not primary bottom-nav tab (MVP).Future
REQ-PATH-11Archetype change: changing patients.archetype_id archives prior pathway state and starts fresh journey for new archetype. Operational/clinical data unchanged — REQ-CARE-START-04, Palliative §7.5.Future
REQ-PATH-12Clinical reference (internal): stages tagged with PCOC phase (R3) for export only; families see R2 titles only. GSF/SPICT/anticipatory-prescribing literature informs content, not UI labels.Future — content
REQ-PATH-13Not prescribing: all copy directs families to discuss with GP / palliative nurse / care team; no instructions to start syringe drivers, IV access, or controlled drugs without clinician.Future — content + clinical review
REQ-PATH-14Module gate care_pathways at Family and Complete tiers (same posture as condition_templates).Future
REQ-PATH-15API: GET /api/patients/{id}/pathway, stage acknowledge/undo, curated + custom card interest/dismiss/reset, custom card CRUD, task take/release/complete, suggestions dismiss — see 33 §10.Future
REQ-PATH-16Template tables pathway_stages, pathway_consideration_cards seeded per archetype; patient state in patient_pathway_state, patient_pathway_card_prefs, patient_pathway_custom_cards, patient_pathway_history, pathway_planning_tasks.Future
REQ-PATH-17REQ-AUD-01 audit on all pathway mutations (ack, undo, card prefs, custom items, planning tasks, ownership).Future
REQ-PATH-18MVP content: Archetype A (Medication Orchestra) full stage + card seed before B–G.Future
REQ-PATH-19Integration hooks: Key Contacts, Shopping (pharmacy consumables), Prescriptions (script photo from task), Medication dispensing (O₂ as supply-type med), Respiratory & oxygen (cylinder stock, hours — REQ-RO-06–08), future goals_of_care, equipment_management, REQ-RO-10 crisis plan. See 33 §8.2.Future
REQ-PATH-20Observer role: read all pathway content including family items; no acknowledge, undo, card actions, custom item CRUD, or task creation/ownership.Future
REQ-PATH-21i18n: all R2 strings externalised when I18N-P0 ships; seed neutral English first per Palliative §4.5.Future
REQ-PATH-22MDT export (future care_intelligence): include acknowledged stage (R2) paired with internal PCOC tag (R3).Future
REQ-PATH-23Depends on patients.archetype_id (V111 / C5b) for automatic archetype scoping; MVP may allow manual archetype pick on pathway screen if FK pending.Future
REQ-PATH-24Clinical + legal sign-off on stage/card seed before production SQL — see 33 §15.Pending
REQ-PATH-25Care alerts on stage placement change: when a carer or admin POSTs stage acknowledge (REQ-PATH-03) or undo (REQ-PATH-04), raise shared in-app alert via alert_service after commit — info severity, R2 copy in body, deep_link to journey or current stage, dedup_key pathway_stage:{patient_id} (one consolidated open alert per patient; latest human change upserts type/title/body/timestamp). Types: pathway_stage_acknowledged (body = stage title) and pathway_stage_undone (body = Stage selection cleared or Now: {current stage title}). Channel planning_ahead on tenant_notification_settings (default ON). Not raised for data nudges, card interest/dismiss, or system inference. See 33 §7.3.Future
REQ-PATH-26Family-added consideration items: any carer/admin may add custom topics to a stage (Add something for us — title, optional notes, optional Relates to category). Stored in patient_pathway_custom_cards; max 20 active per stage per patient (MVP). Creator or admin may edit; soft-delete with audit. Archived on archetype change. See 33 §5.4.Future
REQ-PATH-27Parity with curated cards: family-added items use the same Add to our tasks / Not for us right now prefs, task pipeline, and undo-survival rules as seed cards. Visual chip Added by your family only — never reduced interaction.Future
REQ-PATH-28Planning task ownership: open tasks show I’ll take this on; assignee name + avatar visible to all carers/admins (REQ-CAL-20 pattern). Assignee may mark done or hand back. Status open | taken | done. Optional care alerts on take/release — P2. See 33 §5.5.Future
REQ-PATH-29Operational bridges from planning tasks: optional link_module on cards/tasks exposes Next steps deep links (e.g. O₂: photograph script → prescriptions, add to medications at dispensing level with L/min + litres per cylinder, track cylinder stock and daily hours via respiratory_oxygen). Bridges are user-confirmed offers — no inference from free-text title alone. Complete-tier modules gated per subscription. See 33 §8.2.Future
REQ-PATH-30Functional snapshot on Planning Ahead. Journey overview (/planning-ahead) renders a Functional snapshot panel — 14-day self-care trend summary from REQ-OBS-16 — separate from the journey rail Where we think we are (human-declared stage). Copy is observational (“Bathing has needed more help lately”) — not prognostic.Future
REQ-PATH-31Self-care nudge rules. Configurable rules per 33 §7.1 and §7.4 may surface a single quiet banner linking to a relevant stage to read. Threshold example: domain worsens ≥7 of last 14 days vs prior 14-day baseline. Archetype-specific weights apply. Navigation only — snooze 7 days per user (REQ-PATH-09).Future
REQ-PATH-32No self-care stage inference. Self-care observation trends must not auto-acknowledge, auto-assign, or display inferred stage placement — same policy as REQ-PATH-08 for medications. Only human acknowledge/undo raises pathway care alerts (REQ-PATH-25).Future — policy
REQ-PATH-33Observation ↔ pathway bridge. Post-capture summary (REQ-OBS-12) and /observations dashboard may show inline “You may want to read …” when an active self-care nudge exists — deep link to stage detail. Consideration cards may seed link_module custom_observations or observations_baseline for Daily self-care follow-through (33 §8.2).Future
REQ-PATH-34MDT export pairing. Future care_intelligence export includes acknowledged stage (R2) and self-care trend summary (14d worst domains + Katz proxy R3 if REQ-OBS-17 built). Operational bridges from planning tasks may deep-link to enabled self-care observation types.Future

Enforced server-side by backend/services/tier_limits.py and backend/billing/tiers.json. An HTTP 402 is returned when a limit is reached; the frontend renders <UpgradeGate>.

LimitEssentialFamilyComplete
People in care125
Carers (incl. admin)237
Observers127
Active medicines5UnlimitedUnlimited
Reason types5UnlimitedUnlimited
Add-on person+$5/yr+$5/yr+$5/yr

For the full per-function module availability matrix, see 23-SUBSCRIPTION-TIER-ENTITLEMENTS-MATRIX.md.


PostgreSQL 16 is the single source of truth. Schema changes go through numbered migration files (V###__description.sql); never through ad-hoc SQL in application code. backend/schema.sql is the canonical DDL baseline; migrations layer on top.

Key domain tables (non-exhaustive). Tables marked [Future] are not yet created; they require migration files before use.

DomainTablesStatus
Identity & authusers, tenant_memberships, tenants, invitations, mfa_secrets, pending_signupsBuilt
i18n & localisationtenants.locale column (e.g., en-AU, fr-FR); users.locale_override column (nullable — user-level override); operator_tenants table (operator tier: country codes, operator_tenant_id, billing config) [Future]Partial — tenants table exists; locale columns and operator table are Future
Patients & accesspatients, patient_access, care_groupsBuilt
Care calendarcare_shifts, shift_tasks, patient_appointmentsBuilt
Medicationsmedicines, reason_types, dispensings, medication_groups, schedule_items, dispense_batchesBuilt
Prescriptionspatient_scripts, script_fillsBuilt
Sleeppatient_sleep_intervalsBuilt
Vitalspatient_vitalsBuilt
Painpatient_pain_entries, patient_mind_entries, tenant_pain_settingsBuilt
Key contactspatient_contacts, contact_notes, contact_attachmentsBuilt
Shoppingshopping_lists, shopping_items, shopping_catalog, catalog_suggestionsBuilt
Care alertscare_alerts, care_alert_events, tenant_notification_settings (family_help channel V093)Built (V073, V093)
Billingstripe_tiers, stripe_tier_local_prices, subscriptions, stripe_customersBuilt
Audit & complianceaudit_log, tenant_onboarding_progress, schema_migrationsBuilt
Shift handovershift_handovers (linked to care_shifts; handover domain snapshots, urgent flag, acknowledged_by, acknowledged_at), shift_clinical_summaries (auto-populated roll-up per shift)[Future]
Care observationspatient_observations (daily multi-domain record per patient per date), observation_skin_sites (per-site entries linked to observation), observation_repositioning_log (timestamped repositioning entries per observation)[Future]
Therapy recordstherapy_sessions (session metadata, tolerance, pain score), therapy_home_program_items (prescribed items per session), therapy_home_program_logs (carer completion entries per item per day), therapy_goals (named goals with status and target date)[Future]
Equipment managementpatient_equipment (item register with service schedule and status), equipment_notes (per-item observation log), equipment_funding_refs (funding scheme and reference number per item)[Future]
Goals of carepatient_goals_of_care (immutable versioned documents; superseded flag; attachment metadata), goals_of_care_escalation_steps (ordered trigger → action pairs per document), goals_of_care_attachments (uploaded documents linked to a goals-of-care record)[Future]
Clinical episodesclinical_episodes (episode type, dates, location, outcome, narrative), episode_medication_links (medication changes linked to an episode)[Future]
Caregiver wellbeingcarer_wellbeing_checkins (post-shift self-reports per carer; private flag), carer_respite_periods (scheduled respite with coverage notes)[Future]
Patient voicepatient_self_reports (daily self-reported pain, mood, note; entered_by_user_id), patient_participation_logs (social/school participation records), patient_preferences (one record per patient; preferences document)[Future]
Care intelligenceViews and materialised aggregates derived from existing tables; no new base tables required beyond those listed above.[Future]
Respiratory & oxygenpatient_respiratory_assessments (MRC/breathlessness/cough/fatigue daily entries), patient_exertional_performance (walking distance, recovery time, post-exertion SpO₂ per activity), patient_oxygen_prescriptions (versioned prescribed regime), patient_o2_daily_use (compliance log), patient_cylinder_stock (stock level, reorder threshold), patient_o2_safety_checklists (per-shift safety confirmations), patient_breathlessness_crisis_plans (versioned operational plans)[Future]
Behavioural eventspatient_behaviour_events (type, date/time, phase-of-day, trigger, severity, duration, intervention, outcome, PRN administered flag)[Future]
Care protocolspatient_care_protocols (named protocols with ordered steps, tips, avoid-list, version history), patient_calming_strategies (per-patient list), patient_familiarity_record (identity and personal history notes)[Future]
Observational painpatient_observational_pain_assessments (multi-domain scored entries; composite score; assessor attribution)[Future]
Swallowing safetypatient_swallowing_classifications (versioned — each change creates a new record), patient_meal_observations (per-meal coughing, duration, intake, aspiration events)[Future]
Falls trackingpatient_falls_events (date/time, location, circumstances, witness, near-miss flag, injury level, response, environmental note)[Future]
Cognitive statuspatient_cognitive_assessments (orientation domains, recognition, follow-instructions; delirium flag distinct from baseline)[Future]
Family journalpatient_journal_entries (freeform text, optional photo attachment URL, tag, author user_id), patient_journal_acknowledgements (user_id, entry_id, timestamped)[Future]
Preventive carepatient_vaccinations (vaccine name, date, given-by, batch number, next due date), patient_preventive_checks (health assessment type, date, provider, next due date)[Future]
Frailtypatient_frailty_assessments (Rockwood CFS score 1–9, date, assessor, notes)[Future]
Condition templatescondition_archetypes, condition_packs, pack_reason_types, pack_shift_tasks, tenant_pack_purchases, observation_types, patient_observations, pack_observation_type_links, patients.archetype_id, care_profile_slug, care_start_applied_at, patient_applied_care_profiles, patient_shift_task_templatesPartial — V006–V010 + apply on VPS; open C1d + prod paid pack checkout (see 35 §7)
Family help requestshelp_request_types, family_help_requestsBuilt (V080)
Care Pathways (Planning Ahead)pathway_stages, pathway_consideration_cards, patient_pathway_state, patient_pathway_history, patient_pathway_card_prefs, patient_pathway_custom_cards, pathway_planning_tasks, patient_pathway_nudge_dismissals; alert channel planning_ahead on tenant_notification_settings (planned V115)[Future] — spec in 33-CARE-PATHWAYS-MODULE.md; D31
Pain body map extensionpatient_pain_entries.body_layer — surface, skeleton, front-skeleton, back-skeleton (V082, V092)Built
Stream 5 clinical (schema only)Tables from V083–V088 — goals of care, frailty, behaviour, PAINAD, swallowing, falls, respiratory, therapy, equipment, journal, care intelligenceSchema only — no routers

Row-Level Security policies (V034) enforce tenant isolation as a database-level backstop on all PHI tables. All new tables above must be covered by RLS policies before use in production.


  • Investors / product stakeholders: Sections 1–3 describe the business, the market, and the full feature set. Section 8 maps features to commercial tiers.
  • Engineers: Implement Done items consistently with 01-ARCHITECTURE.md and 05-DEVELOPER-GUIDE.md. For Future items, check 04-ROADMAP.md and the relevant module spec before coding.
  • Reviewers: Any change that weakens REQ-SEC-01, REQ-AUD-01, or NFR-7 is a security or compliance regression and requires explicit acceptance.
  • AI agents: Do not assume monorepo packages/core or TanStack Query. Eleven product module routers are active (§2.2) — verify against backend/routers/ and frontend/src/pages/ before changing behaviour. Stream 2–3 modules may have backend/API complete but frontend routes not yet wired. The require_module() dependency and ModuleGate are the canonical enforcement points; never bypass them. /api/v1/ exists as an alias but the SPA may still call /api/.

DateChange
2026-08-06v3.33 — Native store clients commerce posture. §7.36: website Stripe SoT; Play/App Store free consumption-only clients; Play-first then iOS; REQ-NATIVE-08…12; design native-store-clients.
2026-08-06v3.32 — BR docs consolidation. Care Start / template REQ statuses aligned to VPS 2026-06-04; catalogue canonical path 35-CARE-PROFILE-CATALOGUE.md; /observations partial status corrected.
2026-06-04v3.26 — Non-destructive archetype correction. REQ-CARE-START-04; REQ-PATH-11 cross-ref. Canonical policy Palliative §7.5 v2.6.
2026-06-04v3.25 — Daily self-care checks + pathway functional patterns. Added REQ-OBS-13..17 (§3.6 self-care types, Care Start seed, trend summary, Katz export-only); REQ-PATH-30..34 (functional snapshot, self-care nudges, no inference, observation bridges, MDT pairing). REQ-CARE-START-02 extended to §3.3–3.6. REQ-COBS-06 note: self-care via REQ-OBS-13. Catalogue: Palliative §3.6; pathway rules: 33 §7.4.
2026-06-04v3.24 — Care Pathways (Planning Ahead). Added §3.13, §7.40 REQ-PATH-01–29, REQ-MOD-28 (care_pathways), §9 schema row, §2.2 Future module row. Full spec 33-CARE-PATHWAYS-MODULE.md; roadmap D31 04 §10.5. Not implemented — no code in this release.
2026-06-02v3.22 — Care Archetypes v2.0 consolidation. §3.10 and §7.36 updated: canonical twelve Care Profiles + Care Start apply restored (REQ-TMPL-02/03/08/12); REQ-CARE-START-01..03 added. Palliative Care Archetypes.md is single source of truth for pack slugs.
2026-05-30v3.21 — Calendar scroll anchors + dashboard week glance. REQ-CAL-15 updated to Done (sticky scroll-anchor pills — All / Appointments / Tasks / Handovers; all sections stay mounted). Added REQ-CAL-21 Done (WeekAtAGlance, carer initial chips, single-line mobile footer). Design-system pointer on line 8 now references canonical 03-DESIGN-SYSTEM.md. §2.2 partial-features blurb refreshed (removed stale REQ-CAL-15 cosmetic note).
2026-05-29v3.19 — REQ-MED-15 active-patient isolation sweep. Extended REQ-MED-14 beyond pickers to every aggregate/export/audit surface after a reproduced homepage leak (Mum’s medication trends visible in Peter’s CareView). Added optional validated patient_id to all /api/analytics/*, /api/alerts/open-count, /api/billing/export/download, and /api/audit; Dashboard + Analytics + alerts inbox/badge now pass the active patient and refetch on switch. Export is per-selected-person; audit tab defaults to the selected person with an admin “All people” toggle (audit_log.patient_id, migration V099). Also hardened the dispensing-POST script_id↔patient_id consistency check. Plan: docs/plans/2026-05-29-active-patient-isolation-sweep.md; regression backend/tests/test_patient_analytics_isolation.py (8 tests).
2026-05-29v3.18 — REQ-MED-14 patient-scoped medicines list. Added REQ-MED-14: every medicine picker / row matrix / dropdown in a patient-scoped page must restrict to medicines used by the active patient (union of scripts + schedule items + dispensings). Driven by a reproduced cross-patient leak on /medication-schedule where row labels were sourced from the tenant-wide GET /api/medicines (verified 2026-05-29 14:55 by backend/tests/test_medicines_cross_patient_leak_repro.py). Fix scope: new GET /api/patients/{patient_id}/medicines + frontend swap on Schedule, LogDose, Dashboard, History, Settings. No DB schema change. Full per-patient medicines.patient_id migration (“Option B”) explicitly deferred — see plan §11.
2026-05-28v3.17 — Pain & Stats body/bone separation hardening. REQ-PAIN-11 implementation note extended with the 2026-05-28 fixes: GET /pain now returns body_layer (regression-tested), PainBodyMapTab layer-filters map entries so body and bone surfaces render independent record sets, “Today’s Pain Entries” list split into Body Pain + Bone Pain sections, carry-forward preserves body_layer, and Body ⇄ Bone cross-fades over ~300 ms. Full detail in 26-PAIN-STATS-MODULE.md §4.1 (Layer separation), §6, §11 (follow-up fix), §12. REQ status unchanged (stays Done).
2026-05-28v3.16 — Export ZIP simplified. Removed checksums.csv from export bundle; §4.6 and REQ-BILL-17 aligned.
2026-05-28v3.15 — Export v2.1 CSV-only. §4.6: ZIP contains CSV tables only (no category JSON); export_info.csv; team category excludes pending invitations; prescriptions export flat prescription_fills.csv. REQ-BILL-17/19 wording updated.
2026-05-28v3.14 — Export address suppression. §4.6: physical addresses never exported in plaintext; stored addresses replaced with address suppressed for privacy reasons in recipients, schedule (appointments), and contacts. export_privacy.export_address(); manifest address_rule.
2026-05-28v3.13 — Export format v2.0. User-facing archive (export_v2.py): 12 categories, denormalized payloads, no internal IDs in manifest, SHA-256 checksums. Excluded: shopping, mind, care alerts, notification toggles. Legacy v1 API keys mapped; removed keys ignored. REQ-PLAT-11 targets v2.0 import.
2026-05-28v3.12 — Phase F3 export shipped (code verification). REQ-BILL-16, 18, 19, 20 → Done; REQ-BILL-17 → Partial (no attachment binaries, manifest checksums/schema level, module auto-filter). NFR-9 updated. Implementation paths in §4.6. 04-ROADMAP.md F3.2–F3.6 Done; F3.7–F3.8 Future.
2026-05-28v3.11 — Tenant data export requirements (Phase F3). New §4.6 export privacy pseudonymization: Patient/Carer/Administrator ordinals, email masking (first 5 + *** + last 5), short-email rule, DOB year-only. Added REQ-BILL-16..20 (export ZIP, cancel-dialog download, audit/rate limit), REQ-BILL-21 (cancellation purge Done). REQ-PLAT-11 import Future. NFR-9 notes export rules. 04-ROADMAP.md Phase F3 added.
2026-05-26v3.9 — Gap-analysis reconciliation (Option C). REQ-ENC-01..05 + NFR-13 moved Future → Partial (V091 in production 2026-05-22; outstanding: per-tenant DEK envelope, users.full_name/phone, patients.preferred_name, T&C operator-blindness claim). REQ-BILL-06 marked Removed with V049 evidence and pointer to rewritten doc 24 §4. REQ-MED-06/08 corrected to Partial (filters always visible; carer filter not built). REQ-CAL-15 corrected to “cosmetic only”. REQ-SHOP-04 clarified: shift widget not imported anywhere. REQ-PAIN-11 implementation note (three-pill UI shipped, four-pill spec). REQ-PAIN-12 confirmed Future with C8 cross-reference. REQ-HELP-03 status updated to “28 types in V080”. REQ-MOD-01 changed from “Eight” to “Eleven”. REQ-MOD-04..22 marked Partial (schema only) for V083–V088 — routers and UI not built. REQ-TMPL-09 clarified (alert stub). REQ-TMPL-11 moved Done → Partial (backend only). §7.15 IDs renumbered REQ-OBS-01..10 → REQ-COBS-01..10 to resolve collision with §7.37. §2.2 Known partial features list refreshed to match.
2026-05-25v3.7 — Care alerts hardening. §3.1 and §7.11: nine channels (family_help V093), overdue-dose sweep on real med schema, dispense auto-resolve, observer 403 (REQ-ALERT-07). §3.12 / REQ-HELP-04–05: help alert scheduling fixed; REQ-HELP-07 completion alert marked Partial.
2026-05-25v3.6 — Code review alignment. §2.2 expanded to 11 modules with honest Partial status for Stream 2–3 frontend wiring gaps. §3.10–3.12 added. REQ-MOD-24–27, REQ-TMPL/OBS/HELP statuses updated from Future to Done/Partial. §9 schema tables marked Built for V077–V080. Broken architecture doc links fixed. Module specs 27–29 created.
2026-05-21v3.5 — Skeleton body map, Family Help Requests, Calendar ownership. Added REQ-PAIN-11 (skeleton body view — 4th pill: Front/Back/Skeleton/Mind; 15 bone regions; body_layer discriminator) and REQ-PAIN-12 (body map observation layers — stiffness, skin/pressure, swelling). Added REQ-OBS-09–12 (multi-card layout, multi-entry per day, Bollinger banding, post-capture summary). Added §7.38 Family Help Requests (REQ-HELP-01–12): 28-type default library, volunteer/ownership flow, calendar integration. Added §7.39 Calendar sections and item ownership (REQ-CAL-15–20): filter pills, agenda sections, “I’ll take them” / “I’ll do this” ownership on appointments/tasks/help requests. Added REQ-MOD-27 (family_help). Updated §9 schema.
2026-05-21v3.4 — Condition Template Packs and Care Archetypes. Added §7.36 Condition Care Profiles & Template Packs (REQ-TMPL-01–12): 7 care archetypes, 10 condition pack definitions, seeding mechanism, Stripe one-time purchase integration, and plain language standard. Added §7.37 Condition-Specific Observations (REQ-OBS-01–08): observation_types and patient_observations tables. Added REQ-MOD-24–26. Updated §9 schema. Full spec in Palliative Care Archetypes.md.
2026-05-21v3.3 — REQ-NATIVE-03 aligned with care alerts. Native push described as optional mirror of open care_alerts (APNs/FCM); PWA stays in-app + badge; no VAPID revival.
2026-05-20v3.1 — pre-launch code review resolutions. Updated REQ-SHOP-04: ShoppingDashboardWidget now wired into Dashboard.tsx behind shopping module gate (still Partial — shift widget pending). Updated §2.2 known-partial note and §3.8. Updated NFR-3 to note lib/types/care.ts extraction (Phase 0 H-07 pass 1) and OpenAPI schema CI gate.
2026-05-19v2.8 — code-aligned implementation snapshot. Added §2.2 implementation table (eight modules, gates, routes, care_services legacy note, /api/v1 aliases, PWA/offline partial state). Corrected REQ-SHOP-04 and §3.8 shopping widgets to Partial (components not wired). Updated §5 API contract and NFR-2 for additive /api/v1 and dose-only syncQueue. Clarified REQ-MOD-03 (care_services not in tiers.json). Declared this doc master for sibling specs in this folder.
2026-05-18v2.7 — PWA install prompt, native app strategy, and type generation. Updated §2 to note the Capacitor native app build as a planned future deliverable and the OpenAPI type generation migration. Added REQ-ONBOARD-04: unified iOS/Android PWA install prompt — iOS step-by-step bottom sheet with push-notification hook headline and native Share button icon; Android beforeinstallprompt intercept with native dialog trigger; appinstalled event detection; localStorage-backed 7-day snooze and permanent dismiss; BeforeInstallPromptEvent local type declaration in pwa.d.ts; manifest completeness prerequisite for Android. Added §7.36 Native App Strategy: REQ-NATIVE-01 (strategic trigger conditions for initiating the native build — 500 MAU threshold, push notification impact, operator requirement); REQ-NATIVE-02 (Capacitor wrapper as preferred first path — no frontend rewrite, plugin substitutions for push/camera/storage, 2–4 week estimate); REQ-NATIVE-03 (push notification infrastructure migration — dual VAPID/APNs/FCM delivery paths on user_push_subscriptions, delivery_type column); REQ-NATIVE-04 (App Store listing compliance — Apple §5.1/§5.1.3, Google Play health policy, no medical device claims); REQ-NATIVE-05 (HealthKit/Health Connect integration post-native — wearable vitals import, source: health_platform flag, excluded from compliance exports); REQ-NATIVE-06 (architecture preservation rules — relative API URLs, tokenStore only, no blob: URIs, capability-checked browser globals, safe-area insets maintained); REQ-NATIVE-07 (React Native evaluation gate — written assessment required, no work without sign-off). Added REQ-PLAT-10: OpenAPI-driven frontend type generation — openapi-typescript generates api.types.ts from FastAPI /api/openapi.json; CI gate fails on schema drift; progressive migration path; no-explicit-any rule enforcement during migration.
2026-05-18v2.6 — requirement ambiguity resolution pass. Identified and expanded every requirement too thin to build from without interpretation. REQ-CAL-08 split into REQ-CAL-08a (shift cover request workflow: needs-cover flag, eligible carer push notification, volunteer-and-confirm flow) and REQ-CAL-08b (care provider directory: tenant-maintained external provider address book, distinct from Key Contacts). REQ-CAL-09 expanded to specify supported RRULE patterns (daily/weekly/fortnightly/monthly/custom), end conditions (no-end/N-occurrences/date), three-option edit/delete behaviour (this occurrence / this and future / entire series), recurring chip visual indicator, and RRULE storage approach. REQ-AUTH-11 expanded to specify platform-level scope (not per-tenant), INVITE_ONLY_REGISTRATION environment variable control, effect on registration form and Stripe Checkout path, and use cases (private beta, operator-gated markets, enterprise). REQ-MED-13 expanded to specify automatic shift-linkage logic (active shift detection), shift_id/carer_id population rules, dose history display, downstream use by REQ-CAL-13 shift summaries and analytics filters, and historical backfill path via audit_log.performed_by. REQ-COG-04 corrected to resolve internal contradiction — carers/admins write, observers view only. All Future module “full audit trail” requirements (REQ-THERAPY-06, REQ-EQUIP-06, REQ-GOC-08, REQ-EPI-07, REQ-BEH-08, REQ-NVPAIN-05, REQ-SWALLOW-06, REQ-FALLS-07, REQ-RO-12, REQ-FRAILTY-04) expanded to reference REQ-AUD-01 explicitly and specify hard-delete policy and module-specific nuances (immutable records, supersede patterns, legal retention reasons).
2026-05-18v2.5 — plain language design principle, translation quality strategy, and language roadmap. Refined NFR-11 to formally separate the translatable frame (platform-generated strings) from user-entered content (stored as-is, never translated by the platform). Updated NFR-12 to add dir="auto" on text inputs for user-typed RTL content. Added REQ-I18N-02a dual-key convention (key plain / key_clinical clinical per string). Added §7.35.7: plain language default principle; clinical view toggle (user-level setting, off by default); (i) info button pattern (mobile tap = bottom sheet, desktop = popover hover/click); user-entered content direction (dir="auto"). Added §7.35.8: three-tier translation quality strategy — Tier 1 UI chrome (professional software translator), Tier 2 plain clinical language (professional translator + native lay-carer review + clinical professional sign-off), Tier 3 standardised clinical scales (validated official translations only, English fallback if unavailable); note on Latin/Greek clinical term universality reducing clinical-toggle translation complexity. Added §7.35.9: supported language roadmap table — Wave 1 launch (English variants, French, Spanish, Dutch, German, Italian, Portuguese, Russian), Wave 2 expansion (Arabic + RTL, Hindi, Japanese), Wave 3 (Korean, Traditional Chinese); Simplified Chinese held pending data-sovereignty assessment. Updated §1.8 to note Japanese as highest-priority Wave 2 addition and flag Korean and Traditional Chinese as Wave 3.
2026-05-18v2.4 — internationalisation and multi-country architecture. Added NFR-11 (i18n framework — no code changes to add a new language) and NFR-12 (RTL layout readiness using CSS logical properties). Added §7.35 Internationalisation and Localisation: §7.35.1 core i18n framework (react-i18next, namespace structure, fallback chain, TypeScript key safety); §7.35.2 locale config (locale config file structure, language-variant inheritance, date/time/number formatting via Intl APIs, regional terminology overrides); §7.35.3 tenant and user locale settings (per-tenant locale, per-user override, backend localisation for notifications/errors); §7.35.4 RTL layout readiness; §7.35.5 new-country operational checklist (8-step process, zero code changes for steps 1–5); §7.35.6 country operator model (REQ-I18N-14–15: operator tenant tier, country-scoped distribution partner management console, subscriber tagging). Updated §1.8 with a note linking terminology table to locale config. Updated §9 schema with tenants.locale, users.locale_override, and operator_tenants table.
2026-05-18v2.3 — terminology normalisation for global market. Added §1.8 Terminology and Regional Equivalents — a reference table mapping all platform-generic terms to their AU / US / UK / NZ / CA / IE equivalents (emergency services numbers, disability support funding schemes, pharmaceutical benefits programmes, accident compensation schemes, aged care funding, care roles, and legal documents). Renamed UC-06 from “NDIS disability support coordination” to “Disability support coordination” with a jurisdiction-neutral description. Replaced all hardcoded regional terms throughout requirements: NDIS → disability support funding scheme (free-text); PBS/TAC → generic funding source; “call 000” → “call local emergency services” in REQ-GOC-02 and REQ-RO-10; NHS/Cleveland Clinic clinical ranges noted as representative international references, not jurisdiction-specific advice. Added engineer note in §1.8 that funding-scheme fields must be free-text in code, never hardcoded enums.
2026-05-18v2.2 — IPF and dementia use case expansion. Added UC-07 (elderly respiratory palliative care / IPF) and UC-08 (advanced dementia palliative care) to §1.7. Enhanced §7.18 Goals of Care with REQ-GOC-09–15: ICU preference, intubation preference, NIV preference, preferred place of care, preferred place of death, artificial nutrition preference, antibiotic/active treatment preference. Enhanced §7.16 Therapy Records with REQ-THERAPY-07: respiratory physiotherapy metrics (Borg pre/post, walking distance, recovery time, post-exertion SpO₂). Enhanced §7.20 Caregiver Wellbeing with REQ-CW-06: carer equipment competency record. Added ten new Future module sections: §7.25 Respiratory & Oxygen Management, §7.26 Behavioural Events, §7.27 Care Protocols & Person-Centred Guide, §7.28 Non-Verbal Pain Assessment, §7.29 Swallowing Safety, §7.30 Falls Tracking, §7.31 Cognitive Status Assessment, §7.32 Shared Family Narrative, §7.33 Preventive Care & Vaccinations, §7.34 Frailty Assessment. Added REQ-MOD-13 through REQ-MOD-23. Updated §9 database schema with all new domain tables.
2026-05-18v2.1 — palliative & complex care gap analysis expansion. Added §1.7 Use Cases table (UC-01 through UC-06) mapping personas to built and future modules. Enhanced REQ-CAL with structured handover requirements (REQ-CAL-10–14). Enhanced REQ-VITALS with expanded vital sign types, context notes, and configurable alert thresholds (REQ-VITALS-06–08). Enhanced REQ-CONTACTS with MDT team view, appointment linkage, and escalation protocol per contact (REQ-CONTACTS-06–08). Enhanced REQ-PAIN with symptom burden score, functional decline markers, cross-domain trend view, and deterioration detection (REQ-PAIN-07–10). Added eight new Future module sections: §7.15 Care Observations, §7.16 Therapy Records, §7.17 Equipment Management, §7.18 Goals of Care & ACP, §7.19 Clinical Episodes, §7.20 Caregiver Wellbeing, §7.21 Patient Voice & Social Participation, §7.22 Longitudinal Care Intelligence. Added new module slugs REQ-MOD-04 through REQ-MOD-12. Updated §9 database schema with Future table inventory for all new domains.
2026-05-18v2.0 — comprehensive rewrite. Added full business context (§1), commercial model with pricing (§1.4), Stripe billing requirements (§7.2), Key Contacts module (§3.7, §7.8), Vital Signs module (§3.6, §7.7), Push Notifications (§3.1, §7.11), MFA/TOTP (§7.1), PWA support (§7.1), onboarding checklist (§7.12), idle session warning, dark/light theme, patient appointments (§7.3), scan worker (§7.5), PgBouncer/Redis/read-replica (§7.14), marketing site and signup flow (§7.2), tier capacity table (§8), full database table inventory (§9), OWASP Top 10:2025 cleared (§4.1), RLS backstop (§4.2). Updated NFRs. Restructured all functional requirements with consistent ID scheme.
priorv1.x — original requirements document covering core modules without billing, contacts, vitals, notifications, or full commercial model.