TcmPesticideMultiResidueQualityChecker
Tcm Pesticide Multi Residue
ℹ️ Utility checks content of key pesticide classes according to ChP 2020 (Chapter 2341) and EU regulations:
• Organochlorines: BHC Total ≤200 ppb, DDT Total ≤200 ppb, PCNB ≤100 ppb, HCB ≤100 ppb
• Organophosphates: Chlorpyrifos ≤100 ppb, Diazinon, Parathion-methyl
• Pyrethroids: Cypermethrin ≤500 ppb, Bifenthrin
• Herbicides: Glyphosate ≤100 ppb
• Total number of detected pesticides (indicator of agricultural practice)
⚠️ CRITICAL: Organochlorine pesticides (DDT, BHC) are BANNED worldwide but persist in soil for 20-50 years!
Their presence in TCM is often due to soil contamination rather than direct application.
"Cocktail effect": combination of several pesticides may be more toxic than sum of individual substances.
Usage:
TcmPesticideMultiResidueQualityChecker.exe → demo mode (console output)
TcmPesticideMultiResidueQualityChecker.exe input.csv output.json → evaluate your data
Input format:
BatchNumber,HerbName,BHC_Total_ppb,DDT_Total_ppb,Quintozene_ppb,HCB_ppb,Chlorpyrifos_ppb,Diazinon_ppb,Parathion_Methyl_ppb,Cypermethrin_ppb,Bifenthrin_ppb,Glyphosate_ppb,TotalDetectedCount
Example:
TCM-GINSENG-2026-PEST-001,Panax_ginseng,50.0,80.0,30.0,20.0,40.0,10.0,0.0,200.0,15.0,50.0,6
Risk categories by raw material:
• Rhizomes (Ginseng, Notoginseng) — accumulate persistent organochlorines from soil
• Leaves and flowers (Tea, Chrysanthemum) — direct contact with spraying (pyrethroids, OPs)
• Seeds and fruits — systemic pesticides and fungicides
• Licorice, Astragalus — risk of contamination due to long cultivation cycle
— WHY IS THIS NEEDED?
Pesticides are the main source of chemical toxicity in herbal raw materials:
• Used intensively in agriculture for crop protection
• Many have neurotoxic, carcinogenic and endocrine-disrupting effects
• Capable of bioaccumulation in human body
• TCM export requires strict compliance with MRLs (Maximum Residue Limits) of importing countries
⚠️ CRITICAL:
• BHC and DDT ≤200 ppb — banned substances, limits set at background contamination level
• PCNB and HCB ≤100 ppb — fungicides with high persistence and toxicity
• Chlorpyrifos ≤100 ppb — neurotoxin, banned in EU and USA, but found in imported raw materials
• Cypermethrin ≤500 ppb — relatively safe pyrethroid, but frequent contaminant
• Glyphosate ≤100 ppb — most common herbicide, controversial carcinogenicity
• Total Detected Count > 5 — marker of intensive chemical farming
Key features:
• Screening of most dangerous and common pesticide classes
• Separate control of banned (POPs) and permitted substances
• Polycontamination risk assessment ("cocktail effect")
• Compliance with ChP 2020 Chapter 2341 and EU Reg. 396/2005
• Support for various matrices (roots, leaves, seeds)
Critical parameters:
• BHC Total: ≤200 ppb
• DDT Total: ≤200 ppb
• Quintozene (PCNB): ≤100 ppb
• HCB: ≤100 ppb
• Chlorpyrifos: ≤100 ppb
• Cypermethrin: ≤500 ppb
• Glyphosate: ≤100 ppb
💡 Usage tips:
1. Analysis performed by GC-MS/MS (for volatiles) and LC-MS/MS (for polar compounds e.g. glyphosate)
2. Use QuEChERS method for efficient pesticide extraction from complex TCM matrices
3. Glyphosate requires separate derivatization or specialized column
4. If banned pesticides (DDT, BHC) detected above background, consider changing supplier region
5. Regular monitoring helps identify seasonal peaks of agrochemical application
⚠️ Note: Unlike synthetic impurities, pesticide profile in TCM is UNPREDICTABLE and depends on geography, weather and farmer integrity. Same botanical species from different provinces may have drastically different contamination profiles. Multi-residue analysis (screening of hundreds of substances) is the GOLD STANDARD of safety, as targeted analysis of only 4-5 substances misses up to 80% of real contaminants.
input.csv
BatchNumber,HerbName,BHC_Total_ppb,DDT_Total_ppb,Quintozene_ppb,HCB_ppb,Chlorpyrifos_ppb,Diazinon_ppb,Parathion_Methyl_ppb,Cypermethrin_ppb,Bifenthrin_ppb,Glyphosate_ppb,TotalDetectedCount TCM-GINSENG-2026-PEST-001,Panax_ginseng,50.0,80.0,30.0,20.0,40.0,10.0,0.0,200.0,15.0,50.0,6 TCM-LICORICE-2026-PEST-002,Glycyrrhiza_uralensis,180.0,150.0,90.0,80.0,20.0,5.0,0.0,100.0,10.0,30.0,8 TCM-NOTOGINSENG-FAIL-003,Panax_notoginseng,250.0,300.0,120.0,110.0,150.0,50.0,10.0,600.0,80.0,200.0,12 TCM-CHAMOMILE-2026-PEST-004,Matricaria_chamomilla,10.0,15.0,5.0,2.0,5.0,0.0,0.0,50.0,2.0,10.0,4
TcmPesticideMultiResidueQualityChecker — URS & FS
TCM Pesticide Multi-Residue Quality Checker
TCM Pesticide Multi-Residue Quality Checker
1. Назначение документа
Документ описывает пользовательские требования (URS) и функциональную спецификацию (FS) для утилиты TcmPesticideMultiResidueQualityChecker. Утилита предназначена для детерминированной проверки данных input.csv, формирования структурированного результата output.json и поддержки прослеживаемого QA/QC review.
Документ является проектной URS/FS-основой для CSV/CSA, IQ/OQ/PQ и дальнейшей валидации в контексте конкретной лабораторной процедуры.
2. Исходное описание утилиты
3. URS — пользовательские требования
3.1 Цель и область применения
Система должна принимать табличные результаты лабораторного контроля, выполнять проверку по заранее заданным критериям и возвращать понятный статус по каждой серии/записи: Pass, Review или Fail.
3.2 Нормативная / методическая база
В исходном описании и правилах утилиты используются следующие ориентиры: ChP 2020, ChP, EP. Финальные лимиты должны быть подтверждены утверждённой спецификацией, монографией, SOP или протоколом трансфера метода.
3.3 Ключевые QC-проверки
- Органохлориновые: ГХЦГ (BHC) ≤200 ppb, ДДТ (DDT) ≤200 ppb, PCNB ≤100 ppb, HCB ≤100 ppb
- Фосфорорганические: Хлорпирифос ≤100 ppb, Диазинон, Паратион-метил
- Пиретроиды: Циперметрин ≤500 ppb, Бифентрин
- Гербициды: Глифосат ≤100 ppb
- Общее количество обнаруженных пестицидов (индикатор агрокультуры)
- Корневища (Женьшень, Нотоженьшень) — накапливают стойкие органохлорины из почвы
- Листья и цветы (Чай, Хризантема) — прямой контакт с опрыскиванием (пиретроиды, ФОС)
- Семена и плоды — системные пестициды и фунгициды
3.4 Пользователи
- QC analyst — подготовка и загрузка
input.csv. - QA/QC reviewer — проверка результата и отклонений.
- CSV/validation specialist — подтверждение пригодности утилиты.
- System owner — управление версией, доступом и изменениями.
3.5 Требования к данным и Data Integrity
- каждая строка CSV должна быть прослеживаемой к серии, образцу или измерению;
- исходные значения не должны изменяться утилитой;
- расчёты должны быть воспроизводимыми при повторном запуске;
- любое отклонение должно сохраняться как структурированное finding с указанием поля и правила;
- ручное изменение итогового статуса вне QA-процесса не допускается.
4. FS — функциональная спецификация
4.1 Поток обработки
- Проверить наличие и кодировку
input.csv. - Проверить заголовки, обязательные поля и типы данных.
- Нормализовать числовые и булевы значения без изменения исходного следа.
- Выбрать набор правил по категории продукта/типа, если он предусмотрен.
- Сравнить значения с лимитами и вычислить derived metrics.
- Сформировать запись результата по каждой строке.
- Сохранить
output.jsonс общей сводкой, findings и traceability.
4.2 CSV-схема
| № | Поле CSV | Тип | Обяз. | Назначение |
|---|---|---|---|---|
| 1 | BatchNumber | string | Да | Идентификатор серии / лота для прослеживаемости. |
| 2 | HerbName | string | Да | Идентичность продукта, препарата или образца. |
| 3 | BHC_Total_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 4 | DDT_Total_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 5 | Quintozene_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 6 | HCB_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 7 | Chlorpyrifos_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 8 | Diazinon_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 9 | Parathion_Methyl_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 10 | Cypermethrin_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 11 | Bifenthrin_ppb | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 12 | Glyphosate_ppb | decimal | Да | Показатель pH для контроля качества и совместимости матрицы. |
| 13 | TotalDetectedCount | integer | Да | Бинарный признак обнаружения для правил нулевой толерантности или предупреждений. |
4.3 Пример входных данных
| BatchNumber | HerbName | BHC_Total_ppb | DDT_Total_ppb | Quintozene_ppb | HCB_ppb | Chlorpyrifos_ppb | Diazinon_ppb | Parathion_Methyl_ppb | Cypermethrin_ppb | Bifenthrin_ppb | Glyphosate_ppb | TotalDetectedCount |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TCM-GINSENG-2026-PEST-001 | Panax_ginseng | 50.0 | 80.0 | 30.0 | 20.0 | 40.0 | 10.0 | 0.0 | 200.0 | 15.0 | 50.0 | 6 |
| TCM-LICORICE-2026-PEST-002 | Glycyrrhiza_uralensis | 180.0 | 150.0 | 90.0 | 80.0 | 20.0 | 5.0 | 0.0 | 100.0 | 10.0 | 30.0 | 8 |
| TCM-NOTOGINSENG-FAIL-003 | Panax_notoginseng | 250.0 | 300.0 | 120.0 | 110.0 | 150.0 | 50.0 | 10.0 | 600.0 | 80.0 | 200.0 | 12 |
| TCM-CHAMOMILE-2026-PEST-004 | Matricaria_chamomilla | 10.0 | 15.0 | 5.0 | 2.0 | 5.0 | 0.0 | 0.0 | 50.0 | 2.0 | 10.0 | 4 |
4.4 Выходной JSON
{
"utility": "TcmPesticideMultiResidueQualityChecker",
"runId": "urn:fuzkk:run:example",
"sourceFile": "input.csv",
"recordsProcessed": 4,
"overallStatus": "Pass / Review / Fail",
"records": [
{
"recordId": "TCM-GINSENG-2026-PEST-001",
"status": "Pass / Review / Fail",
"criticalFindings": [],
"warnings": [],
"evaluatedRules": [
"Configured acceptance criteria from the utility rule set"
],
"inputTrace": {
"BatchNumber": "TCM-GINSENG-2026-PEST-001",
"HerbName": "Panax_ginseng",
"BHC_Total_ppb": "50.0",
"DDT_Total_ppb": "80.0",
"Quintozene_ppb": "30.0",
"HCB_ppb": "20.0",
"Chlorpyrifos_ppb": "40.0",
"Diazinon_ppb": "10.0"
}
}
],
"dataIntegrity": {
"deterministicEvaluation": true,
"sourceRowTraceability": true,
"manualOverrideAllowed": false
}
}
5. Трассировка URS → FS → тесты
| URS | FS-механизм | Проверка |
|---|---|---|
| Загрузка корректного input.csv | CSV parser + schema validator | OQ: валидный/невалидный CSV |
| Детерминированная оценка лимитов | Rule engine с фиксированной конфигурацией | OQ: граничные значения и known expected results |
| Статусы Pass/Review/Fail | Status aggregator по findings | OQ/PQ: образцы с проходными и провальными сериями |
| Прослеживаемость к исходной строке | inputTrace + recordId | PQ: сверка output.json с исходным CSV |
| Поддержка QA review | структурированные findings и warnings | PQ: review сценарии и deviation handling |
6. CSV/CSA и валидационный подход
IQ
- проверка версии утилиты;
- проверка расположения исполняемого файла;
- проверка шаблона CSV;
- контроль прав доступа.
OQ
- проверка обязательных полей;
- проверка типов данных;
- проверка граничных значений;
- проверка zero-tolerance правил.
PQ
- прогоны на реальных/репрезентативных данных;
- сверка с ручным расчётом;
- подтверждение QA review workflow.
Change control
- версионирование лимитов;
- impact assessment при изменении правил;
- регрессия после обновления.
1. Document purpose
This document defines user requirements (URS) and functional specification (FS) for TcmPesticideMultiResidueQualityChecker. The utility is intended to evaluate input.csv data deterministically, generate structured output.json output and support traceable QA/QC review.
This document is a project-level URS/FS baseline for CSV/CSA, IQ/OQ/PQ and further validation under an approved laboratory procedure.
2. Source utility description
3. URS — user requirements
3.1 Intended use and scope
The system shall accept tabular laboratory QC results, evaluate them against configured acceptance criteria and return a clear status for each batch or record: Pass, Review or Fail.
3.2 Regulatory / methodological basis
The source description and utility rules refer to the following framework: ChP 2020, ChP, EP. Final acceptance limits shall be confirmed by the approved specification, pharmacopoeial monograph, SOP or method-transfer protocol.
3.3 Key QC checks
- Organochlorines: BHC Total ≤200 ppb, DDT Total ≤200 ppb, PCNB ≤100 ppb, HCB ≤100 ppb
- Organophosphates: Chlorpyrifos ≤100 ppb, Diazinon, Parathion-methyl
- Pyrethroids: Cypermethrin ≤500 ppb, Bifenthrin
- Herbicides: Glyphosate ≤100 ppb
- Total number of detected pesticides (indicator of agricultural practice)
- Rhizomes (Ginseng, Notoginseng) — accumulate persistent organochlorines from soil
- Leaves and flowers (Tea, Chrysanthemum) — direct contact with spraying (pyrethroids, OPs)
- Seeds and fruits — systemic pesticides and fungicides
3.4 Users
- QC analyst — prepares and loads
input.csv. - QA/QC reviewer — reviews output, findings and deviations.
- CSV/validation specialist — confirms fitness for intended use.
- System owner — controls versioning, access and change management.
3.5 Data and data-integrity requirements
- each CSV row shall be traceable to a batch, sample or analytical measurement;
- source values shall not be modified by the utility;
- calculations shall be reproducible on repeated execution;
- each deviation shall be captured as a structured finding with field and rule references;
- manual override of the final status outside QA process is not allowed.
4. FS — functional specification
4.1 Processing flow
- Verify presence and encoding of
input.csv. - Validate headers, mandatory fields and data types.
- Normalize numeric and boolean values while preserving the source trace.
- Select an adaptive rule set by product/category type, where applicable.
- Compare values with limits and compute derived metrics.
- Create a result record for each input row.
- Write
output.jsonwith summary, findings and traceability.
4.2 CSV schema
| # | CSV field | Type | Req. | Purpose |
|---|---|---|---|---|
| 1 | BatchNumber | string | Yes | Batch / lot identifier used for traceability. |
| 2 | HerbName | string | Yes | Product, preparation or sample identity. |
| 3 | BHC_Total_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 4 | DDT_Total_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 5 | Quintozene_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 6 | HCB_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 7 | Chlorpyrifos_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 8 | Diazinon_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 9 | Parathion_Methyl_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 10 | Cypermethrin_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 11 | Bifenthrin_ppb | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 12 | Glyphosate_ppb | decimal | Yes | pH-related measurement used for quality and matrix compatibility control. |
| 13 | TotalDetectedCount | integer | Yes | Binary detection flag used for zero-tolerance or warning rules. |
4.3 Input data example
| BatchNumber | HerbName | BHC_Total_ppb | DDT_Total_ppb | Quintozene_ppb | HCB_ppb | Chlorpyrifos_ppb | Diazinon_ppb | Parathion_Methyl_ppb | Cypermethrin_ppb | Bifenthrin_ppb | Glyphosate_ppb | TotalDetectedCount |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TCM-GINSENG-2026-PEST-001 | Panax_ginseng | 50.0 | 80.0 | 30.0 | 20.0 | 40.0 | 10.0 | 0.0 | 200.0 | 15.0 | 50.0 | 6 |
| TCM-LICORICE-2026-PEST-002 | Glycyrrhiza_uralensis | 180.0 | 150.0 | 90.0 | 80.0 | 20.0 | 5.0 | 0.0 | 100.0 | 10.0 | 30.0 | 8 |
| TCM-NOTOGINSENG-FAIL-003 | Panax_notoginseng | 250.0 | 300.0 | 120.0 | 110.0 | 150.0 | 50.0 | 10.0 | 600.0 | 80.0 | 200.0 | 12 |
| TCM-CHAMOMILE-2026-PEST-004 | Matricaria_chamomilla | 10.0 | 15.0 | 5.0 | 2.0 | 5.0 | 0.0 | 0.0 | 50.0 | 2.0 | 10.0 | 4 |
4.4 Output JSON
{
"utility": "TcmPesticideMultiResidueQualityChecker",
"runId": "urn:fuzkk:run:example",
"sourceFile": "input.csv",
"recordsProcessed": 4,
"overallStatus": "Pass / Review / Fail",
"records": [
{
"recordId": "TCM-GINSENG-2026-PEST-001",
"status": "Pass / Review / Fail",
"criticalFindings": [],
"warnings": [],
"evaluatedRules": [
"Configured acceptance criteria from the utility rule set"
],
"inputTrace": {
"BatchNumber": "TCM-GINSENG-2026-PEST-001",
"HerbName": "Panax_ginseng",
"BHC_Total_ppb": "50.0",
"DDT_Total_ppb": "80.0",
"Quintozene_ppb": "30.0",
"HCB_ppb": "20.0",
"Chlorpyrifos_ppb": "40.0",
"Diazinon_ppb": "10.0"
}
}
],
"dataIntegrity": {
"deterministicEvaluation": true,
"sourceRowTraceability": true,
"manualOverrideAllowed": false
}
}
5. Traceability URS → FS → tests
| URS | FS mechanism | Test evidence |
|---|---|---|
| Load valid input.csv | CSV parser + schema validator | OQ: valid/invalid CSV cases |
| Deterministic limit evaluation | Rule engine with fixed configuration | OQ: boundary values and known expected results |
| Pass/Review/Fail statuses | Status aggregator based on findings | OQ/PQ: passing and failing representative batches |
| Traceability to source row | inputTrace + recordId | PQ: output.json reconciliation to source CSV |
| QA review support | structured findings and warnings | PQ: review and deviation-handling scenarios |
6. CSV/CSA and validation approach
IQ
- utility version check;
- executable location check;
- CSV template check;
- access-right verification.
OQ
- mandatory field checks;
- data type checks;
- boundary-value checks;
- zero-tolerance rule checks.
PQ
- runs on real or representative data;
- comparison with manual calculation;
- confirmation of QA review workflow.
Change control
- rule and limit versioning;
- impact assessment for rule changes;
- regression after updates.
Included in packages
Traditional Chinese Medicine (TCM) QC Suite
QC utility package for TCM: botanical identity, fingerprint consistency, marker compounds, decoction pieces, Paozhi processing, pesticides, mycotoxins, heavy metals, sulfur fumigation, microbial limits and adulteration screening.
Open