ResidueDepletion_WithdrawalPeriod_QualityChecker

Residue Depletion & Withdrawal Period

Vet veterinary veterinary vaccines animal health adjuvants aquaculture batch release CSV→JSON
Open selection

Utility description: Residue Depletion & Withdrawal Period

Residue Depletion & Withdrawal Period Quality Checker — Control of Residue Depletion and Withdrawal Periods

ℹ️  Utility assesses the safety of veterinary drugs in food-producing animals according to VICH GL49 guidelines:
     • Comparison of measured residue concentrations with MRL (Maximum Residue Limit)
     • Statistical Assessment: Upper one-sided 95% Confidence Limit (UCL) must be below MRL
     • Confirmation of Withdrawal Period for various tissues (muscle, liver, kidney, fat, milk)
     • Analysis of drug elimination kinetics

⚠️  CRITICAL: Even if mean residue levels are below MRL, if the Upper Confidence Limit (UCL) is higher — the withdrawal period is NOT confirmed!
     This ensures that with 95% probability, no animal in the population will have residues above the safe level.

Usage:
  ResidueDepletionWithdrawalPeriodQualityChecker.exe                            → demo mode (console output)
  ResidueDepletionWithdrawalPeriodQualityChecker.exe input.csv output.json      → evaluate your data

Input format:
BatchNumber,AnimalSpecies,TissueType,MRL_ppb,MeasuredResidue_ppb,DaysAfterLastDose,UpperConfidenceLimit_95,ProposedWithdrawalDays

Example:
  WD-STUDY-2026-001,Bovine,Liver,100.0,45.0,14,85.0,14

— WHY IS THIS NEEDED?
To protect consumers of animal-derived food products from toxic effects of veterinary drug residues.
Withdrawal period is the time between the last drug administration and animal slaughter (or milk/egg production), during which residue concentration falls below MRL.
Incorrectly established withdrawal period leads to meat batch rejection at slaughterhouses and fines.

⚠️  CRITICAL:
• Marker Residue: Often not the drug itself is measured, but a "marker residue" (metabolite or sum of substances) correlating with total toxicity.
• Target Tissues: Liver and kidneys usually accumulate the most residues and require longer withdrawal periods than muscle.
• Statistics (VICH GL49): Tolerance limit method or regression analysis is used to determine the time when UCL crosses the MRL line.
• Interspecies Differences: Metabolism in cattle, pigs, and poultry differs significantly. Data cannot be extrapolated without studies.

Key features:
• Verification of residue compliance with legal limits (MRL)
• Statistical control of data reliability (UCL 95%)
• Support for different animal species and tissue types
• Generation of reports for registration dossiers (MAA/NADA) and LIMS LabWare
• Compliance with VICH, FDA CVM, and EMA requirements

Critical parameters:
• Measured Residues: ≤ MRL
• Upper Confidence Limit (UCL 95%): ≤ MRL
• Withdrawal Period: Sufficient to reduce UCL below MRL

💡 Usage tips:
1. Sampling: Animals must be slaughtered at different time points to construct the depletion curve.
2. Analytics: Methods (LC-MS/MS) must be validated with very low Limit of Quantification (LOQ).
3. Marker Substances: Ensure you are measuring the correct marker residue specified in the registration dossier.
4. Interpretation: If UCL > MRL, the withdrawal period must be increased and additional measurements performed.
5. Documentation: Residue depletion data is a key part of the "Consumer Safety" section in the registration dossier.

⚠️ Note: Unlike human medicine, where the effect on the patient is important, here the "effect of no effect" on the consumer of meat/milk long after treatment is crucial.

input.csv

BatchNumber,AnimalSpecies,TissueType,MRL_ppb,MeasuredResidue_ppb,DaysAfterLastDose,UpperConfidenceLimit_95,ProposedWithdrawalDays
WD-STUDY-2026-001,Bovine,Liver,100.0,45.0,14,85.0,14
WD-STUDY-2026-002,Swine,Kidney,50.0,60.0,7,75.0,7
WD-STUDY-2026-003,Poultry,Muscle,10.0,2.0,5,8.0,5

URS & FS — User Requirements and Functional Specification

This document describes the controlled interface and behaviour of ResidueDepletion_WithdrawalPeriod_QualityChecker for Residue Depletion & Withdrawal Period Quality Checker.

Domain limits and critical parameters

