Overview
Frontend implementation of Bill-wise Critical Callout in livehealth-frontend.
Bill-wise Critical Callout โ Frontend
All critical callout UI lives in livehealth-frontend. The feature redesigns the callout workflow from report-wise to order-wise, introduces a dedicated operations worklist, and embeds a uniform trigger button across every surface where critical reports appear.
What this section covers
| Page | Covers |
|---|---|
| Callout Modal | Component tree, TypeScript interfaces, draft restore flow, submit payload, validation, history panel |
| Worklist | Order-level queue, tabs, grid grouping, row interaction, navigation state |
| Export | Excel export โ row granularity, columns, data sources, file naming |
| Shared Surfaces | Each entry point's trigger condition, always_notify enforcement, onSuccess contract |
| Notify Configuration | Lab-wide settings persisted in Preferences โ mandatory comments, always_notify, HIPAA mode |
Architecture
| Component | Role |
|---|---|
CriticalCalloutWorklist | Order-level queue โ tabs, filters, export |
CriticalNotificationModal | Container โ fetches report data and logs, owns tab layout |
CriticalCalloutModal | Action panel โ report selection, channels, recipients, submit |
CriticalCalloutLogs | Right panel โ vertical timeline of callout history |
CriticalNotificationButton | Reusable trigger button; owns modal open/close state |
Status constants
File: src/utils/constants.ts
export const CRITICAL_CALLOUT_PENDING: number = 1;
export const CRITICAL_CALLOUT_DONE: number = 2;
export const CRITICAL_CALLOUT_ATTEMPTED: number = 4;These map exactly to CriticalValuesEnum on the backend. Consumed in:
- Badge rendering โ
labReportStatusUtils.tsresolves the colour and text for every surface - Tab filtering โ worklist's
pendingtab includes both1and4(attempted counts as still pending) anddonetab includes reports with callout status as2 onSuccesscallbacks โ parent surfaces refresh their local state when the modal completes
always_notify enforcement
When the always_notify setting is on (see Notify Configuration), saving or signing a report with critical values automatically intercepts the action and forces the callout modal open. This enforcement is implemented individually in ReportEntryFooter and DoctorFooter โ see Shared Surfaces for per-surface details.
The intercept logic checks three conditions before forcing the modal:
completedTests === 1
AND criticalValues โ CRITICAL_CALLOUT_VALUES
AND always_notify === 1
AND no existing callout logs for this reportIf all four are true, the action is held and isCriticalNotificationModalOpen is set to true.