TcmSulfurFumigationExcessChecker
Tcm Sulfur Fumigation Excess
ℹ️ Utility performs comprehensive assessment of sulfur dioxide fumigation consequences according to ChP 2020 (Chapter 2331):
• Total sulfur dioxide: ≤150 ppm (general limit) / ≤400 ppm (for Angelica, Codonopsis, Dioscorea, Paeonia)
• Active compound retention: ≥70% (ratio of native marker to native + degraded sum)
• Sulfonation/degradation products: ≤50 ppm
• Aqueous extract pH: 4.0–7.5
• Color deviation index: ≤5.0 (artificial bleaching marker)
⚠️ CRITICAL: This utility goes beyond simple SO2 control!
Sulfur dioxide chemically reacts with active TCM components:
• Glycosides → sulfonated derivatives (activity loss)
• Flavonoids → chromophore system destruction
• Organic acids → sulfurous acid ester formation
• Vitamins/antioxidants → irreversible oxidation
Result: raw material may pass Ph.Eur. SO2 test but be THERAPEUTICALLY USELESS.
This utility detects exactly this hidden quality loss.
Usage:
TcmSulfurFumigationExcessChecker.exe → demo mode (console output)
TcmSulfurFumigationExcessChecker.exe input.csv output.json → evaluate your data
Input format:
BatchNumber,HerbName,SO2_ppm,MarkerOriginal_ppm,MarkerDegraded_ppm,pH_Extract,ColorDeviationIndex,Moisture_pct
Example (Normal):
TCM-001,Angelica_sinensis,80.0,450.0,15.0,5.8,1.2,11.5
Risk groups by raw material:
• Rhizomes and roots (Angelica, Codonopsis, Paeonia) — most frequently fumigated
• Flowers and fruits (Chrysanthemum, Goji, Lily) — bleaching for commercial appearance
• Mushrooms (Poria, Cordyceps) — mold protection during storage
• All starchy and sugary species — high reactivity with SO2
— WHY IS THIS NEEDED?
Sulfur fumigation is a traditional TCM preservation method, but its excessive use creates dual problem:
1. TOXICOLOGICAL: SO2 causes allergic reactions, bronchospasm, GI irritation
2. THERAPEUTIC: Chemical modification of active substances reduces or eliminates therapeutic effect
Western pharmacopoeias (Ph.Eur., USP) control ONLY parameter #1 (SO2 residual).
Parameter #2 (efficacy loss) remains outside regulatory scope.
This utility closes this gap by linking chemical safety with clinical effectiveness.
⚠️ CRITICAL:
• SO2 ≤150 ppm (general) / ≤400 ppm (specific herbs per ChP 2020)
• Active Retention ≥70% — if lower, raw material has lost therapeutic value
• Degradation Products ≤50 ppm — direct evidence of chemical reaction with SO2
• pH 4.0–7.5 — out-of-range indicates excessive acidity from H2SO3/H2SO4
• Color Deviation ≤5.0 — high value = suspicion of intentional bleaching
Key features:
• Dual assessment: safety (SO2) + efficacy (retention)
• Differentiated SO2 limits for different raw material categories per ChP
• Retention coefficient calculation via marker ratio
• Instrumental parameters (pH, color) as indirect over-processing indicators
• Detection of "therapeutically dead" raw material formally passing QC
Critical parameters:
• SO2 Total: ≤150 ppm (general) / ≤400 ppm (Angelica, Codonopsis, Dioscorea, Paeonia)
• Active Compound Retention: ≥70%
• Sulfonation/Degradation Products: ≤50 ppm
• Extract pH: 4.0–7.5
• Color Deviation Index: ≤5.0
💡 Usage tips:
1. SO2 determination method: Monier-Williams distillation with titration (ChP 2331) or ion chromatography
2. Retention calculation requires analysis of BOTH NATIVE and SULFONATED markers by LC-MS/UV
3. Color Deviation measured spectrophotometrically or by colorimeter against reference standard
4. pH determined in aqueous extract (1:10 w/v, 30 min steeping)
5. If Retention <70%, batch must be rejected even if SO2 is within limits — it is clinically useless
6. High Color Deviation + low pH + high SO2 = classic profile of over-processed raw material
⚠️ Note: Unlike heavy metals or pesticides, SO2 is a LEGAL processing aid in TCM. The problem is not SO2 presence per se, but its EXCESS and SIDE REACTIONS. This utility is unique in treating sulfur fumigation not as binary pass/fail test, but as continuous process affecting pharmacological quality. This approach is absent in BHP and Ph.Eur. but critically important for guaranteeing actual TCM preparation effectiveness.
input.csv
BatchNumber,HerbName,SO2_Total_ppm,MarkerOriginal_ppm,MarkerDegraded_ppm,PhExtract,ColorDeviationIndex,MoisturePercent TCM-ANGELICA-2026-SO2-001,Angelica_sinensis,80.0,450.0,15.0,5.8,1.2,11.5 TCM-CODONOPSIS-2026-SO2-002,Codonopsis_pilosula,320.0,280.0,35.0,5.2,3.5,12.0 TCM-LILY-FAIL-2026-003,Lilium_brownii,450.0,120.0,180.0,3.9,8.5,14.0 TCM-PORIA-2026-SO2-004,Poria_cocos,60.0,15.0,2.0,6.1,0.8,10.5 TCM-GINSENG-FAIL-2026-005,Panax_ginseng,200.0,180.0,95.0,4.2,6.2,13.0
TcmSulfurFumigationExcessChecker — URS & FS
TCM Sulfur Fumigation Excess Checker
TCM Sulfur Fumigation Excess Checker
1. Назначение документа
Документ описывает пользовательские требования (URS) и функциональную спецификацию (FS) для утилиты TcmSulfurFumigationExcessChecker. Утилита предназначена для детерминированной проверки данных 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, USP, EP, Ph.Eur, Ph.Eur., BHP, EMA. Финальные лимиты должны быть подтверждены утверждённой спецификацией, монографией, SOP или протоколом трансфера метода.
3.3 Ключевые QC-проверки
- Диоксид серы общий: ≤150 ppm (общий лимит) / ≤400 ppm (для Angelica, Codonopsis, Dioscorea, Paeonia)
- Сохранность активного компонента: ≥70% (отношение нативного маркера к сумме нативный + деградировавший)
- Продукты сульфитации/деградации: ≤50 ppm
- pH водного извлечения: 4.0–7.5
- Индекс отклонения цвета: ≤5.0 (маркер искусственного отбеливания)
- Гликозиды → сульфонированные производные (потеря активности)
- Флавоноиды → разрушение хромофорной системы
- Органические кислоты → образование сложных эфиров сернистой кислоты
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 | SO2_Total_ppm | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 4 | MarkerOriginal_ppm | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 5 | MarkerDegraded_ppm | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
| 6 | PhExtract | decimal | Да | Показатель pH для контроля качества и совместимости матрицы. |
| 7 | ColorDeviationIndex | decimal | Да | Входной атрибут для детерминированной оценки правил и прослеживаемости результата. |
| 8 | MoisturePercent | decimal | Да | Измеренный аналитический результат для сравнения с критерием приемлемости. |
4.3 Пример входных данных
| BatchNumber | HerbName | SO2_Total_ppm | MarkerOriginal_ppm | MarkerDegraded_ppm | PhExtract | ColorDeviationIndex | MoisturePercent |
|---|---|---|---|---|---|---|---|
| TCM-ANGELICA-2026-SO2-001 | Angelica_sinensis | 80.0 | 450.0 | 15.0 | 5.8 | 1.2 | 11.5 |
| TCM-CODONOPSIS-2026-SO2-002 | Codonopsis_pilosula | 320.0 | 280.0 | 35.0 | 5.2 | 3.5 | 12.0 |
| TCM-LILY-FAIL-2026-003 | Lilium_brownii | 450.0 | 120.0 | 180.0 | 3.9 | 8.5 | 14.0 |
| TCM-PORIA-2026-SO2-004 | Poria_cocos | 60.0 | 15.0 | 2.0 | 6.1 | 0.8 | 10.5 |
| TCM-GINSENG-FAIL-2026-005 | Panax_ginseng | 200.0 | 180.0 | 95.0 | 4.2 | 6.2 | 13.0 |
4.4 Выходной JSON
{
"utility": "TcmSulfurFumigationExcessChecker",
"runId": "urn:fuzkk:run:example",
"sourceFile": "input.csv",
"recordsProcessed": 5,
"overallStatus": "Pass / Review / Fail",
"records": [
{
"recordId": "TCM-ANGELICA-2026-SO2-001",
"status": "Pass / Review / Fail",
"criticalFindings": [],
"warnings": [],
"evaluatedRules": [
"Configured acceptance criteria from the utility rule set"
],
"inputTrace": {
"BatchNumber": "TCM-ANGELICA-2026-SO2-001",
"HerbName": "Angelica_sinensis",
"SO2_Total_ppm": "80.0",
"MarkerOriginal_ppm": "450.0",
"MarkerDegraded_ppm": "15.0",
"PhExtract": "5.8",
"ColorDeviationIndex": "1.2",
"MoisturePercent": "11.5"
}
}
],
"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 TcmSulfurFumigationExcessChecker. 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, USP, EP, Ph.Eur, Ph.Eur., BHP, EMA. Final acceptance limits shall be confirmed by the approved specification, pharmacopoeial monograph, SOP or method-transfer protocol.
3.3 Key QC checks
- Total sulfur dioxide: ≤150 ppm (general limit) / ≤400 ppm (for Angelica, Codonopsis, Dioscorea, Paeonia)
- Active compound retention: ≥70% (ratio of native marker to native + degraded sum)
- Sulfonation/degradation products: ≤50 ppm
- Aqueous extract pH: 4.0–7.5
- Color deviation index: ≤5.0 (artificial bleaching marker)
- Glycosides → sulfonated derivatives (activity loss)
- Flavonoids → chromophore system destruction
- Organic acids → sulfurous acid ester formation
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 | SO2_Total_ppm | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 4 | MarkerOriginal_ppm | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 5 | MarkerDegraded_ppm | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
| 6 | PhExtract | decimal | Yes | pH-related measurement used for quality and matrix compatibility control. |
| 7 | ColorDeviationIndex | decimal | Yes | Input attribute required for deterministic rule evaluation and output traceability. |
| 8 | MoisturePercent | decimal | Yes | Measured analytical result compared with the configured acceptance criterion. |
4.3 Input data example
| BatchNumber | HerbName | SO2_Total_ppm | MarkerOriginal_ppm | MarkerDegraded_ppm | PhExtract | ColorDeviationIndex | MoisturePercent |
|---|---|---|---|---|---|---|---|
| TCM-ANGELICA-2026-SO2-001 | Angelica_sinensis | 80.0 | 450.0 | 15.0 | 5.8 | 1.2 | 11.5 |
| TCM-CODONOPSIS-2026-SO2-002 | Codonopsis_pilosula | 320.0 | 280.0 | 35.0 | 5.2 | 3.5 | 12.0 |
| TCM-LILY-FAIL-2026-003 | Lilium_brownii | 450.0 | 120.0 | 180.0 | 3.9 | 8.5 | 14.0 |
| TCM-PORIA-2026-SO2-004 | Poria_cocos | 60.0 | 15.0 | 2.0 | 6.1 | 0.8 | 10.5 |
| TCM-GINSENG-FAIL-2026-005 | Panax_ginseng | 200.0 | 180.0 | 95.0 | 4.2 | 6.2 | 13.0 |
4.4 Output JSON
{
"utility": "TcmSulfurFumigationExcessChecker",
"runId": "urn:fuzkk:run:example",
"sourceFile": "input.csv",
"recordsProcessed": 5,
"overallStatus": "Pass / Review / Fail",
"records": [
{
"recordId": "TCM-ANGELICA-2026-SO2-001",
"status": "Pass / Review / Fail",
"criticalFindings": [],
"warnings": [],
"evaluatedRules": [
"Configured acceptance criteria from the utility rule set"
],
"inputTrace": {
"BatchNumber": "TCM-ANGELICA-2026-SO2-001",
"HerbName": "Angelica_sinensis",
"SO2_Total_ppm": "80.0",
"MarkerOriginal_ppm": "450.0",
"MarkerDegraded_ppm": "15.0",
"PhExtract": "5.8",
"ColorDeviationIndex": "1.2",
"MoisturePercent": "11.5"
}
}
],
"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