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
| Page | Covers |
|---|---|
| Data Model | SampleRerun and SampleRerunValues models, sampleRedrawFlag on LabReportRelation, ReportFormat.meta fields, Redis cache, Activity log constants |
| API Reference | Six endpoints under /sample-rerun/ ā fetch, receive values, request, confirm, cancel, auto-check |
Architecture
Key files
crelio-app
| File | Role |
|---|---|
report/models/sample_rerun.py | SampleRerun model ā rerun transactions, cache, auto-rerun condition evaluation |
report/models/sample_rerun_values.py | SampleRerunValues model ā rerun parameter values, close/cleanup |
report/models/lab_report_relation.py | LabReportRelation.sampleRedrawFlag field |
report/models/report_format.py | auto_rerun_allowed, auto_rerun_parameter_condition, range properties |
report/views/sample_rerun.py | 5 view classes ā SampleRerunView, AutoSampleRerunCheck, SampleRerunConfirmView, SampleRerunCancelView, SampleRerunRequestView |
report/urls.py | URL patterns under sample-rerun/ prefix |
core/utils/activity_log/__init__.py | Activity log constants: RERUN_VALUES_RECEIVED (979), RERUN_VALUES_CONFIRMED (980), RERUN_REQUESTED (981), RERUN_FAILED (984), RERUN_CANCELLED (985) |
interfacing/proxies/device_lab_report.py | DeviceLabReportRelation ā waiting list rerun integration, get_rerun_format_machine_names_map() |
interfacing/models/device_results_validation.py | is_rerun flag handling in device result payloads |
interfacing/models/device_format_mapping.py | manual_rerun meta field persistence during device format mapping |
interfacing (Node.js)
| File | Role |
|---|---|
src/main/tasks/sample_rerun.js | qualify_rerun(), process_reports_for_rerun() ā rerun detection logic |
src/main/interfacing/device_parser.js | Invokes process_reports_for_rerun() during device data parsing |
src/main/models/report_values.js | machine_triggered_rerun field; sets is_rerun and rerun_number on payload |
src/main/models/waiting_list.js | rerunNumber field; handles rerun_number_changed during updates |