Key fragments from the source description are shown below. Before production use, limits must be verified against the approved specification, registration dossier and local SOPs.
  • ℹ️ Utility assesses the safety of veterinary drugs in food-producing animals according to VICH GL49 guidelines:
  • • Comparison of measured residue concentrations with MRL (Maximum Residue Limit)
  • • Statistical Assessment: Upper one-sided 95% Confidence Limit (UCL) must be below MRL
  • ⚠️ CRITICAL: Even if mean residue levels are below MRL, if the Upper Confidence Limit (UCL) is higher — the withdrawal period is NOT confirmed!
  • BatchNumber,AnimalSpecies,TissueType,MRL_ppb,MeasuredResidue_ppb,DaysAfterLastDose,UpperConfidenceLimit_95,ProposedWithdrawalDays
  • Withdrawal period is the time between the last drug administration and animal slaughter (or milk/egg production), during which residue concentration falls below MRL.
  • ⚠️ CRITICAL:
  • • Statistics (VICH GL49): Tolerance limit method or regression analysis is used to determine the time when UCL crosses the MRL line.
  • • Verification of residue compliance with legal limits (MRL)
  • • Compliance with VICH, FDA CVM, and EMA requirements
  • Critical parameters:
  • • Measured Residues: ≤ MRL
  • • Upper Confidence Limit (UCL 95%): ≤ MRL
  • 1. Sampling: Animals must be slaughtered at different time points to construct the depletion curve.
  • 2. Analytics: Methods (LC-MS/MS) must be validated with very low Limit of Quantification (LOQ).
  • 4. Interpretation: If UCL > MRL, the withdrawal period must be increased and additional measurements performed.

URS — User Requirements Specification

IDRequirementCriticalityAcceptance criterion
URS-001The utility shall accept an input.csv file for Residue Depletion & Withdrawal Period Quality Checker with headers defined in the data contract.HighThe file is processed without manual header editing.
URS-002The utility shall perform deterministic QC evaluation without machine learning and without probabilistic conformance decisions.HighIdentical input data, rule version and configuration produce reproducible results.
URS-003The utility shall validate mandatory fields, data types, ranges, units and domain plausibility.HighSchema, conversion and range errors are explicitly reported.
URS-004The utility shall apply domain limits and rules from the description, approved specification, registration dossier and local SOPs.HighEach check has PASS/WARNING/FAIL and a clear message.
URS-005The utility shall generate output.json with machine-readable results, source values, warnings, failures and critical findings.HighJSON is suitable for LIMS/ELN/MES integration and QA/QC review.
URS-006The utility shall preserve traceability between batch/sample, input file, applied rules and final status.HighOutput contains identifiers, checked parameters and audit metadata.
URS-007The documentation shall support IQ/OQ/PQ, CSV/CSA and review by internal QA or inspectors.MediumURS, FS, input/output contract and test scenarios are supplied with the utility.
URS-008The utility shall be used as a QC decision-support tool and not as a substitute for approved specifications and QA/QP release decision.MediumDocumentation states change control and limit-verification expectations.

input.csv contract

#FieldTypeSamplePurpose
1BatchNumberstring / controlled vocabularyWD-STUDY-2026-001Batch or lot identifier used for traceability.
2AnimalSpeciesstring / controlled vocabularyBovineControlled input parameter for deterministic QC rules.
3TissueTypestring / controlled vocabularyLiverControlled input parameter for deterministic QC rules.
4MRL_ppbdecimal100.0Controlled input parameter for deterministic QC rules.
5MeasuredResidue_ppbstring / controlled vocabulary45.0Controlled input parameter for deterministic QC rules.
6DaysAfterLastDoseinteger / decimal14Time parameter for process, incubation, storage or analytical workflow.
7UpperConfidenceLimit_95decimal85.0Approved limit applied during result evaluation.
8ProposedWithdrawalDaysinteger / decimal14Time parameter for process, incubation, storage or analytical workflow.
BatchNumber,AnimalSpecies,TissueType,MRL_ppb,MeasuredResidue_ppb,DaysAfterLastDose,UpperConfidenceLimit_95,ProposedWithdrawalDays
WD-STUDY-2026-001,Bovine,Liver,100.0,45.0,14,85.0,14
WD-STUDY-2026-002,Swine,Kidney,50.0,60.0,7,75.0,7
WD-STUDY-2026-003,Poultry,Muscle,10.0,2.0,5,8.0,5

Input validation rules

IDFieldRuleCriticality
VR-001BatchNumberThe field shall match an approved dictionary or accepted string representation.High
VR-002AnimalSpeciesThe field shall match an approved dictionary or accepted string representation.High
VR-003TissueTypeThe field shall match an approved dictionary or accepted string representation.High
VR-004MRL_ppbThe field shall match an approved dictionary or accepted string representation.Medium
VR-005MeasuredResidue_ppbThe field shall match an approved dictionary or accepted string representation.Medium
VR-006DaysAfterLastDoseThe field shall match an approved dictionary or accepted string representation.Medium
VR-007UpperConfidenceLimit_95The field shall match an approved dictionary or accepted string representation.Medium
VR-008ProposedWithdrawalDaysThe field shall match an approved dictionary or accepted string representation.Medium

FS — Functional Specification

