Product EngineeringFeaturesSample RerunFrontend

Overview

Frontend implementation of Sample Rerun across livehealth-frontend and interfacing — component architecture, shared surfaces, and constants.

👤 Aakash Pawar📅 Updated: May 25, 2026🏷️ feature🏷️ frontend🏷️ interfacing

Sample Rerun — Frontend

All sample rerun UI lives across two apps: livehealth-frontend (React — report modal, rerun components, LabAdmin configuration) and interfacing (Electron — device waiting list badges, value display). The feature integrates into report entry, waiting lists, the operations sidebar, device results validation, and lab admin test configuration.


What this section covers

PageCovers
ComponentsComponent tree, props interfaces, helper functions, LabAdmin configuration UI, interfacing renderer components

Architecture


Component summary

ComponentLocationRole
RerunProgressComponentsrc/components/reusable/Modals/Report/Banner shown on reports with active reruns — status message + action buttons
SampleRerunModalsrc/components/reusable/Modals/Report/SampleRerun/Two-tab modal — Initiate (parameter selection) and Review (value comparison)
InitiateSampleRerunSame directoryAgGrid table with checkboxes to select parameters for re-run
ReviewRerunResultsSame directoryAgGrid with radio buttons to pick original vs rerun values
CancelRerunModalSame directoryConfirmation dialog to cancel an in-progress rerun
SampleRerun (LabAdmin)src/components/LabAdmin/AddEditReport/components/SampleRerun/Configuration UI for auto/manual rerun per parameter

Status constants

File: src/components/reusable/ParticularPatientsTestList/utils/constants.ts

export const SAMPLE_REDRAW_FLAG = {
  NON_REDRAWN: 0,
  PARTIAL_REDRAWN: 1,
  FULL_REDRAWN: 2,
  RERUN_REQUESTED: 3,
  RERUN_RECEIVED: 4,
};

These map directly to sampleRedrawFlag values on the backend. Consumed in:

  • RerunProgressComponent — determines which banner message and buttons to show
  • ReportEntryFooter / DoctorFooter — disables Save/Sign when RERUN_REQUESTED or RERUN_RECEIVED
  • TestInfoCard — shows "Rerun Requested" or "Rerun Received" badge
  • Device Results Validation — shows "Rerun Triggered" / "Rerun Complete" status

File: src/components/Operations/DeviceResultsValidation/utils/constants.ts

export const RERUN_INITIATED = 3;
export const RERUN_RECEIVED = 4;

Save/Sign blocking

When sampleRedrawFlag is 3 or 4, the report footer shows:

"Rerun in progress, Confirm or cancel rerun to save or sign this report"

This is enforced in both ReportEntryFooter.tsx and DoctorFooter.tsx.


Active Reruns sidebar

Files:

  • src/components/Operations/SideBar/index.tsx (Operations sidebar)
  • src/components/DoctorLogin/SideBar/index.tsx (Doctor sidebar)

A dedicated sidebar item labelled "Active Reruns" with route /active-reruns shows a count badge from genericState.patientsWatingListStatusCountData.rerunReportsCount.

Reports are filtered through labReportStatusUtils.ts which checks isRerun(instance) and populates rerunReportList.


Waiting list integration

File: src/components/reusable/PatientsWaitingList/labReportStatusUtils.ts

The isRerun() function identifies reports with active reruns. These reports are:

  1. Added to rerunReportList during waiting list processing
  2. Counted as rerunReportsCount for the sidebar badge
  3. Filtered and displayed when the user navigates to /active-reruns

Device Results Validation integration

File: src/components/Operations/DeviceResultsValidation/components/Results.tsx

const rerunStatusMap = {
  [RERUN_INITIATED]: "Rerun Triggered",
  [RERUN_RECEIVED]: "Rerun Complete",
};

When a report has an active rerun:

  • The status badge shows "Rerun Triggered" or "Rerun Complete"
  • Parameter release actions may be disabled depending on state
  • The hasRerunReport check in helpers identifies if any report in the current view has a rerun

Interfacing app (Electron)

Waiting list item badge

File: src/renderer/components/layout/listview/item.jsx

const isRerun = item.rerunNumber !== 0
  && item.rerunNumber !== -1
  && item.rerunNumber != null
  && item.rerunNumber !== undefined;

When isRerun is true, a "Rerun" label badge is displayed next to the Sample ID in the waiting list.

Report values form

File: src/renderer/components/pages/report_values/report_values_form.jsx

When machine_triggered_rerun === 1 on a report value, the parameter is displayed with a "Rerun" status label in red.


API service functions

File: src/components/reusable/Modals/Report/helpers.ts

FunctionAPI CallPurpose
getSampleRerunDataBylrrId()GET /sample-rerun/{id}Fetches rerun values, dispatches to Redux sampleRerunData
requestRerun()POST /sample-rerun/{id}/requestInitiates a manual rerun with selected parameters
confirmRerunResults()POST /sample-rerun/{id}/confirmConfirms selected values (original or rerun)
cancelRerun()POST /sample-rerun/{id}/abortCancels an in-progress rerun
mergeSampleRerunData()— (local)Merges rerun data with report format, creates value1, value2, … columns
filterAndParseManualRerunObjects()— (local)Filters parameters that have manual_rerun or instrument_triggered rerun type in meta
handleSelectionChange()— (Redux)Updates parameterwiseSelectedValue for radio selection in review tab
handleHeaderSelection()— (Redux)Selects all rows for a column (header radio button)

On this page