Product EngineeringFeaturesCritical CalloutFrontend

Shared Surfaces

Each surface that embeds CriticalNotificationButton — trigger condition, always_notify enforcement, onSuccess contract, and file map.

👤 Sachin Sharma📅 Updated: Apr 29, 2026🏷️ feature🏷️ frontend🏷️ surfaces

Shared Surfaces

CriticalNotificationButton is a single reusable component embedded on every surface where a critical report can appear. Each surface is responsible only for deciding when to show the button and what to do on success — all modal logic lives inside the button and modal themselves.


How the button works

On mount, the button auto-shows a tooltip for 3 seconds: "This report contains critical values. Notify these critical results to physicians, providers, or other recipients." This is suppressed with ignoreTooltip: true on surfaces where it would be disruptive (e.g. the worklist grid).


Entry points

1. ReportEntryFooter — Lab login report entry

File: reusable/Modals/Report/ReportEntryFooter.tsx

The button appears in the footer of the lab report entry form.

Visibility condition:

completedTests === 1 AND criticalValues ∈ CRITICAL_CALLOUT_VALUES

always_notify enforcement: Yes. When always_notify is on, clicking Save and Sign intercepts the action. The component calls getCriticalNotificationLogsData(labReportId) — if no existing logs are found, it sets isCriticalNotificationModalOpen = true and holds the save. Once the user completes the callout (onNotify fires), saveReportValues and redirectReport are called.

onSuccess: Not used here (Pushers update data on screen) — sign flow is handled via onNotify.


2. DoctorFooter — Doctor login report view

File: reusable/Modals/Report/DoctorFooter.tsx

The button appears in the footer of the report view panel on the doctor login.

Visibility condition:

completedTests === 1 AND criticalValues ∈ CRITICAL_CALLOUT_VALUES

always_notify enforcement: Yes. The intercepted buttons are Approve and Approve and Submit. If all conditions are met and no existing logs exist, the modal opens programmatically. Once onNotify fires, the original button operation (handleClick(buttonOperations)) is executed.

onSuccess: Not used (Pushers update data on screen) — approve flow is handled via onNotify.


3. TestInfoCard — Test Waiting List

File: reusable/TestWaitingList/TestInfoCard.tsx

Button shown on each test card in the waiting list.

Visibility condition: criticalValues ∈ CRITICAL_CALLOUT_VALUES

onSuccess: Updates the report's criticalValues in the parent waiting list state so the badge and button update without a full refresh.

always_notify enforcement: No.


4. ReportTitle — Patient Test List

File: reusable/ParticularPatientsTestList/ReportTitle.tsx

Button shown in the title row of each report in the patient test list.

Visibility condition: criticalValues ∈ CRITICAL_CALLOUT_VALUES

onSuccess: Refreshes the report row's callout status locally.

always_notify enforcement: No.


5. DoctorLogin WaitingList

File: DoctorLogin/WaitingList/index.tsx

Button shown in the doctor's patient waiting list rows.

Visibility condition: criticalValues ∈ CRITICAL_CALLOUT_VALUES

onSuccess: Updates the local criticalValues for the matching report in the list.

always_notify enforcement: No.


6. PatientWiseReportList

File: DoctorLogin/PatientWiseReportList/index.tsx

Button shown in the patient-wise report list under doctor login.

Visibility condition: criticalValues ∈ CRITICAL_CALLOUT_VALUES

onSuccess: Updates report status in local state.

always_notify enforcement: No.


File: reusable/Modals/ReportsTrends/PreviewModalFooter.tsx

Button shown in the footer of the Reports Trends preview modal.

Visibility condition: criticalValues ∈ CRITICAL_CALLOUT_VALUES

onSuccess: Refreshes the modal's report data.

always_notify enforcement: No.


8. CriticalCalloutWorklist — Operations (new)

File: Operations/CriticalCalloutWorklist/index.tsx

Button rendered in the Action column of the AG Grid. This surface uses the customised label/colour and suppresses the tooltip:

onSuccess: Refreshes the worklist row's callout status and re-evaluates the bill-level billCriticalCallout aggregated value.

always_notify enforcement: No — the worklist is a dedicated callout surface, not a sign/approve flow.


labReportStatusUtils

File: reusable/PatientsWaitingList/labReportStatusUtils.ts

Used by all waiting list surfaces to resolve badge text and determine whether the callout action should be visible, based on the criticalValues integer.

Updated in this feature to recognise CALLOUT_ATTEMPTED = 4:

criticalValuesBadge textAction visible
1Callout PendingYes
4Callout AttemptedYes
2Callout DoneNo

The isCritical() check uses CRITICAL_CALLOUT_VALUES — an array constant ([1, 2, 4]) — to populate the criticalReportList bucket in getStateWiseListFromReportList, which drives the critical badge count shown in waiting list headers.


File map

FilePurpose
CriticalNotification/CriticalNotificationModal.tsxContainer modal with tabs
CriticalNotification/CriticalCalloutModal.tsxAction panel
CriticalNotification/CriticalNotificationBody.tsxTab body renderer
CriticalNotification/CriticalCalloutLogs.tsxHistory timeline
CriticalNotification/CriticalNotificationButton.tsxTrigger button
CriticalNotification/interfaces.tsAll TypeScript interfaces
CriticalNotification/utils.tsRestore, validate, structure logs, getCriticalValueTag
CriticalNotification/helpers.tsxnotifyCallout, getCriticalNotificationSettings, getCriticalNotificationLogsData
Modals/Report/constants.tsCOMMUNICATION_METHODS, CALLOUT_LOG_META_MAPPER
Modals/Report/styles.module.scssModal layout styles

Worklist module

FilePurpose
CriticalCalloutWorklist/index.tsxPage container
CriticalCalloutWorklist/constants.tsReport type strings, debounce
CriticalCalloutWorklist/utils/helpers.tsFetch, grid renderers, export row builder, bill aggregation
CriticalCalloutWorklist/utils/interface.tsWorklistTab, GridCalloutStatus, param interfaces
CriticalCalloutWorklist/utils/exportUtils.jsSheetJS Excel export
Operations/SideBar/index.tsxMenu entry
modules/CrelioDashboard/RoutesAndMenus/operationsRoutesAndMenu.tsxRoute registration
modules/Operations/routes.tsxRoute definition

Shared surfaces

FileSurface
reusable/Modals/Report/ReportEntryFooter.tsxLab login report entry
reusable/Modals/Report/DoctorFooter.tsxDoctor login report view
reusable/Modals/ReportsTrends/PreviewModalFooter.tsxReports Trends modal footer
reusable/TestWaitingList/TestInfoCard.tsxTest Waiting List card
reusable/TestWaitingList/ButtonLogic.tsxWaiting list button routing
reusable/ParticularPatientsTestList/ReportTitle.tsxPatient test list title
reusable/PatientsWaitingList/labReportStatusUtils.tsStatus badge + critical list bucketing
reusable/Accordion/index.tsxPer-report accordion inside callout modal
DoctorLogin/WaitingList/index.tsxDoctor waiting list
DoctorLogin/WaitingList/helpers.tsDoctor waiting list helpers
DoctorLogin/PatientWiseReportList/index.tsxPatient-wise report list
DoctorLogin/SideBar/index.tsxDoctor sidebar
Operations/operationsDashboard/utils/interface.tsOps dashboard interfaces
Operations/operationsDashboard/.../CriticalReportsDrillDown.tsxCritical reports drill-down
utils/constants.tsCRITICAL_CALLOUT_PENDING/DONE/ATTEMPTED, CRITICAL_CALLOUT_VALUES

On this page