Utility description: Control Chart Trend
Control Chart Trend Utility — Shewhart Control Charts and Trend Analysis
ℹ️ Utility performs statistical analysis of historical Quality Control (QC) data according to ICH Q10 and ASTM E2587 principles:
• Baseline Calculation: Determination of Mean and Standard Deviation (SD) from historical data.
• Control Limits: Automatic calculation of Warning Limits (±2SD) and Action Limits (±3SD).
• Anomaly Detection: Application of Westgard/Shewhart rules to detect trends (7 consecutive points), shifts, and outliers.
• OOS Screening: Counting points exceeding established product specifications.
⚠️ IMPORTANT:
• At least 20-25 consecutive batches are recommended for building a reliable control chart.
• The utility assumes the process is in a statistically controlled state when calculating the baseline.
Usage:
ControlChartTrendUtility.exe → demo mode (console output)
ControlChartTrendUtility.exe input.csv output.json → evaluate your data
Input format:
BatchNumber,ProductName,TestParameterName,Value,SpecLower,SpecUpper
Example:
BATCH-001,Paracetamol,Assay,99.5,98.0,102.0
📍 Scope of Application (Usage Where):
• Annual Product Review (APR/PQR): Identification of long-term trends.
• Process Validation: Confirmation of process stability.
• Deviation Investigation: Determining the onset of parameter drift.
• Risk Management: Early warning of potential loss of process control.
— WHY IS THIS NEEDED?
Manual analysis of dozens of batches is difficult and often limited to simple "in/out of specification" checks.
Statistical Process Control (SPC) allows identifying systematic errors before they lead to rejection.
This is critically important for complying with FDA requirements for continuous improvement and product lifecycle management.
⚠️ CRITICAL:
• Trend: 7 or more points consecutively increasing or decreasing indicate equipment wear or raw material degradation.
• Shift: Sudden change in mean level may indicate supplier change or equipment setting adjustment.
• Outlier: Point beyond 3SD requires immediate investigation as potential OOS.
Key features:
• Automatic calculation of statistical parameters
• Application of Westgard rules for non-random pattern detection
• Data grouping by products and tests
• JSON report generation for integration with quality systems
• Compliance with GMP requirements for trend analysis
Critical parameters:
• Mean: Process center line
• SD: Measure of process variability
• UCL/LCL (3SD): Statistical control boundaries
• Points Outside Spec: Number of specification exceedances
💡 Usage tips:
1. Data Cleanliness: Exclude points associated with known laboratory errors (OOL) from calculation to avoid distorting the baseline.
2. Update Frequency: Recalculate control limits upon significant process changes (Change Control).
3. Minimum Volume: Do not draw conclusions from fewer than 10 data points.
4. Context: Always correlate statistical findings with production logs (Batch Records).
5. Documentation: Save JSON reports as part of the Annual Product Review (PQR).
⚠️ Note: This utility is a decision support tool. It does not replace expert assessment by a quality specialist but provides an objective statistical basis for such assessment.
input.csv
BatchNumber,ProductName,TestParameterName,Value,SpecLower,SpecUpper
BATCH-2026-001,Paracetamol,Assay,99.45,98.0,102.0
BATCH-2026-002,Paracetamol,Assay,99.62,98.0,102.0
BATCH-2026-003,Paracetamol,Assay,99.38,98.0,102.0
BATCH-2026-004,Paracetamol,Assay,99.71,98.0,102.0
BATCH-2026-005,Paracetamol,Assay,99.55,98.0,102.0
BATCH-2026-006,Paracetamol,Assay,99.49,98.0,102.0
BATCH-2026-007,Paracetamol,Assay,99.82,98.0,102.0
BATCH-2026-008,Paracetamol,Assay,99.33,98.0,102.0
BATCH-2026-009,Paracetamol,Assay,99.67,98.0,102.0
BATCH-2026-010,Paracetamol,Assay,99.51,98.0,102.0
BATCH-2026-011,Paracetamol,Assay,99.44,98.0,102.0
BATCH-2026-012,Paracetamol,Assay,99.78,98.0,102.0
BATCH-2026-013,Paracetamol,Assay,99.59,98.0,102.0
BATCH-2026-014,Paracetamol,Assay,99.36,98.0,102.0
BATCH-2026-015,Paracetamol,Assay,99.63,98.0,102.0
BATCH-2026-016,Paracetamol,Assay,99.48,98.0,102.0
BATCH-2026-017,Paracetamol,Assay,99.75,98.0,102.0
BATCH-2026-018,Paracetamol,Assay,99.52,98.0,102.0
BATCH-2026-019,Paracetamol,Assay,99.41,98.0,102.0
BATCH-2026-020,Paracetamol,Assay,99.69,98.0,102.0
URS & FS — User Requirements and Functional Specification
This document describes the controlled interface and behaviour of ControlChartTrendUtility for Control Chart Trend Utility.
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 performs statistical analysis of historical Quality Control (QC) data according to ICH Q10 and ASTM E2587 principles:
- • Control Limits: Automatic calculation of Warning Limits (±2SD) and Action Limits (±3SD).
- Manual analysis of dozens of batches is difficult and often limited to simple "in/out of specification" checks.
- This is critically important for complying with FDA requirements for continuous improvement and product lifecycle management.
- ⚠️ CRITICAL:
- • Compliance with GMP requirements for trend analysis
- Critical parameters:
- 2. Update Frequency: Recalculate control limits upon significant process changes (Change Control).
URS — User Requirements Specification
| ID | Requirement | Criticality | Acceptance criterion |
|---|
| URS-001 | The utility shall accept an input.csv file for Control Chart Trend Utility with headers defined in the data contract. | High | The file is processed without manual header editing. |
| URS-002 | The utility shall perform deterministic QC evaluation without machine learning and without probabilistic conformance decisions. | High | Identical input data, rule version and configuration produce reproducible results. |
| URS-003 | The utility shall validate mandatory fields, data types, ranges, units and domain plausibility. | High | Schema, conversion and range errors are explicitly reported. |
| URS-004 | The utility shall apply domain limits and rules from the description, approved specification, registration dossier and local SOPs. | High | Each check has PASS/WARNING/FAIL and a clear message. |
| URS-005 | The utility shall generate output.json with machine-readable results, source values, warnings, failures and critical findings. | High | JSON is suitable for LIMS/ELN/MES integration and QA/QC review. |
| URS-006 | The utility shall preserve traceability between batch/sample, input file, applied rules and final status. | High | Output contains identifiers, checked parameters and audit metadata. |
| URS-007 | The documentation shall support IQ/OQ/PQ, CSV/CSA and review by internal QA or inspectors. | Medium | URS, FS, input/output contract and test scenarios are supplied with the utility. |
| URS-008 | The utility shall be used as a QC decision-support tool and not as a substitute for approved specifications and QA/QP release decision. | Medium | Documentation states change control and limit-verification expectations. |
input.csv contract
| # | Field | Type | Sample | Purpose |
|---|
| 1 | BatchNumber | string / controlled vocabulary | BATCH-2026-001 | Batch or lot identifier used for traceability. |
| 2 | ProductName | string / controlled vocabulary | Paracetamol | Product or dosage-form name under evaluation. |
| 3 | TestParameterName | string / controlled vocabulary | Assay | Biological/molecular component controlled as a CQA. |
| 4 | Value | decimal | 99.45 | Controlled input parameter for deterministic QC rules. |
| 5 | SpecLower | decimal | 98.0 | Controlled input parameter for deterministic QC rules. |
| 6 | SpecUpper | decimal | 102.0 | Controlled input parameter for deterministic QC rules. |
BatchNumber,ProductName,TestParameterName,Value,SpecLower,SpecUpper
BATCH-2026-001,Paracetamol,Assay,99.45,98.0,102.0
BATCH-2026-002,Paracetamol,Assay,99.62,98.0,102.0
BATCH-2026-003,Paracetamol,Assay,99.38,98.0,102.0
Input validation rules
| ID | Field | Rule | Criticality |
|---|
| VR-001 | BatchNumber | The field shall match an approved dictionary or accepted string representation. | High |
| VR-002 | ProductName | The field shall match an approved dictionary or accepted string representation. | High |
| VR-003 | TestParameterName | The field shall match an approved dictionary or accepted string representation. | High |
| VR-004 | Value | The field shall match an approved dictionary or accepted string representation. | Medium |
| VR-005 | SpecLower | The field shall match an approved dictionary or accepted string representation. | Medium |
| VR-006 | SpecUpper | The field shall match an approved dictionary or accepted string representation. | Medium |
FS — Functional Specification
| ID | Function | Implementation |
|---|
| FS-001 | CLI execution | Support execution modes: demo mode without arguments and production mode input.csv output.json. |
| FS-002 | CSV import | Read input.csv in UTF-8/CSV-compatible format and validate header and expected columns. |
| FS-003 | Schema validation | Check mandatory fields, column count, unknown key fields and empty mandatory values. |
| FS-004 | Type conversion | Convert numeric, flag and text values; invalid format is recorded as a row-level error. |
| FS-005 | Domain rule engine | Apply rules for Control Chart Trend Utility, including critical limits from the description and approved specification. |
| FS-006 | Status aggregation | Produce final status: FAIL for critical failure, WARNING for non-critical deviation, PASS for conformance. |
| FS-007 | JSON export | Write output.json with detailed checks, source values, warnings, failures and critical findings. |
| FS-008 | Audit support | Keep result structure suitable for review, deviation investigation and calculation reproduction. |
| FS-009 | Integration contract | Support the scenario LIMS/ELN/MES → input.csv → utility → output.json → portal/admin review. |
| FS-010 | Error handling | Return explicit messages for missing file, empty CSV, invalid schema, output write failure and invalid format. |
Example output.json
{
"utilityId": "controlcharttrendutility",
"utilityFolder": "ControlChartTrendUtility",
"package": "Vet",
"overallStatus": "PASS|WARNING|FAIL",
"sourceFile": "input.csv",
"processedAtUtc": "2026-06-10T00:00:00Z",
"checks": [
{
"parameter": "BatchNumber",
"value": "BATCH-2026-001",
"status": "PASS|WARNING|FAIL",
"message": "Deterministic rule-based check result",
"ruleReference": "FS-RULE-001"
},
{
"parameter": "ProductName",
"value": "Paracetamol",
"status": "PASS|WARNING|FAIL",
"message": "Deterministic rule-based check result",
"ruleReference": "FS-RULE-002"
},
{
"parameter": "TestParameterName",
"value": "Assay",
"status": "PASS|WARNING|FAIL",
"message": "Deterministic rule-based check result",
"ruleReference": "FS-RULE-003"
},
{
"parameter": "Value",
"value": "99.45",
"status": "PASS|WARNING|FAIL",
"message": "Deterministic rule-based check result",
"ruleReference": "FS-RULE-004"
},
{
"parameter": "SpecLower",
"value": "98.0",
"status": "PASS|WARNING|FAIL",
"message": "Deterministic rule-based check result",
"ruleReference": "FS-RULE-005"
},
{
"parameter": "SpecUpper",
"value": "102.0",
"status": "PASS|WARNING|FAIL",
"message": "Deterministic rule-based check result",
"ruleReference": "FS-RULE-006"
}
],
"criticalFindings": [],
"warnings": [],
"audit": {
"inputHash": "sha256:<calculated at runtime>",
"rulesVersion": "<utility executable version>",
"documentation": "ControlChartTrendUtility.documentation.html"
}
}
Traceability matrix
| URS | FS | Test | Evidence |
|---|
| URS-001 | FS-001, FS-002 | OQ-001 | Verify execution and import of valid input.csv. |
| URS-002 | FS-005, FS-006 | OQ-004 | Repeat the same dataset and compare output.json. |
| URS-003 | FS-003, FS-004, FS-010 | OQ-002, OQ-003 | Verify missing columns and invalid types. |
| URS-004 | FS-005, FS-006 | OQ-004, PQ-001 | Verify critical deviations on real/boundary data. |
| URS-005 | FS-007, FS-009 | OQ-005 | Verify JSON schema and downstream-system suitability. |
| URS-006 | FS-008 | OQ-006 | Verify identifiers and audit metadata. |
| URS-007 | FS-008, FS-010 | IQ-001, OQ-007 | Verify documentation completeness and control evidence. |
| URS-008 | FS-005, FS-008 | PQ-002 | Verify review workflow and no replacement of QA decision. |
IQ/OQ/PQ test scenarios
| ID | Scenario | Expected result |
|---|
| IQ-001 | Verify executable, input.csv, documentation and checksum availability. | Delivery set is complete; version is recorded. |
| OQ-001 | Valid sample row from input.csv. | PASS or acceptable WARNING according to rules. |
| OQ-002 | Remove a mandatory CSV column. | Schema error or FAIL with missing-column reference. |
| OQ-003 | Place a non-numeric value into a numeric field. | Type-conversion error with row/field reference. |
| OQ-004 | Set a critical parameter outside the limit. | FAIL and critical finding. |
| OQ-005 | Verify output.json structure. | All mandatory sections are present and JSON is valid. |
| OQ-006 | Verify batch/sample traceability. | Input and result identifiers match. |
| PQ-001 | Verify 3–5 real user batches/samples. | Result is confirmed by QC/QA review. |
| PQ-002 | Verify 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.