IDFunctionImplementation
FS-001CLI executionSupport execution modes: demo mode without arguments and production mode input.csv output.json.
FS-002CSV importRead input.csv in UTF-8/CSV-compatible format and validate header and expected columns.
FS-003Schema validationCheck mandatory fields, column count, unknown key fields and empty mandatory values.
FS-004Type conversionConvert numeric, flag and text values; invalid format is recorded as a row-level error.
FS-005Domain rule engineApply rules for Residue Depletion & Withdrawal Period Quality Checker, including critical limits from the description and approved specification.
FS-006Status aggregationProduce final status: FAIL for critical failure, WARNING for non-critical deviation, PASS for conformance.
FS-007JSON exportWrite output.json with detailed checks, source values, warnings, failures and critical findings.
FS-008Audit supportKeep result structure suitable for review, deviation investigation and calculation reproduction.
FS-009Integration contractSupport the scenario LIMS/ELN/MES → input.csv → utility → output.json → portal/admin review.
FS-010Error handlingReturn explicit messages for missing file, empty CSV, invalid schema, output write failure and invalid format.

Example output.json

{
  "utilityId": "residuedepletion-withdrawalperiod-qualitychecker",
  "utilityFolder": "ResidueDepletion_WithdrawalPeriod_QualityChecker",
  "package": "Vet",
  "overallStatus": "PASS|WARNING|FAIL",
  "sourceFile": "input.csv",
  "processedAtUtc": "2026-06-10T00:00:00Z",
  "checks": [
    {
      "parameter": "BatchNumber",
      "value": "WD-STUDY-2026-001",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-001"
    },
    {
      "parameter": "AnimalSpecies",
      "value": "Bovine",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-002"
    },
    {
      "parameter": "TissueType",
      "value": "Liver",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-003"
    },
    {
      "parameter": "MRL_ppb",
      "value": "100.0",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-004"
    },
    {
      "parameter": "MeasuredResidue_ppb",
      "value": "45.0",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-005"
    },
    {
      "parameter": "DaysAfterLastDose",
      "value": "14",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-006"
    },
    {
      "parameter": "UpperConfidenceLimit_95",
      "value": "85.0",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-007"
    },
    {
      "parameter": "ProposedWithdrawalDays",
      "value": "14",
      "status": "PASS|WARNING|FAIL",
      "message": "Deterministic rule-based check result",
      "ruleReference": "FS-RULE-008"
    }
  ],
  "criticalFindings": [],
  "warnings": [],
  "audit": {
    "inputHash": "sha256:<calculated at runtime>",
    "rulesVersion": "<utility executable version>",
    "documentation": "ResidueDepletion_WithdrawalPeriod_QualityChecker.documentation.html"
  }
}

Traceability matrix

URSFSTestEvidence
URS-001FS-001, FS-002OQ-001Verify execution and import of valid input.csv.
URS-002FS-005, FS-006OQ-004Repeat the same dataset and compare output.json.
URS-003FS-003, FS-004, FS-010OQ-002, OQ-003Verify missing columns and invalid types.
URS-004FS-005, FS-006OQ-004, PQ-001Verify critical deviations on real/boundary data.
URS-005FS-007, FS-009OQ-005Verify JSON schema and downstream-system suitability.
URS-006FS-008OQ-006Verify identifiers and audit metadata.
URS-007FS-008, FS-010IQ-001, OQ-007Verify documentation completeness and control evidence.
URS-008FS-005, FS-008PQ-002Verify review workflow and no replacement of QA decision.

IQ/OQ/PQ test scenarios

IDScenarioExpected result
IQ-001Verify executable, input.csv, documentation and checksum availability.Delivery set is complete; version is recorded.
OQ-001Valid sample row from input.csv.PASS or acceptable WARNING according to rules.
OQ-002Remove a mandatory CSV column.Schema error or FAIL with missing-column reference.
OQ-003Place a non-numeric value into a numeric field.Type-conversion error with row/field reference.
OQ-004Set a critical parameter outside the limit.FAIL and critical finding.
OQ-005Verify output.json structure.All mandatory sections are present and JSON is valid.
OQ-006Verify batch/sample traceability.Input and result identifiers match.
PQ-001Verify 3–5 real user batches/samples.Result is confirmed by QC/QA review.
PQ-002Verify deviation workflow and manual QA decision.Utility supports review but does not replace approved decision.

QA/QC and change control

  • Do not rename columns without updating validator, documentation and test set.
  • Retain input.csv, output.json, executable version and checksum.
  • Before production use, perform IQ/OQ/PQ or equivalent CSV/CSA verification.
  • Critical limits shall be verified against the approved specification, registration dossier and local SOPs.
  • The utility provides structured QC decision support; final release decision remains with QA/QP and approved procedures.

Included in packages

Vet — Veterinary QC Utilities

Vet is designed for veterinary pharmaceuticals and vaccines: adjuvants, antigens, autogenous vaccines, aquaculture, feed/premixes, antimicrobial and antiparasitic products, sterility and batch release.

Open