How to encode Westgard quality control rules with traceable audit trails in laboratory information systems used in regulated environments.
Why this matters
LIS quality control is not just a technical feature. It is a patient safety requirement and a regulatory requirement.
Rule groups commonly implemented
- 1_2s as warning rule
- 1_3s, 2_2s, R_4s as reject rules
- 4_1s and 10x for trend detection
QC decision flow
Diagram (Mermaid)
Implementation notes
- keep instrument raw values immutable
- evaluate rules per analyte and control level
- capture who approved override, why, and when
- expose QC timeline in auditor-friendly format
SQL query used for audit extraction
sql
SELECT run_id, analyte, rule_code, decision, approved_by, approved_at
FROM qc_decisions
WHERE run_date >= CURRENT_DATE - INTERVAL '30 day'
ORDER BY run_date DESC, analyte;Final takeaway
A compliant LIS implementation combines deterministic rule evaluation with complete auditability and controlled override workflow.