Product EngineeringFeaturesCritical CalloutFrontend

Overview

Frontend implementation of Bill-wise Critical Callout in livehealth-frontend.

๐Ÿ‘ค Sachin Sharma๐Ÿ“… Updated: Apr 29, 2026๐Ÿท๏ธ feature๐Ÿท๏ธ frontend๐Ÿท๏ธ operations

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

PageCovers
Callout ModalComponent tree, TypeScript interfaces, draft restore flow, submit payload, validation, history panel
WorklistOrder-level queue, tabs, grid grouping, row interaction, navigation state
ExportExcel export โ€” row granularity, columns, data sources, file naming
Shared SurfacesEach entry point's trigger condition, always_notify enforcement, onSuccess contract
Notify ConfigurationLab-wide settings persisted in Preferences โ€” mandatory comments, always_notify, HIPAA mode

Architecture

ComponentRole
CriticalCalloutWorklistOrder-level queue โ€” tabs, filters, export
CriticalNotificationModalContainer โ€” fetches report data and logs, owns tab layout
CriticalCalloutModalAction panel โ€” report selection, channels, recipients, submit
CriticalCalloutLogsRight panel โ€” vertical timeline of callout history
CriticalNotificationButtonReusable 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.ts resolves the colour and text for every surface
  • Tab filtering โ€” worklist's pending tab includes both 1 and 4 (attempted counts as still pending) and done tab includes reports with callout status as 2
  • onSuccess callbacks โ€” 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 report

If all four are true, the action is held and isCriticalNotificationModalOpen is set to true.

On this page