Skip to main content

Canonical source: docs/architecture/feature-master-summary.md. This page is the published mirror.

Feature Master Summary — Data Activation, Hospital Twin & HDAP

One-page catalogue of the data-activation / decision-intelligence feature arc. For the deep design + gaps + rollout, read data-activation-twin-go-live-master.md (this is the index over it). Status as of 2026-06-04.

Where it sits (platform map)

ThingHomeReach
HORUS command center (lenses)@ever-medos/intelligence-kitsrc/horus//horus (route)
Hospital Decision Twin (one HORUS lens)…/horus/twin//horus?lens=twin · sandbox ?target=Twin
Twin decision-flow (ReactFlow)…/horus/twin/flow/inside the twin lens
HDAP — Health Data Activation Platform (admin)web/src/pages/admin/hdap/ + AdminRoutes.tsx/admin/hdap
Sync-health contract / upload@medos/integration-kitHDAP › Data Activation
Migration mapping review / crosswalks@migration-kitHDAP › Migration Review
Read-model + RPCs + edge fnsinfrastructure/medbase/(backend)

Feature catalogue

FeatureWhat it doesStatusKey files
Live twin calibration (A/B)Twin reads real read-model data (LOS, arrivals, occupancy, revenue, readmit, post-op) via a metric→RPC registry; fail-soft to seedShipped · deploy-gated for live datatwin/readers/index.ts; migs 20260604d, 20260604e
Agent fidelity labels (E)TwinAgent.dynamics (des/projection); UI badges "2 modeled (DES) · 5 projection"Shippedtwin/agents/*, TwinWorkspace.tsx
Sync-health emitter (C)Per-connector HMAC secret; in-cloud self-populate of readiness; air-gapped upload screenShipped · deploy-gatedingest-sync-health, mig 20260604f, integration-kit SyncHealthUpload
Migration onboarding (D)Crosswalk gap-report + mapping-review HITL gate (reds must be confirmed)Shipped@migration-kit/crosswalk/*
HDAP admin sectionHub (Bento) + Data Activation + Migration Review + Decision Protocols; nav categoryShippedsrc/pages/admin/hdap/*, AdminRoutes.tsx, SuperAdminDashboard.tsx
Management decision protocols7 governance protocols (readiness gate, live-vs-estimated, HITL chain, recommender-only AI, residency, mapping-confirm, escalation) + notes padShippedhdap/decision-protocols.tsx
HDAP ↔ HORUS wiringBidirectional: HDAP → /horus?lens=twin; HORUS header → /admin/hdapShippedhdap/index.tsx, HorusShell.tsx
Twin decision-flowReactFlow decision DAG: lifecycle spine (history/step-back) + sign-off gates (paint-next → approve); commit locked until the gate passesShippedtwin/flow/decision-graph.ts, DecisionFlow.tsx
Decision-flow persistenceDurable audit trail: status + sign-offs + append-only event log via a service-role edge fn; fail-soft to in-memoryShipped · deploy-gatedtwin/flow/persistence.ts, twin-decision, mig 20260604g
CN/AU market packs + adapters (F/G/I)medos-australia pack; CN/AU source-HIS adapter packs; AU Medicare/ECLIPSE connector — scaffolds, placeholders flaggedShipped (scaffold)market-packs/medos-australia/*, adapters/{neusoft,winning,bsoft,trakcare}/*, connector-packs/au-medicare-eclipse.json
Residency / compliance posture (H)CN (PIPL/CSL/DSL) + AU (Privacy Act/APP/NDB) posture; "verify with counsel"Shipped (doc)multi-country-residency-compliance.md

Migrations (all manual-deploy — medbase is not auto-applied)

MigrationAdds
20260604async model: sync_run · sync_event (hash-chain) · sync_health_aggregate · twin_readiness_v
20260604bbed_occupancy_spans view (twin capacity calibration)
20260604ctwin_* persistence (twin_initiatives, twin_signoffs, …)
20260604dtwin_metric_los_days() RPC
20260604ecalibration RPC suite (arrivals / occupancy / revenue / readmit / post-op)
20260604ftwin_rollup_sync_health() (in-cloud readiness self-populate)
20260604gtwin_decision_events (append-only decision audit)

Edge functions

FunctionRoleDeploy
ingest-sync-healthreceive de-identified SyncHealthSummary (HMAC, PHI guard) → sync_health_aggregatesupabase functions deploy ingest-sync-health
twin-decisionpersist a decision transition (status + sign-offs + audit event), service rolesupabase functions deploy twin-decision

Test inventory (45 jest/RTL, all green)

twin-engine.test.ts (16) · decision-graph.test.ts (7) · persistence.test.ts (3) · SyncHealthUpload.test.tsx (3) · gap-report.test.ts (3) · MappingReviewPanel.test.tsx (2) · market-pack-manifests.test.ts (7) · HdapHub.test.tsx (2) · DecisionProtocols.test.tsx (2). Plus esbuild parse + sandbox render checks (?target=Twin).

Deploy checklist (to activate live)

  1. Apply migrations 20260604a → 20260604g (psql / SQL editor).
  2. Deploy edge fns: ingest-sync-health, twin-decision.
  3. Seed per-connector sync-health secrets (coding_connectors module='sync-health').
  4. Seed a twin_initiatives row titled 'Cardiac step-down' to activate decision persistence.
  5. Ship frontend: push main → release (Vercel builds the release branch only).
  6. (CN/AU) stand up in-region stacks + load licensed terminology before any real-data use.

Still deferred (not auto-doable)

  • Per-role guard on /admin/hdap — needs the confirmed useAuth().user role-field shape (today: authenticated-only via ProtectedLayout).
  • Real licensed data for CN/AU (SNOMED-CT-AU, MBS/PBS, ICD-10-CN, YBM) + real connector endpoints + vendor schema verification.
  • In-region stacks (CN: China region + ICP + domestic LLM; AU: ap-southeast-2) + legal sign-off.
  • Live E2E per market once a region's stack + data are deployed.

Commit trail (origin/main, this arc)

feat(twin): live calibration RPCs (A/B) + agent fidelity (E)feat(sync-health): per-connector secret + in-cloud rollup + upload (C)feat(migration): crosswalk gap-report + mapping gate (D)feat(market-pack): AU pack + CN/AU adapters + connector + residency (F–J)feat(hdap): admin section + decision protocolsfeat(hdap): bidirectional HDAP↔HORUSfeat(twin): decision-flow (ReactFlow)feat(twin): persist the decision journey.