Hospital Workflow and Settings Audit
Implementation evidence, effective settings, and remaining workflow gaps for PR 2642.
Result
The Hospital product is not feature complete. Merged PR 2642 adds theatre administration, versioned readiness commands, current-source gates, and the U10 case-stock workbench. Eight operational workbenches still lack live workflows. These merged changes are not a record of the current staging deployment. A completed UI unit is not a completed clinical workflow. Release and manual QA remain required. U14 extends OT settings on a separate branch; see OT Scheduling Settings and its QA guide.
This audit covers all 15 registered screen routes, their API calls, write controls, and facility settings. It compares the HTTP adapter with backend routes, policies, services, and tests. It does not replace staging or clinical acceptance testing.
Route and Action Coverage
| Route | Implemented HTTP behavior | Missing operations |
|---|---|---|
/hsp/dashboard | Facility-local OT day, case and booking counts, source errors. | Recovery, MAR, inventory metrics, complete readiness alerts. |
/hsp/ot-board | Day selection, live theatres and cases, booking, reschedule, cancel, postpone, theatre/surgeon conflicts, version checks; U2 readiness gates. | Clinical approval and the remaining Lab, Pharmacy, care and financial sources. |
/hsp/cases | Facility-scoped list, supported search and filters, detail and create navigation; U2 current-source readiness filter. | Acceptance of approved clinical policy and remaining source integrations. |
/hsp/cases/new | Canonical patient, procedure and surgeon selection; case create. | Insurance capture, documentation and source-readiness orchestration. |
/hsp/cases/:caseId | Case, timeline, active OT slot, allowed transitions, U2 readiness commands and U10 case-stock quantities with a case-preserving handoff. | Ward, recovery, MAR, package, insurance and clinical-editor handoffs. Clinical and release acceptance remain open. |
/hsp/settings | Saved preset, module and entry-route effects; theatre create/edit, status, turnaround, tags and stale-write recovery. U14 adds versioned surgeon policy, weekly hours, and maintenance editors. | Bed/room/station provisioning, operational integration modes, and U14 release/manual acceptance. |
/hsp/bed-board | Explicit not-connected state. | Admissions, assign, transfer, discharge, cleaning, bed availability and concurrency. |
/hsp/recovery | Explicit not-connected state. | Stay assignment, observations, vitals, recovery lifecycle, medication actions and discharge clearance. |
/hsp/mar | Explicit not-connected state. | Case medication orders, due doses, administer, hold, omit and exceptions. |
/hsp/inventory | U10 case requirements, current source quantities, reserve, issue, consume, release, unused return, recording corrections, reconciliation and same-key retry recovery. | Source pilot approval, full-PR CI, staging and manual acceptance. MAR, Pharmacy and billing handoffs remain separate. |
/hsp/lab-readiness | U4 candidate: live queue, private PDFs, evidence links, reasoned clinical review, replacement/expiry and retry recovery. Local API and browser journeys pass in both presets. | Final external review, deployed manual QA, and D2/D3 acceptance. No LIS/PACS vendor is selected. |
/hsp/pharmacy-readiness | Explicit not-connected state. | Medication review, case readiness, internal stock operations and reconciliation. No retail dispensing. |
/hsp/tpa | Explicit not-connected state. | Insurance capture, document handling, review, preauthorization and full exchange. |
/hsp/billing | Explicit not-connected state. | Packages, coverage, staged charges, review, posting, cancellation and invoice reconciliation. |
/hsp/reports | Explicit not-connected state. | Facility-scoped aggregates, filters, export jobs, private downloads and export audit. |
Case detail must not describe unsupported workflows as empty records. It now shows not-live states instead of empty bed/MAR results, a placeholder zero package amount, or an invented insurance capture state. Navigation into a future workbench does not create a case-linked handoff or complete the action. Live workflow controls show the case status, not a mock-derived Ready case label. U2 gates check approved current evidence. U4 adds the PDF-first Lab source and workbench. Neither proves that discharge, Pharmacy, MAR, external Lab connectors, or billing workflows are implemented. See Case Stock and its QA guide.
Settings Effects
Settings lists enabled modules separately from their API integration coverage.
Explicit mock mode labels every module Sample data. HTTP mode labels OT
scheduling, surgical cases, configuration, and case-stock consumption Connected.
The dashboard is Partial. Bed, recovery, MAR, Pharmacy, TPA, billing, and
report workbenches are Not connected. The U4 candidate marks Lab connected only
when context returns the Lab API capability. PDF intake availability and clinical
activation approval remain separate. The typed list in HospitalConfigurationPage.tsx
records implementation coverage; it is not a runtime health check or pilot approval.
Keep that list and its mock/live regression tests in step with each integration.
Disabled modules stay out of the list. No new module editor or permission grant
is added. A preset preview is not saved until the user saves settings.
Loading or failed settings reads show no enabled-module claims. The list does
not substitute preset defaults for an unavailable facility configuration.
Stock UI tests resolve access and case fixtures without demo latency. A deferred access test proves that stock queries and controls wait for facility access. Do not increase wait timeouts or bypass the layout access gate to hide a race. The readiness-conflict test controls the refreshed evidence response. It checks that Save stays blocked during refresh and requires reopening after a revision change. Clinical rules and readiness command behavior are unchanged.
| Setting | Effect in HTTP mode | Limit |
|---|---|---|
| Facility preset | Uses the saved backend preset for labels, capacity model and allowed modules. | The temporary local preset switch is mock-only. A preset does not provision beds or integrations. |
| Enabled modules | Filters navigation and blocks disabled direct routes before child queries run. Case and OT API routes also reject disabled modules. | No Hospital module administration UI is added. Context and configuration remain available to authorized administrators for recovery. |
| Default route | /hsp and unknown paths use the saved canonical entry route if enabled; otherwise they use the first enabled module. | With no enabled module, show module unavailable. External and unknown entry routes cannot be saved. |
| Operating theatre count | Reads the real theatre list. Theatre records define OT capacity. | A stored planning count does not create theatres. Failed or unauthorized reads do not show a false zero. |
| Theatre name and code | Persist and display in Settings, board and selectors. Code is unique within the facility. | Does not change historical clinical records. |
| Theatre status | Only active theatres can receive new or restored active bookings. Writes recheck eligibility under a lock. | Existing bookings remain for review. Cancellation and postponement remain available. |
| Theatre turnaround | New bookings snapshot the current value; scheduling checks the buffer. | Existing bookings retain their snapshot. |
| Equipment tags | Persist and display. | Tags do not enforce procedure equipment requirements. |
| Surgeon conflict policy | U14 adds the versioned editor and serializes policy writes with booking writes. Warning needs confirmation and a reason; blocking cannot be bypassed. | Deployment and manual QA remain separate. |
| OT opening hours and maintenance | U14 validates structured weekly/dated windows and checks booking plus historical turnaround under lock. Existing pending slots get derived review conflicts. | No automatic cancellation, equipment qualification, or clinical clearance. See the scheduling guide for timezone boundaries. |
| Facility timezone | Context normalizes the Identity facility timezone; board and dashboard use facility-local dates. | Identity owns timezone editing. |
| Recovery/ward beds, rooms, nursing stations | Stored planning metadata; controls are disabled in HTTP mode. | No provisioning, capacity limit, assignment or admission effect. |
| Lab mode | U4 candidate: versioned PDF-first setting gates intake and review; unsupported legacy modes stay unavailable until explicit correction. | Other integration planning controls stay disabled. Connected API, upload capability and clinical acceptance remain separate. |
| Pharmacy mode | Stored planning metadata; control is disabled in HTTP mode. | Does not connect Pharmacy review or MAR to stock. U10 case-stock commands do not use this setting. |
| TPA mode | Stored planning metadata; control is disabled in HTTP mode. | Does not enable insurance capture or ABDM/HCX exchange. |
| Staff | Fixed role-permissions boundary. | RBAC administration stays in shell. No staffing workflow is implemented. |
| App feature flag | Admin supplies availability through context; live layout denies unavailable app access. | Configuration cannot change the flag. Resource policies and RLS remain authoritative for API authorization. |
Saving a preset preserves custom module restrictions, a valid custom entry route, and stored capacity/integration metadata. When the saved module set is the full old preset default, a preset change uses the new preset defaults. A suspended practice cannot edit configuration, theatres, cases or bookings through the UI. The backend must still enforce its read-only and authorization rules.
Evidence and Release Gates
- Remaining execution scope: Workflow and settings gap-closure plan. It maps every route and setting to a delivery unit and prerequisite. Its existence is not implementation evidence.
- Route inventory:
frontend/apps/hospital/src/App.tsx. - Live operation allowlist:
frontend/apps/hospital/src/services/hospitalHttpApi.ts. - Module and entry routing:
HospitalLayout.tsx,config/navigation.tsx, and backend HospitalBaseController. - Configuration effects:
HospitalConfigurationPage.tsx,FacilityConfiguration, and Hospital booking services. - Automated coverage:
live-configuration-effects.test.tsx,live-workflow-states.test.tsx, theatre tests, HTTP adapter tests, and Hospital backend request/model/service/policy/RLS tests. - Manual release checks: QA guide. These checks are not marked complete by this audit.
- Remaining delivery scope and phase links: Implementation backlog.
Implement the missing workflows as the approved phase slices. Each slice needs a real API, source ownership, RLS/RBAC, audit, frontend integration, automated tests, and recorded manual QA. Do not use seed data, a schema, a mock action, or a green build as evidence that an operational workflow exists.