Hospital and Surgery Center Implementation Backlog
Remaining implementation work for the shared facility-operations app.
Purpose
This document tracks work needed to move the Hospital app from its current integrated foundation and surgical case workflow to production-ready facility operations. The master backend and API integration plan owns product scope and domain ownership. The workflow and settings gap-closure plan is the execution entry point for the remaining gaps, dependencies, and acceptance evidence. Its forward delivery sequence defines the approved journey-first order from the current merged foundation. The phase plans below retain their detailed workflow contracts and manual QA checklists.
The gap-closure plan has 20 local U-IDs, all 15 route mappings, and a settings-effect matrix. Its prerequisite register identifies the clinical, nursing, document-security, capacity, inventory, billing, and external-exchange decisions that block dependent implementation or release. Those U-IDs do not renumber master or phase units. Planning these gaps does not change the implementation states below.
Count a workflow as complete only when its backend contract and implementation, frontend HTTP adapter, authorization and facility isolation, audit behavior where required, automated tests, and manual QA are in place. A mock-backed screen is not an integrated workflow.
Delivery Update
PR 2642 merged theatre administration, readiness commands/gates, the reusable Inventory source, case-stock integration, and truthful live-source states. Earlier "local/current worktree/not merged" descriptions in historical plans do not describe current merge status. Deployment and acceptance must use the release record, including its explicit Billing-only CI exception.
PR 2701 merged U14 effective OT scheduling settings into docs/new-schema-design as 3f6eca9ddb:
versioned surgeon policy, weekly opening hours, maintenance blocks, backend
enforcement, and review flags for existing bookings. See the
developer contract and
manual QA. This does not complete
the missing clinical/source workbenches or grant pilot approval.
Approved Delivery Order
U3 private-document foundation is in PR 2746. It adds case-scoped private document APIs and typed transport, not the Lab/TPA workbenches. Uploads default off. Scanner-provider integration, approved retention/deletion behavior, D2 deployment verification, and manual acceptance remain open. Staging and production deployment remain blocked until the D2 storage/scanning gate is accepted. See Private Clinical Documents and its QA guide.
The next workflow has a focused U4 PDF-first Lab implementation plan. It covers the live workqueue, private report links, clinical review, replacement/freshness, readiness/OT enforcement, end-to-end tests, and manual QA at each unit boundary. U4 implementation and frontend API integration are complete locally in the same draft PR 2746. The candidate includes live queue/history APIs, immutable report links, source-safe clinical review and OT gates, PDF-first settings, typed UI, and retry recovery. See the developer contract and manual QA. Local API and authenticated Chrome journeys pass in both presets. The final scoped external follow-up completed with no findings. Do not mark U4 accepted until release QA is recorded. D2/D3 still govern deployment and clinical acceptance. See the release record for exact evidence, review limits, and remaining gates.
Build complete Surgery Center patient journeys before deeper Hospital 50 operations. Unit numbers below belong to the gap-closure plan; they are reference IDs, not a strict execution order. The existing unit contracts keep their file lists, tests, dependencies, and D1-D7 approval gates.
| Priority | Units | Deliverable and reason |
|---|---|---|
| 1 | U3 then U4 | Private documents followed by PDF-first Lab. A clean, reviewed report must affect the matching case's readiness and OT gate. No selected LIS or PACS is required. |
| Alongside 1, after U3 | U5 | Local insurance capture, private documents, and manual authorization review. Do not wait for an external TPA interface. |
| 2 | U6 then U7 then U8 | Canonical MAR, recovery care, and signed day-care discharge. U6 can start independently of Lab; U8 joins the document and nursing paths. |
| 3 | U11 | Pharmacy review linked to current medication orders and the existing confirmed Inventory source. Complete the Surgery Center clinical journey. |
| 4 | U12 then U13 | Real ward/room/bed resources, admissions, transfers, overnight care, discharge, and cleaning. Preserve existing active care. |
| 5 | U16 | Package coverage and source-backed charges. Surgery Center financial work can start after its source dependencies; it does not need to wait for ward implementation. Ward charges follow U13. |
| 6 | U17 | Approved external TPA exchange after local capture, financial context, and D7. Interface discovery can run earlier; missing network approval must not stop local capture. |
| 7 | U19 and final U20 | Source-backed reports/private exports and whole-product acceptance. Accept Surgery Center-only reports separately from ward or network reports when that scope is explicit. |
Three units progress with every applicable delivery, not as a final cleanup phase:
- U15 settings: connect each source mode to its actual capability, permissions, health, and backend behavior as that source ships.
- U18 dashboard: add a metric only when its source exists and its count, facility-local window, and access rules can be verified.
- U20 acceptance: add real-HTTP journey tests and manual QA at each delivery boundary. Final acceptance covers all 15 routes and all applicable settings.
The first combined clinical acceptance journey is case booking, reviewed Lab evidence, medication review, OT start, recovery, MAR, signed discharge, and stock reconciliation. MAR remains a day-one clinical release requirement, not a later enhancement. Clinical journey acceptance does not mean the whole product is complete: billing, reports, Hospital 50, external TPA, deployment, and owner approvals retain their own gates. Unsupported workflows must remain visibly unavailable; required missing sources must never become ready.
There are 14 remaining delivery units (U3-U8, U11-U13, U15-U19), plus U20 acceptance. U18 is already partial; U15/U18/U20 are delivered incrementally. The merged readiness framework, Inventory source/case-stock operations, and OT settings need release evidence, not replacement implementations.
Use the forward implementation plan and phase QA gates to select the next executable scope.
Current workflow status
See the workflow and settings audit for the full route/action inventory and the effect of each configuration setting. Capacity and integration planning fields do not activate live operations.
The completed case-and-OT plan is not completion of the full Hospital product. The master plan has ten implementation units. Its Units 1-3 cover the foundation, HTTP boundary, and case/OT workflow. Unit 10 isolates the remaining theatre administration UI; Units 4-9 cover the other workflows below. Unit numbers within individual phase plans are local to those documents. The phase plan documents are plans and QA contracts; their existence does not mean the work shipped.
| Workflow | State | What is live or missing |
|---|---|---|
| Hospital app context and facility configuration | Partial/live | Context and configuration read/write APIs are connected. RBAC and feature-flag administration remain in shell and Admin. |
| Surgical cases and OT scheduling | Live vertical slice | Case create/read/list/transitions, OT schedule, and booking writes use real APIs with facility scope, RBAC, RLS, audit, and tests. |
| Theatre administration | Merged through PR 2642; release QA pending | Settings create/edit and HTTP adapter use versioned writes. U14 extends policy and availability effects; deployment/manual acceptance remain separate. |
| Case readiness | U2 framework and U10 stock source merged through PR 2642; U4 Lab candidate in PR 2746; release gates open | Immutable approved policy versions, evidence/review/override commands, retry history, current-source gates, detail state, and live list filtering are implemented. U10 derives Inventory readiness from eligible holds, confirmed movements, and open actual-use obligations. U4 connects PDF Lab evidence to the same gates. Clinical checklist content, freshness, override authority, emergency rules, and active-case handoff still need approval. Pharmacy integration remains missing. See the framework guide, Lab guide, and QA checklist. |
| Lab operations and PDF results | U3/U4 implemented and locally tested in PR 2746; scoped review follow-up complete; release gates open | The candidate connects a PDF-first workqueue, private reports, explicit evidence links, clinical review, replacement/expiry, and current OT gates. Scanner-provider integration, retention/deletion, D2/D3 approval, deployment, and manual acceptance remain open. No LIS/PACS adapter is selected. |
| Pharmacy readiness and medication stock | Not implemented | No live pharmacy readiness adapter or internal stock-consumption workflow. Do not add retail dispensing. |
| Recovery stays and observations | Not implemented | The screen is mock-backed. There are no Hospital recovery persistence or APIs for assignment, observations, lifecycle, or discharge readiness. |
| MAR | Not integrated | Canonical medication request/administration records exist elsewhere, but Hospital has no connected MAR workflow for due doses, administer, hold, omit, and exceptions. Canonical reuse, structured dose occurrences, reasoned held/refused/missed outcomes, preserved corrections/performer/time, and separate stock confirmation were approved on 2026-10-11. Timing, PRN, units, correction rules, implementation, and clinical/nursing acceptance remain pending. |
| Peri-operative and discharge documentation | Not integrated | Case-linked procedure/anesthesia notes, canonical clinical-editor handoffs, and documentation clearance are missing. Unit 5 must resolve day-care discharge documentation without a ward admission or IPD Lite dependency. |
| Internal inventory consumption | U10 merged through PR 2642; release gates open | Case-owned needs and immutable commands join the source transaction. The live workbench has stock lookup, holds, custody, consumption, unused returns, corrections, pending-use reconciliation, and retry recovery. See Case Stock and manual QA. The scoped review loop is complete. Source pilot approvals and manual acceptance remain open. The merge used a Billing-only CI exception; it does not approve later CI failures. MAR, pharmacy review, charges, and dashboard metrics are not included. |
| Hospital 50 admissions and Bed Board | Not implemented | The Bed Board is mock-only. Strengthened canonical ward/room/bed/admission/encounter reuse, independent Hospital orchestration, separate recovery classification without duplicate occupancy, non-surgical care without cases, day care without ward admission, and preservation of active care were approved on 2026-10-11. Classification/counting, constraint and reconciliation evidence, cutover checks, and live admission/transfer/discharge/cleaning remain pending. |
| Lightweight TPA / insurance capture | Not implemented | The screen is mock-backed. No case-scoped insurance capture/review workflow exists. U3 adds a separate private document API and category policy, not insurance workflow integration. |
| Full ABDM/HCX exchange | Not implemented | Kulcare Integration/insurance owns discovery and onboarding, approved on 2026-10-11. The external contract is not selected. Connector, callbacks, retries, and exchange state machine remain unimplemented. |
| Package billing and charge capture | Not implemented | The workbench is mock-backed. Catalog/Billing ownership, preserved coverage/version, once-only source charges with no covered-item double charge, locks, explicit corrections/reversals, and Billing calculation/rounding were approved on 2026-10-11. Detailed coverage timing, source mappings, lock/correction rules, schema verification, implementation, reconciliation, and financial acceptance remain pending. |
| Dashboard | Partial; corrections merged through PR 2642 | The OT schedule can supply live cases. Recovery, MAR, and inventory metrics are not live. The dashboard uses facility-local today and labels missing metrics as not live. Deployment acceptance remains separate. |
| Operational reports and exports | Not implemented | The screen is mock-backed. No facility-scoped report APIs, permissions, export jobs, private downloads, or audit coverage exist. |
| Staff management | Out of scope | Role and permission management stays in shell. Staff rosters, shifts, attendance, payroll, and HR are not in the Hospital scope. |
The current QA seed creates four synthetic patients, procedures, cases, two theatres, and OT bookings. It does not create the other workflows. Seed visibility proves only that the case-and-OT records load; it does not prove that the Hospital workflow set is complete.
Screen audit
This table covers every registered Hospital route. “Live” means that the route uses an implemented backend endpoint in non-mock mode. It does not mean that every panel on the route is integrated.
| Route | Screen | Current data state | Remaining gap |
|---|---|---|---|
/hsp/dashboard | Dashboard | Partial live; OT schedule is live. Recovery, MAR, and inventory are labeled not live. | Add authorized live operational metrics and failure monitoring. |
/hsp/ot-board | OT Board | Live case list, schedule, theatre list, and booking writes. Merged theatre edits refresh the board. U14 adds current-rule review flags. | Release QA for theatre edits and U14; readiness integrations remain missing. |
/hsp/cases | Case list | Live list and theatre data. Merged U2 adds current-readiness filtering. | Clinical approval, release QA, and integrated evidence sources. |
/hsp/cases/new | New case | Live patient/procedure/surgeon lookup and case creation. | Complete case lifecycle and connected readiness sources. |
/hsp/cases/:caseId | Case detail | Live case, timeline, and OT data. Merged U2 adds versioned readiness commands. U10 adds live case-stock quantities and a case-preserving workbench link. Recovery, MAR, package, and TPA panels are not live. | Clinical approval, release QA, and the remaining case-linked workflows. |
/hsp/bed-board | Ward Bed Board | Mock only; live mode reports that it is not connected. | Implement Hospital 50 admissions and bed operations. |
/hsp/recovery | Recovery | Mock only; live mode reports that it is not connected. | Persist recovery stays, observations, and discharge state. |
/hsp/mar | MAR | Mock only; live mode reports that it is not connected. | Connect medication orders and administration records. |
/hsp/inventory | Inventory | Case-stock workbench merged through PR 2642; mock mode remains a separate prototype. | Complete source release gates and manual QA. |
/hsp/lab-readiness | Lab Readiness | Live U4 candidate, locally tested in both presets; old backends without the capability still show not connected. | Complete deployed manual QA and D2/D3 release gates. Scoped review coverage and limits are in the release record. |
/hsp/pharmacy-readiness | Pharmacy Readiness | Mock only; live mode reports that it is not connected. | Implement pharmacy readiness and internal stock integration. |
/hsp/tpa | TPA and Insurance | Mock only; live mode reports that it is not connected. | Implement capture, review, documents, and agreed external exchange. |
/hsp/billing | Billing Workbench | Mock only; live mode reports that it is not connected. | Implement package coverage, charge review, and posting. |
/hsp/reports | Reports | Mock only; live mode reports that it is not connected. | Implement facility-scoped reports and protected exports. |
/hsp/settings | Hospital Configuration | Facility context/configuration read/write and theatre create/edit are merged. U14 adds effective scheduling policy and windows. | Release and manual QA for theatre administration, configuration, and U14. |
PR 2642 also prevents mock-only pages from calling unsupported live API operations. They show an explicit not-connected state instead of a mock permission or service error. The deployed commit and acceptance evidence must be checked separately.
Implemented
- Facility context, preset configuration, and the Hospital HTTP/query boundary.
- Surgical case create, read, lifecycle transitions, theatre schedule, and OT booking.
- Backend theatre list/create/update endpoints, merged Settings create/edit, an opaque version contract, and current theatre checks during booking writes.
- Hospital settings integration for supported context and configuration fields.
- Case and OT security, audit, and telemetry for the implemented case/OT resource group.
See the API reference and QA guide for current details.
Remaining implementation
1. Theatre administration
- Release the current Settings editor, HTTP adapter, and conditional-update contract together. Older clients that omit the theatre version can no longer PATCH.
- Run the theatre QA checklist against the deployed build. Confirm persistence, two-tab stale edits, permissions, facility scope, audit, and booking safety.
- Do not mark this workflow complete until manual QA passes. Automated tests alone are not product acceptance.
2. Readiness integrations, Lab, pharmacy, and lightweight TPA
- Verify the U2 framework and manual QA checklist. Complete clinical approval D3 and the active-care handoff before deployment. Add integrated source writes, workqueues, and reconciliation next.
- Integrate Lab and pharmacy readiness with their owning systems. Do not make Hospital the source of detailed Lab or pharmacy records.
- Add lightweight insurance/TPA capture and review to the case workflow.
- Define retry, idempotency, failure, and stale-status behavior for inbound integration updates.
- Verify the implemented bounded override with category authority, explicit override grant, reason, revision, and lease. Do not treat a frontend control or owner role as clinical authority.
Plan: Readiness, integrations, and lightweight TPA.
3. Recovery, MAR, and clinical documentation
- Persist recovery stays, assignments, observations, and recovery lifecycle events.
- Connect MAR to canonical medication orders and record administration, omission, and exceptions with the required clinical audit trail.
- Define the source of medication orders and the integration boundary with pharmacy.
- Audit and connect canonical peri-operative notes and discharge documentation. Resolve day-care documents without a ward admission, preserve signed versions, and enforce documentation clearance before discharge.
- Add facility-scoped authorization, conflict handling, tests, and manual QA for nursing workflows.
Plan: Recovery and MAR.
4. Internal inventory consumption
The six-unit reusable Inventory source and U10 case-stock consumer merged through PR 2642. Source review, CI, deployment, approved pilot counts/expiry rules, and operator acceptance remain distinct gates. Use Inventory Pilot Operations and all six unit QA guides. The Hospital API handoff checklist records implementation and acceptance separately.
- The scoped U10 review loop is complete. Complete the case-stock QA checklist.
- Verify source pilot approvals, full PR CI, deployment, and acceptance.
- Keep MAR mapping, pharmacy readiness, charge posting, and dashboard metrics in their own units.
Plan: Recovery, MAR, and inventory.
5. Hospital 50 bed workflows and IPD Lite coexistence
- Implement admissions, bed assignment, transfers, discharge, and bed cleaning/availability transitions for the Hospital 50 preset.
- Keep general ward beds distinct from short-stay and post-operative recovery capacity.
- Define how existing IPD Lite records coexist or migrate. Reuse canonical clinical records only where the domain meaning matches; do not make Hospital operations depend on IPD Lite limits or deprecated backend modules.
- Validate capacity and concurrency behavior, including facilities configured for up to 50 beds.
Plan: Hospital 50 beds and IPD coexistence.
6. Package billing, charge capture, and full TPA exchange
- Implement package selection, case-linked charge capture, review, and posting through the billing domain, with duplicate and cancellation safeguards.
- Extend lightweight insurance capture into the agreed full TPA workflow. Define ABDM/HCX API ownership, exchange states, callbacks, retries, correlation, and failure handling before implementation.
- Keep accounting, payment settlement, and claims adjudication outside this scope unless separately approved.
- Test posting permissions, auditability, idempotency, and reconciliation with case and package state.
Plan: Package billing and ABDM/TPA.
7. Dashboards, reports, and pilot cutover
- Replace mock dashboard and report data with authorized, facility-scoped queries.
- Define report filters, time boundaries, export access, and protection of sensitive data.
- Add operational observability for integration failures, stale readiness, queue delays, and failed writes.
- Complete pilot/UAT workflows, support procedures, production configuration, and rollback/cutover checks.
- Verify that production has no silent mock fallback and that each enabled workflow has passed its manual QA checklist.
Plan: Reports and pilot cutover.
Cross-cutting release gates
- Every new read and write must enforce tenant and facility access on the backend. Route IDs and frontend query scopes are not authorization. Add enforced-role RLS tests for new data paths.
- Each protected action must use the effective RBAC permission catalog and a real backend policy. Add key-behavior tests so each seeded permission changes an actual policy decision.
- Add audit events for clinical, operational, inventory, configuration, and billing changes according to the owning domain's audit contract.
- Keep frontend calls behind
hospitalApi; add typed DTOs, query keys, cache invalidation, and HTTP adapter tests for each integrated resource. - Keep mock behavior explicit to development and tests. A missing production endpoint must fail visibly.
- Complete the phase manual QA checklist and record its result before marking that phase complete.
Not part of this backlog
- Role and permission administration UI, which belongs to the shell app.
- Feature-flag administration UI, which belongs to the Admin app.
- Retail pharmacy, dispensing, or a second inventory ledger.
- General staff scheduling, payroll, or HR management.
- Full hospital accounting, payment settlement, or claims adjudication.
Plan index
- Workflow and settings gap-closure execution plan
- Master backend and frontend API integration plan
- Foundation, security, and API adapter
- Surgical case and OT
- Readiness, integrations, and lightweight TPA
- Recovery, MAR, and inventory
- Hospital 50 beds and IPD coexistence
- Package billing and ABDM/TPA
- Reports and pilot cutover