DecayCorrector
Decay
DecayCorrector — Radionuclide Decay Correction Utility (Ph. Eur. 0125, USP <823>, IAEA TRS-468)
ℹ️ The utility calculates decay-corrected radionuclide activity from calibration time to measurement or administration time.
ℹ️ Does not use machine learning — physics-based formulas and rules only.
⚠️ CRITICAL: Accurate decay correction is mandatory to ensure correct therapeutic or diagnostic dosing! Calculation error leads to under- or overdosing!
Usage:
DecayCorrector.exe → demo mode (console output)
DecayCorrector.exe input.csv output.json → calculation on your data
Input format:
Radionuclide,MeasuredActivityMBq,CalibrationTime,MeasurementTime,BatchNumber
Example (ISO 8601 time format):
Tc99m,750.0,2026-04-04T08:00:00Z,2026-04-04T14:00:00Z,TC99M-2026-001
— WHY IS THIS NEEDED?
Radionuclides decay at a precisely defined rate. Activity measured several hours after calibration will be lower than the initial value. To prescribe an accurate dose (especially in therapy), the measured activity must be referenced to the calibration time or, conversely, the activity at the time of administration must be predicted.
• Half-life is the key parameter: from 6 hours for Tc-99m to 11 days for Ra-223.
• Calculation accuracy is critical for patient safety and treatment efficacy.
• Regulatory requirement: all dose calculations in GMP manufacturing must be traceable and verified.
⚠️ CRITICAL:
• Calculation formula: (A\{\\text{corr}} = A\{\\text{meas}} \\cdot e^{\\lambda \\cdot \\Delta t}), where (\\lambda = \\ln(2) / T\{1/2}).
• Time accuracy: even a 1-minute error for short-lived nuclides (e.g., Ga-68, T½=68 min) causes >1% error.
• Correct half-life: the utility uses reference values from NIST/IAEA. Manual references may contain errors!
• ALCOA+ compliance: all calculations include an audit trail, raw data hash, and timestamp.
⚠️ Special attention: The utility does not replace a calibrated dose calibrator but is a mandatory link in the quality control chain. It guarantees that the activity value stated in the batch release report corresponds to the actual dose received by the patient.
Supported radionuclides:
Tc-99m, Ga-68, Lu-177, Y-90, I-131, Cu-64, Cu-67, Ac-225, Pb-212, At-211, Ra-223, Sr-89, and others (extensible database).
Critical output parameters:
• correctedactivitymbq — activity referenced to calibration time
• decayconstant — decay constant (λ)
• timedifferencehours — Δt in hours
• correctionfactor — correction factor ((e^{\\lambda \\Delta t}))
⚠️ Note: The utility is designed for integration into automated GMP production workflows. All calculations are performed with double precision (64-bit), with an error not exceeding 0.1% of reference values. The output JSON contains a full audit trail for inclusion in the validation package.input.csv
BatchNumber,Radionuclide,MeasuredActivityMBq,CalibrationTime,MeasurementTime TC99M-2026-001,Tc99m,750.0,2026-04-04T08:00:00Z,2026-04-04T14:00:00Z LU177-2026-001,Lu177,5000.0,2026-04-02T10:00:00Z,2026-04-04T10:00:00Z GA68-2026-001,Ga68,200.0,2026-04-04T12:30:00Z,2026-04-04T14:00:00Z
URS & FS — user requirements and functional specification
This document defines user requirements and functional specification for the quality-control utility. It supports deployment discussion, IQ/OQ preparation and QC workflow integration.
1. Scope
The Decay Corrector utility is used for Decay. The actual input.csv is the source of truth for the input structure; control criteria are defined by the executable and the domain description.
The utility does not use machine learning; decisions are produced by deterministic rules.
Categories: Radiopharmaceuticals
Tags: decay correction, endotoxins, PET, radionuclide purity, radiopharma, SPECT, sterility
2. Execution modes
DecayCorrector.exe → demo mode (console output) DecayCorrector.exe input.csv output.json → calculation on your data
3. Key controlled areas
- purity and impurities
- microbiology and pathogens
- pH and physicochemical parameters
- activity, decay and radiochemical purity
4. Domain limits and critical parameters
- ⚠️ CRITICAL: Accurate decay correction is mandatory to ensure correct therapeutic or diagnostic dosing! Calculation error leads to under- or overdosing!
- ⚠️ CRITICAL:
- Calculation formula: (A\{\\text{corr}} = A\{\\text{meas}} \\cdot e^{\\lambda \\cdot \\Delta t}), where (\\lambda = \\ln(2) / T\{1/2}).
- Time accuracy: even a 1-minute error for short-lived nuclides (e.g., Ga-68, T½=68 min) causes >1% error.
- Correct half-life: the utility uses reference values from NIST/IAEA. Manual references may contain errors!
- ALCOA+ compliance: all calculations include an audit trail, raw data hash, and timestamp.
- ⚠️ Special attention: The utility does not replace a calibrated dose calibrator but is a mandatory link in the quality control chain. It guarantees that the activity value stated in the batch release report corresponds to the actual dose received by the patient.
- Tc-99m, Ga-68, Lu-177, Y-90, I-131, Cu-64, Cu-67, Ac-225, Pb-212, At-211, Ra-223, Sr-89, and others (extensible database).
- correctedactivitymbq — activity referenced to calibration time
- decayconstant — decay constant (λ)
- timedifferencehours — Δt in hours
- correctionfactor — correction factor ((e^{\\lambda \\Delta t}))
- ⚠️ Note: The utility is designed for integration into automated GMP production workflows. All calculations are performed with double precision (64-bit), with an error not exceeding 0.1% of reference values. The output JSON contains a full audit trail for inclusion in the validation package.
5. URS — user requirements
| ID | Requirement | Criticality | Acceptance criterion |
|---|---|---|---|
| URS-001 | The system shall accept an input.csv file for Decay with the exact columns listed in the “Input data contract” section. | High | A file with the correct header is processed without manual editing; missing mandatory columns produce FAIL/import error. |
| URS-002 | The system shall support execution without arguments in demo mode and execution with input.csv output.json for user data. | Medium | Both execution scenarios produce a predictable result or clear diagnostic error. |
| URS-003 | The system shall perform rule-based controls for: purity and impurities, microbiology and pathogens, pH and physicochemical parameters, activity, decay and radiochemical purity. | High | Each controlled parameter receives a status and message; the result does not depend on hidden Excel formulas or ML. |
| URS-004 | The system shall preserve traceability between batch/lot, source values, applied rules and final verdict. | High | Output includes batch identifier, source values, parameter statuses and critical findings. |
| URS-005 | The system shall generate machine-readable output.json for LIMS/ELN/MES, batch record and QA/QC review. | High | JSON contains overall status, check array, warnings, failures and source-file reference. |
| URS-006 | The system shall support use in the client validation package: URS/FS, IQ/OQ preparation, installation and operational scenario checks. | High | The document, test scenarios and reproducible CSV/JSON flow are suitable for audit and internal approval. |
| URS-007 | The system shall clearly separate technical data errors from specification nonconformities. | Medium | Schema/type errors are not mixed with pharmacopoeial deviations and are reported separately. |
6. input.csv data contract
The source of truth for the input schema is the actual input.csv header. Column names are technical identifiers and are not translated.
| # | Column | Type | Unit | Description | Sample | Control rule |
|---|---|---|---|---|---|---|
| 1 | BatchNumber | identifier | as specified | Batch Number | TC99M-2026-001 | mandatory field; used for batch/lot traceability |
| 2 | Radionuclide | text | as specified | Radionuclide | Tc99m | mandatory value; format and acceptability are checked by the utility |
| 3 | MeasuredActivityMBq | decimal | MBq | Measured Activity MBq | 750.0 | mandatory numeric value; rule comparison is performed by the utility |
| 4 | CalibrationTime | date/time | as specified | Calibration Time | 2026-04-04T08:00:00Z | mandatory value; format and acceptability are checked by the utility |
| 5 | MeasurementTime | date/time | as specified | Measurement Time | 2026-04-04T14:00:00Z | mandatory value; format and acceptability are checked by the utility |
CSV example
BatchNumber,Radionuclide,MeasuredActivityMBq,CalibrationTime,MeasurementTime TC99M-2026-001,Tc99m,750.0,2026-04-04T08:00:00Z,2026-04-04T14:00:00Z
7. FS — functional specification
| ID | Function | Implementation description |
|---|---|---|
| FS-001 | CLI entry point | The executable DecayCorrector.exe supports demo mode and input.csv output.json processing mode. |
| FS-002 | CSV parser | The import module reads CSV, validates header, column presence/order, value count and encoding. Decimal values are expected with a dot separator. |
| FS-003 | Field conversion | Each column is converted to the expected type: identifier, text, decimal number, date/time or boolean flag. |
| FS-004 | Domain rule engine | For Decay, explicit rules are applied: range, minimum, maximum, absence of prohibited flag, data completeness or calculation-based check. |
| FS-005 | Criticality handling | Critical violations produce FAIL; non-critical deviations and incomplete data produce WARNING; full conformance produces PASS. |
| FS-006 | JSON writer | output.json stores overall status, per-parameter results, source values, warnings, failures and diagnostic messages. |
| FS-007 | Integration contract | The CSV → JSON format is stable for invocation from LIMS/ELN/MES, scheduled task or wrapper service. |
| FS-008 | Error handling | Schema error, missing file, non-numeric value or JSON write failure returns diagnosable error without silent PASS. |
8. output.json contract
The output file must be suitable for automated processing, audit review and correlation with the source input.csv row.
{
"utility": "DecayCorrector",
"api": "Decay",
"batchNumber": "TC99M-2026-001",
"overallStatus": "PASS|WARNING|FAIL",
"checkedAtUtc": "2026-05-18T00:00:00Z",
"checks": [
{
"parameter": "BatchNumber",
"value": "TC99M-2026-001",
"unit": "as specified",
"status": "PASS|WARNING|FAIL",
"message": "Rule-based check result"
},
{
"parameter": "Radionuclide",
"value": "Tc99m",
"unit": "as specified",
"status": "PASS|WARNING|FAIL",
"message": "Rule-based check result"
},
{
"parameter": "MeasuredActivityMBq",
"value": "750.0",
"unit": "MBq",
"status": "PASS|WARNING|FAIL",
"message": "Rule-based check result"
},
{
"parameter": "CalibrationTime",
"value": "2026-04-04T08:00:00Z",
"unit": "as specified",
"status": "PASS|WARNING|FAIL",
"message": "Rule-based check result"
},
{
"parameter": "MeasurementTime",
"value": "2026-04-04T14:00:00Z",
"unit": "as specified",
"status": "PASS|WARNING|FAIL",
"message": "Rule-based check result"
}
],
"criticalFindings": [],
"sourceFile": "input.csv"
}9. OQ/PQ test scenarios
| ID | Scenario | Expected result |
|---|---|---|
| TC-001 | Valid CSV with expected header and sample row | All rows are processed; output contains PASS/WARNING/FAIL and parameter-level detail. |
| TC-002 | A mandatory input.csv column is missing | Import is rejected or the row receives FAIL with schema reference. |
| TC-003 | A numeric field contains text or a blank value | Type conversion error is recorded; the result is not hidden as PASS. |
| TC-004 | A parameter is outside specification or critical limit | Critical parameters produce FAIL; non-critical deviations produce WARNING according to the rule. |
| TC-008 | Incorrect activity, reference time or radiochemical purity | FAIL/WARNING is produced with calculation traceability. |
10. QA/QC, CSV and change control
- Before production use, the client records executable version, checksum, specification/monograph version, test CSV, expected JSON and IQ/OQ results.
- Column names must not be changed without updating the validator and test scenarios.
- The source CSV, output.json and utility version should be stored together as an evidence package.
- Any change in control rules must go through change control and repeated OQ scenario verification.
Included in packages
PetRad QC Suite
A specialised utility package for radiopharmaceutical quality control: PET, SPECT, therapeutic radionuclides, generators and decay calculations.
OpenRadiology QC Suite
QC package for radiology and diagnostic imaging: radiopharmaceuticals, PET/SPECT, contrast media, iodinated and gadolinium products, plus particle, sterility and endotoxin checks.
OpenRPH use case: generators, isotope purity and starting radionuclides
Control of generator eluate, breakthrough, radionuclidic purity, isotope mix, carrier/free radionuclides and starting radionuclides before labeling.
OpenRPH workflow: generators and isotope purity
Generator eluate, breakthrough, radionuclidic purity, isotope mix and starting radionuclides.
OpenRPH workflow: product release QC
Assay, purity, sterility, endotoxins, pH, impurities, appearance and batch-release checks.
OpenRPH workflow: stability, storage, decay and waste
Kinetic stability, shelf life, decay correction, expiry, storage, trend and radioactive waste.
OpenRPH: combined radiopharmaceutical QC package
RPH combines PetRad, PetRad2 and PetRad3 into one umbrella package for PET/SPECT, therapeutic radionuclides, generators, labelled compounds, decay calculations, sterility, endotoxins and radiochemical/radionuclidic purity.
Open