Product EngineeringFeaturesSample RerunBackend

Overview

Backend implementation overview for Sample Rerun in crelio-app and interfacing.

šŸ‘¤ Aakash PawaršŸ“… Updated: May 25, 2026šŸ·ļø featurešŸ·ļø backendšŸ·ļø interfacing

Sample Rerun — Backend

All server-side rerun logic lives across two repositories: crelio-app (API, models, business logic) and interfacing (instrument communication, rerun qualification). Data is stored in DocumentDB (MongoDB) for transactional rerun records and MySQL for report-level state (sampleRedrawFlag), with Redis caching for fast rerun number lookups.


What this section covers

PageCovers
Data ModelSampleRerun and SampleRerunValues models, sampleRedrawFlag on LabReportRelation, ReportFormat.meta fields, Redis cache, Activity log constants
API ReferenceSix endpoints under /sample-rerun/ — fetch, receive values, request, confirm, cancel, auto-check

Architecture


Key files

crelio-app

FileRole
report/models/sample_rerun.pySampleRerun model — rerun transactions, cache, auto-rerun condition evaluation
report/models/sample_rerun_values.pySampleRerunValues model — rerun parameter values, close/cleanup
report/models/lab_report_relation.pyLabReportRelation.sampleRedrawFlag field
report/models/report_format.pyauto_rerun_allowed, auto_rerun_parameter_condition, range properties
report/views/sample_rerun.py5 view classes — SampleRerunView, AutoSampleRerunCheck, SampleRerunConfirmView, SampleRerunCancelView, SampleRerunRequestView
report/urls.pyURL patterns under sample-rerun/ prefix
core/utils/activity_log/__init__.pyActivity log constants: RERUN_VALUES_RECEIVED (979), RERUN_VALUES_CONFIRMED (980), RERUN_REQUESTED (981), RERUN_FAILED (984), RERUN_CANCELLED (985)
interfacing/proxies/device_lab_report.pyDeviceLabReportRelation — waiting list rerun integration, get_rerun_format_machine_names_map()
interfacing/models/device_results_validation.pyis_rerun flag handling in device result payloads
interfacing/models/device_format_mapping.pymanual_rerun meta field persistence during device format mapping

interfacing (Node.js)

FileRole
src/main/tasks/sample_rerun.jsqualify_rerun(), process_reports_for_rerun() — rerun detection logic
src/main/interfacing/device_parser.jsInvokes process_reports_for_rerun() during device data parsing
src/main/models/report_values.jsmachine_triggered_rerun field; sets is_rerun and rerun_number on payload
src/main/models/waiting_list.jsrerunNumber field; handles rerun_number_changed during updates

On this page