Overview

Sample Rerun — re-run lab test parameters on the same sample, triggered manually, automatically by configured conditions, or by the instrument itself.

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

Sample Rerun

Sample Rerun is the workflow that allows a lab to re-run one or more test parameters on the same patient sample — either because the values look suspect, because the instrument detected an anomaly and re-analysed the sample on its own, or because an auto-rerun rule was configured and the incoming value crossed a threshold.

The feature spans four repositories: crelio-app (backend API and business logic), livehealth-frontend (React UI), interfacing (instrument communication), and the livehealthapp Django host (no rerun-specific code; hosts URL routing only).


Why is Sample Rerun needed?

Some test results need to be verified before they can be reported:

  • A parameter value may fall outside expected ranges — the lab technician wants the instrument to process the sample again before trusting the result
  • The instrument itself may detect an internal anomaly (e.g., a clot, a flagged aspiration) and automatically re-test the sample
  • Lab SOPs may require automatic re-runs when values cross critical or abnormal thresholds

Without a structured rerun workflow:

  • There is no traceability of which parameters were re-run, how many times, or what the earlier values were
  • Instrument-triggered re-runs produce duplicate result rows with no way to distinguish the original from the rerun
  • Technicians have no confirmation step — new values silently overwrite old ones

How rerun is triggered

Three distinct trigger paths exist:

TriggerWho initiatesrerun_numbertype
Manual RerunLab user via UIUser-specified (1, 2, …)Manual
Auto RerunSystem, when device values cross configured threshold1 (default)Auto
Instrument-triggered RerunThe instrument itself re-sends data for the same sample-1 (sentinel)Instrument-triggered

sampleRedrawFlag — the report-level status

The sampleRedrawFlag field on LabReportRelation tracks the current rerun state of each report:

ValueConstantMeaning
0NON_REDRAWNNo rerun active — normal state
1PARTIAL_REDRAWNLegacy — partial sample redraw
2FULL_REDRAWNLegacy — full sample redraw
3RERUN_REQUESTEDA rerun has been requested; awaiting instrument values
4RERUN_RECEIVEDRerun values received; awaiting user confirmation

Where is rerun visible?

SurfaceBehaviour
Report EntryRerunProgressComponent banner shows rerun status; Save/Sign disabled while rerun is in progress
Test Waiting ListBadge shows "Rerun Requested" or "Rerun Received"
Doctor Waiting ListSame badge behaviour
Active Reruns sidebarDedicated sidebar item under Operations and Doctor Login showing count of active reruns
Device Results ValidationShows "Rerun Triggered" / "Rerun Complete" status; actions disabled during rerun
Device Waiting List (interfacing)"Rerun" label badge next to Sample ID; rerun parameters sent to instrument
LabAdmin → Test ConfigurationCheckboxes for "Auto rerun" and "Manual rerun" per parameter with condition configuration

Feature scope summary

  • Manual Rerun: Lab user selects parameters → requests rerun → instrument re-tests → user reviews original vs rerun values → confirms which to keep
  • Auto Rerun: Configured per parameter with conditions (abnormal, critical, custom range) → triggered automatically when device values qualify → routed through Fusion webhook
  • Instrument-triggered Rerun: Device re-sends data without being asked → system detects it as a rerun → values stored with rerun_number = -1
  • Confirmation flow: Side-by-side comparison of original and rerun values with radio selection per parameter
  • Cancellation: Rerun can be cancelled at any stage, resetting sampleRedrawFlag to 0 and cleaning up DocumentDB records
  • Waiting list integration: Reports with sampleRedrawFlag = 3 appear in the device waiting list with rerun parameters mapped to instrument machine names
  • Activity logging: Five dedicated log categories track every rerun lifecycle event

Document map

On this page