Skip to main content
Version: 3.0.1

Westgard Rules Requirements

Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: Statistical quality control validation of laboratory control samples using industry-standard Westgard methodology Domain: RULES-WG Precedence: After Runfile Import, Before Error Resolution


Statement

The system shall detect systematic and random errors in quality control (QC) data by comparing control measurements against statistical limits based on the mean and standard deviation, using industry-standard Westgard methodology.

The Westgard rule family includes single-control threshold rules (1:2s, 1:3s, 1:4s), multi-control pattern rules (2:2s, 7T), and combined rules (WG13S22S, WG7T13S). When a control fails a Westgard rule, the system propagates an error status (WgInError) to affected runs and supports resolution workflows. Processing order matters: WG14S executes before WG13S, which executes before WG12S.


Quick Reference

IDCore BehaviorPriorityStatus
REQ-RULES-WG-001Exclude resolved controls from Westgard calculationsHIGHDraft
REQ-RULES-WG-002Use same-run controls as history for evaluationHIGHDraft
REQ-RULES-WG-003Scope WgInError to runs after failed control's extraction dateHIGHDraft
REQ-RULES-WG-004Set INVALID_SD error for invalid standard deviationHIGHDraft
REQ-RULES-WG-005Set WESTGARDS_MISSED error when extraction precedes config rangeHIGHDraft
REQ-RULES-WG-006Trigger 1:2s rule when CT/quant exceeds 2SDHIGHDraft
REQ-RULES-WG-007Trigger 1:3s rule when CT/quant exceeds 3SDHIGHDraft
REQ-RULES-WG-008Trigger 1:4s rule when CT/quant exceeds 4SDHIGHDraft
REQ-RULES-WG-009Trigger 2:2s rule for two consecutive controls >2SD same sideHIGHDraft
REQ-RULES-WG-010Support configurable strict boundary enforcementMEDIUMDraft
REQ-RULES-WG-011Trigger 7T rule for seven consecutive trending controlsHIGHDraft
REQ-RULES-WG-012Trigger WG13S22S combined ruleHIGHDraft
REQ-RULES-WG-013Trigger WG7T13S combined ruleHIGHDraft

Key Integration Points: Runfile Import, Kit Configuration, Levey-Jennings Report, Error Resolution


Rule Flowchart (Illustrative)

This diagram illustrates the Westgard rule evaluation flow. Resolved controls are excluded from history checks (not shown). Severity levels and client configurations affect actual behavior.


Definitions

TermDefinition
CTCycle threshold value from PCR analysis
LJLevey-Jennings quality control chart
PECPositive Extraction Control - a control sample used to verify extraction and amplification
QCQuality Control
SDStandard Deviation
Westgard LimitConfigured mean and standard deviation for a control/target combination
WgInErrorWestgard In Error status indicating a Westgard rule violation
Resolved ControlA control with Westgard error that has been acknowledged via resolution workflow

Assumptions

  • Westgard limits are configured for the control/target combinations being evaluated
  • Controls have valid CT or quantification values for evaluation
  • Extraction dates are available for time-range calculations
  • At least one previous control exists for multi-control rule evaluation (2:2s, 7T)

Requirements

General Westgard Behavior (REQ-RULES-WG-001, 002, 003)

FR-WG-001: Exclude Resolved Controls from Calculations

The system shall exclude resolved controls from Westgard rule calculations for subsequent controls.

Acceptance Criteria

Exclusion Scope:

  • Resolved controls shall be excluded from 2:2s (WG22S) rule history
  • Resolved controls shall be excluded from 7T (WG7T) trend calculations
  • Resolved controls shall be excluded from all multi-control Westgard comparisons

Resolution Methods:

  • Resolution via RPTNEG method shall cause exclusion
  • Resolution via RPTALL method shall cause exclusion
  • Resolution via RXTALL method shall cause exclusion

Interaction with Other Rules:

  • A resolved 1:3s control followed by a 1:2s control shall NOT trigger 2:2s error

Trace: Source: 3.0.0-Westgards (Row 1) | Jira: [Pending] | Tests: See scenarios | Related: REQ-RULES-WG-009, REQ-RULES-WG-011


FR-WG-002: Use Same-Run Controls as History

The system shall use same-run controls as history when evaluating Westgard rules.

Acceptance Criteria

Sequential Processing:

  • Controls within the same run shall be processed sequentially
  • The second control in a run shall evaluate the first control as historical data

History Inclusion:

  • Same-date controls shall be included in history checks
  • Past-date controls shall be included in history checks

Trace: Source: 3.0.0-Westgards (Row 2) | Jira: BT-312 | Tests: See scenarios


FR-WG-003: Scope WgInError to Affected Time Range

The system shall scope WgInError status to affect only runs with extraction dates after the failed control's date.

Acceptance Criteria

Time Range Scoping:

  • WgInError shall affect runs with extraction dates after the failed control's date
  • Runs with extraction dates before the failed control shall NOT be affected

Resolution Status Updates:

  • Resolution status shall update according to the defined flowchart
  • When a Westgard error is resolved, affected runs shall have their resolution status updated

Re-analysis Prompting:

  • Runs with 'Re-analysis required; Westgard' status shall prompt user to re-analyze when opened
  • The system shall display confirmation dialog when re-analysis is required

Error Handling

  • Run requires re-analysis: Display "There are updates to QC warnings/errors, would you like to re-analyse the run to apply them?"

Trace: Source: 3.0.0-Westgards (Row 3, Row 4, Row 5) | Jira: BT-283, BT-322, BT-314 | Tests: See scenarios


Error Handling (REQ-RULES-WG-004, 005)

FR-WG-004: Set INVALID_SD Error for Invalid Standard Deviation

The system shall set INVALID_SD error when a Westgard limit has an invalid standard deviation value.

Acceptance Criteria

Validation Rules:

  • Standard deviation must be a number greater than 0
  • SD value of 0 shall trigger INVALID_SD error
  • Non-numeric SD value shall trigger INVALID_SD error

Error Application:

  • Error code INVALID_SD shall be applied to the affected well
  • Error shall apply to WgInError rule evaluation
  • Error shall apply to Wg12S rule evaluation
  • Error shall apply to Wg13S rule evaluation
  • Error shall apply to Wg14S rule evaluation

Trace: Source: 3.0.0-WgInError rule - set error when wg limit has invalid sd (Row 1), 3.0.0-Wg12s rule (Row 1), 3.0.0-Wg13s rule (Row 1), 3.0.0-Wg14s rule (Row 1) | Jira: BT-4696 | Tests: See scenarios


FR-WG-005: Set WESTGARDS_MISSED Error for Missing Configuration

The system shall set WESTGARDS_MISSED error when the extraction date precedes the configured Westgard limit date range.

Acceptance Criteria

Trigger Condition:

  • Error code WESTGARDS_MISSED shall be set when extraction date is before first configured range

Rule Coverage:

  • Error shall apply to Wg12S rule evaluation
  • Error shall apply to Wg13S rule evaluation
  • Error shall apply to Wg14S rule evaluation
  • Error shall apply to Wg22S rule evaluation
  • Error shall apply to Wg7T rule evaluation

Trace: Source: 3.0.0-Westgard 12S rule - add WESTGARDS_MISSED error (Row 1), 3.0.0-Westgard 13S/14S/22S/7T rules | Jira: BT-4154 | Tests: BT-4167, See scenarios


Single-Control Rules (REQ-RULES-WG-006, 007, 008)

FR-WG-006: Trigger Westgard 1:2s Rule

The system shall trigger Westgard 1:2s rule (WG12S) when a positive extraction control CT or quantification value is more than 2 standard deviations from the assigned mean.

Acceptance Criteria

Threshold Calculation:

  • Rule shall trigger when CT/quant exceeds +2SD from assigned mean
  • Rule shall trigger when CT/quant exceeds -2SD from assigned mean
  • The system shall calculate threshold as: delta = ABS(control.ct_or_quant - westgard_limit.mean); threshold = 2 * westgard_limit.sd

Severity Configuration:

  • Rule shall generate WARNING severity by default
  • Rule shall generate ERROR severity for Viracor configuration
  • The system shall allow client-configurable severity (Default: WARNING, Viracor: ERROR)

Display:

  • Warning/error shall display in Westgard tab counter of runfile report
  • Warning/error shall display in Levey-Jennings report as yellow plot point
  • Error event shall display in LJ report table below plot

Trace: Source: 3.0.0-Westgard 1:2s Rule (Row 1, Row 2, Row 3) | Jira: [Pending] | Tests: [Pending] | Epic: BT-674


FR-WG-007: Trigger Westgard 1:3s Rule

The system shall trigger Westgard 1:3s rule (WG13S) when a positive extraction control CT or quantification value is more than 3 standard deviations from the assigned mean.

Acceptance Criteria

Threshold Calculation:

  • Rule shall trigger when CT/quant exceeds +3SD from assigned mean
  • Rule shall trigger when CT/quant exceeds -3SD from assigned mean
  • The system shall calculate threshold as: delta = ABS(control.ct_or_quant - westgard_limit.mean); threshold = 3 * westgard_limit.sd

Severity Configuration:

  • Rule shall generate ERROR severity by default
  • Rule shall generate WARNING severity for Nottingham configuration
  • The system shall allow client-configurable severity (Default: ERROR, Nottingham: WARNING)

Display:

  • Error/warning shall display in Westgard tab counter of runfile report
  • Error/warning shall display in Levey-Jennings report as red plot point
  • Error event shall display in LJ report table below plot

Trace: Source: 3.0.0-Westgard 1:3s Rule (Row 1, Row 2, Row 3) | Jira: [Pending] | Tests: [Pending] | Epic: BT-674


FR-WG-008: Trigger Westgard 1:4s Rule

The system shall trigger Westgard 1:4s rule (WG14S) when a positive extraction control CT or quantification value is more than 4 standard deviations from the assigned mean.

Acceptance Criteria

Threshold Calculation:

  • Rule shall trigger when CT/quant exceeds +4SD from assigned mean
  • Rule shall trigger when CT/quant exceeds -4SD from assigned mean
  • The system shall calculate threshold as: delta = ABS(control.ct_or_quant - westgard_limit.mean); threshold = 4 * westgard_limit.sd

Processing Order:

  • Rule shall execute before WG13S rule in processing order
  • The system shall process rules in order: WG14S (1st) -> WG13S (2nd) -> WG12S (3rd)

Severity and Display:

  • Rule shall generate ERROR severity
  • Error shall display in Westgard tab counter of runfile report
  • Error shall display in Levey-Jennings report as red plot point
  • New Westgard event code shall display in LJ table below plot

Configuration:

  • The rule shall be included in Quest CR7 configuration
  • The rule shall require a new Westgard event code definition

Trace: Source: 3.0.0-Westgard 1:4s Rule (Row 1, Row 2, Row 3) | Jira: BT-1383 | Tests: [Pending] | Epic: BT-674


Multi-Control Rules (REQ-RULES-WG-009, 010, 011)

FR-WG-009: Trigger Westgard 2:2s Rule

The system shall trigger Westgard 2:2s rule (WG22S) when two consecutive positive extraction controls both have CT or quantification values more than 2 standard deviations from the assigned mean in the same direction.

Acceptance Criteria

Trigger Conditions:

  • Rule shall trigger when first control CT/quant exceeds +/-2SD from mean
  • Rule shall trigger when second control CT/quant exceeds +/-2SD from mean
  • Both controls must be on same side of mean (both positive or both negative deviation)

Direction Check:

  • The system shall check direction as: same_direction = (a.value > a.mean AND b.value > b.mean) OR (a.value < a.mean AND b.value < b.mean)
  • Rule shall NOT trigger if controls are on opposite sides of LJ graph (-2SD, +2SD)

Edge Cases:

  • Rule shall be able to trigger when first control is >+/-3SD (resolved or warning status)

Severity and Display:

  • Rule shall generate ERROR severity
  • Error shall display in Westgard tab counter of runfile report
  • Error shall display in Levey-Jennings report as two plot points on +/-2SD lines
  • Error event shall display in LJ table below plot

Trace: Source: 3.0.0-Westgard 2:2s Rule (Row 1, Row 2, Row 3, Row 4, Row 5) | Jira: [Pending] | Tests: BT-2866, BT-2893 | Epic: BT-674


FR-WG-010: Support Configurable Strict Boundary Enforcement

The system shall provide a configuration option to control whether wells exceeding the higher SD threshold (3SD) are excluded from multi-well Westgard rule evaluation.

Acceptance Criteria

Configuration Option:

  • Configuration option "Restrict Two-Well Westgard Errors to Preceding Wells Within 1SD of Trigger Limit" shall be available

WG22S Behavior:

  • When ENABLED: Wells >3SD shall be excluded from 2:2s rule pairing
  • When DISABLED: Wells >3SD shall be included in 2:2s rule pairing
  • WG22S with config ENABLED: Run A has 13s (>3sd), Run B imports 12s well -> Run B shows 12s only
  • WG22S with config DISABLED: Run A has 13s (>3sd), Run B imports 2s well -> Run B shows 22s
  • WG22S with config ENABLED: Run A has 12s (2sd<x<3sd), Run B imports 2s well -> Run B shows 22s

WG13S22S Behavior:

  • WG13S22S with config ENABLED: Run A has 13s (>3sd), Run B imports 3s well -> Run B does NOT get WG22S13S
  • WG13S22S with config DISABLED: Run A has 13s (>3sd), Run B imports 3s well -> Run B gets WG22S13S

Trace: Source: 3.0.0-WG22S - Exclude 3S when exclude higher ranges for SD comparison (Row 1), 3.0.0-WG13S22S Rule (Row 4) | Jira: BT-4387 | Tests: [Pending]


FR-WG-011: Trigger Westgard 7T Rule

The system shall trigger Westgard 7T rule (WG7T) when seven consecutive positive extraction controls show a consistent trend in the same direction.

Acceptance Criteria

Trigger Conditions:

  • Rule shall trigger when 7 consecutive controls trend in same direction
  • Increasing trend: each control CT/quant shall be higher than previous
  • Decreasing trend: each control CT/quant shall be lower than previous

Severity and Error Handling:

  • Rule shall generate ERROR severity
  • Rule shall be subject to WESTGARDS_MISSED error if extraction date before configured range
  • The system shall reset trend count when direction changes

Combined Rule Support:

  • The core 7T logic shall be used as component of WG7T13S combined rule

Trace: Source: 3.0.0-Westgard 7T rule - add WESTGARDS_MISSED error (Row 1), 3.0.0-WG7T13S Rule (inferred from combined rule) | Jira: [Pending] | Tests: [Pending] | Epic: BT-674


Combined Rules (REQ-RULES-WG-012, 013)

FR-WG-012: Trigger WG13S22S Combined Rule

The system shall trigger WG13S22S combined rule when a control simultaneously satisfies both the Westgard 1:3s and 2:2s rule conditions.

Acceptance Criteria

Trigger Condition:

  • Rule shall trigger when control has 12s AND 13s violations in same direction

High Limit Violations:

  • High limit violation shall set WG13S22S_HIGH_WELL error on well
  • High limit violation shall set WG13S22S_HIGH_TARGET error in Assay Summary MESSAGES column

Low Limit Violations:

  • Low limit violation shall set WG13S22S_LOW_WELL error on well
  • Low limit violation shall set WG13S22S_LOW_TARGET error in Assay Summary MESSAGES column

Resolution:

  • Resolution code shall be WG22S13S
  • Rules skip on re-analysis shall be: SKIP,RPA,WG22S13S
  • Well resolved with RPT ALL shall be resolved as RPT

Display:

  • Westgard event code WG22S13S shall display in Levey-Jennings report table
  • Event message shall be "The last control triggered an error for the 2:2S & 1.3S rule"

Trace: Source: 3.0.0-WG13S22S Rule (Row 1, Row 2, Row 3, Row 4) | Jira: BT-4309 | Tests: See scenarios | Epic: BT-4363


FR-WG-013: Trigger WG7T13S Combined Rule

The system shall trigger WG7T13S combined rule when a control simultaneously satisfies both the Westgard 7T and 1:3s rule conditions.

Acceptance Criteria

Trigger Condition:

  • Rule shall trigger when control has 7T trend AND 13s violation simultaneously

High Limit Violations:

  • High limit violation (increasing trend) shall set WG7T13S_HIGH_WELL error on well
  • High limit violation shall set WG7T13S_HIGH_TARGET error in Assay Summary MESSAGES column

Low Limit Violations:

  • Low limit violation (decreasing trend) shall set WG7T13S_LOW_WELL error on well
  • Low limit violation shall set WG7T13S_LOW_TARGET error in Assay Summary MESSAGES column

Resolution:

  • Resolution code shall be WG7T13S
  • Rules skip on re-analysis shall be: SKIP,RPA,WG7T13S
  • Well resolved with RPT ALL shall be resolved as RPT

Display:

  • Westgard event code WG7T13S shall display in Levey-Jennings report table
  • Event message shall be "The last control triggered an error for the 7T & 1.3S rule"

Trace: Source: 3.0.0-WG7T13S Rule (Row 1, Row 2, Row 3, Row 4, Row 5) | Jira: BT-4309 | Tests: BT-4326, See scenarios | Epic: BT-4304


Configuration Options

OptionDefaultDescriptionAffects
wg12s_severityWARNINGSeverity level for 1:2s rule violationsREQ-RULES-WG-006
wg12s_severity_viracorERRORViracor-specific severity for 1:2s ruleREQ-RULES-WG-006
wg13s_severityERRORSeverity level for 1:3s rule violationsREQ-RULES-WG-007
wg13s_severity_nottinghamWARNINGNottingham-specific severity for 1:3s ruleREQ-RULES-WG-007
strict_boundary_enforcement[Client-specific]Restrict Two-Well Westgard Errors to Preceding Wells Within 1SD of Trigger LimitREQ-RULES-WG-010

UI Notes (Illustrative)

FR-WG-003 UI Specifications

Re-Analysis Dialog:

  • Title: "Warning"
  • Text: "There are updates to QC warnings/errors, would you like to re-analyse the run to apply them?"
  • Actions: Yes/No confirmation buttons

FR-WG-006, 007, 008 UI Specifications

Runfile Report:

  • Warning/Error increments Westgard tab counter

Levey-Jennings Report:

  • Yellow plot point on chart for warning state (1:2s)
  • Red plot point for error state (1:3s, 1:4s, or Viracor 1:2s)
  • Error event row in table below plot

FR-WG-009 UI Specifications

Levey-Jennings Report:

  • Two plot points displayed on +/-2SD lines
  • Error event row in table below plot

FR-WG-012, 013 UI Specifications

Levey-Jennings Report Table:

RuleEvent CodeEvent Message
WG13S22SWG22S13S"The last control triggered an error for the 2:2S & 1.3S rule"
WG7T13SWG7T13S"The last control triggered an error for the 7T & 1.3S rule"

Implementation (Illustrative)

ComponentLocation
WG12S RuleAnalyzer/Rules/Wg12SRule
WG13S RuleAnalyzer/Rules/Wg13SRule
WG14S RuleAnalyzer/Rules/Wg14SRule
WG22S RuleAnalyzer/Rules/Wg22SRule
WG7T RuleAnalyzer/Rules/Wg7TRule
WG13S22S CombinedAnalyzer/Rules/Wg22S13SRule
WG7T13S CombinedAnalyzer/Rules/Wg7T13SRule
WgInError RuleAnalyzer/Rules/WginerrorRule

Traceability Matrix

RequirementTitleVerificationImplementationTest CasesStatus
REQ-RULES-WG-001Exclude Resolved ControlsTestAll Westgard Rules[Pending]Draft
REQ-RULES-WG-002Same-Run Control HistoryTestAll Westgard RulesBT-312Draft
REQ-RULES-WG-003WgInError Time ScopingTestWginerrorRuleBT-283, BT-322, BT-314Draft
REQ-RULES-WG-004INVALID_SD ErrorTestWg12SRule, Wg13SRule, Wg14SRule, WginerrorRuleBT-4696Draft
REQ-RULES-WG-005WESTGARDS_MISSED ErrorTestAll Westgard RulesBT-4154, BT-4167Draft
REQ-RULES-WG-006Westgard 1:2s RuleTestWg12SRule[Pending]Draft
REQ-RULES-WG-007Westgard 1:3s RuleTestWg13SRule[Pending]Draft
REQ-RULES-WG-008Westgard 1:4s RuleTestWg14SRuleBT-1383Draft
REQ-RULES-WG-009Westgard 2:2s RuleTestWg22SRuleBT-2866, BT-2893Draft
REQ-RULES-WG-010Strict Boundary ConfigTestWg22SRule, Wg22S13SRuleBT-4387Draft
REQ-RULES-WG-011Westgard 7T RuleTestWg7TRule[Pending]Draft
REQ-RULES-WG-012WG13S22S Combined RuleTestWg22S13SRuleBT-4309Draft
REQ-RULES-WG-013WG7T13S Combined RuleTestWg7T13SRuleBT-4309, BT-4326Draft

Notes

  • Westgard rules are an industry-standard methodology for laboratory quality assurance
  • The rule family includes both single-control threshold rules and multi-control pattern rules
  • Combined rules (WG13S22S, WG7T13S) detect when multiple rule conditions are met simultaneously
  • Processing order matters for overlapping rules (WG14S before WG13S before WG12S)
  • Legacy runfiles may have different date handling; see migration documentation
  • Performance consideration: Large control histories may impact 7T rule evaluation time

Acceptance Tests

Test: REQ-RULES-WG-001

Back to requirement

Test: Resolved 1:3s followed by 1:2s does not trigger 2:2s

Given: A control with 1:3s error that has been resolved
And: A new control with 1:2s warning in the same direction
When: The new control is analyzed
Then: The new control shall NOT trigger 2:2s error
And: The new control shall show only 1:2s warning

Test: REQ-RULES-WG-002

Back to requirement

Test: Second control uses first as history

Given: A runfile with 2 controls between 2-3SD from the mean
When: The runfile is uploaded and analyzed
Then: First control shows 1:2s warning
And: Second control shows 2:2s error (not 1:2s warning)

Test: REQ-RULES-WG-003

Back to requirement

Test: Re-analysis required for later runs

Given: Runfile A is uploaded
When: Runfile B with failed 1:3s control (extraction date before A) is uploaded
Then: Runfile list shows A has Westgard resolution issue
And: Opening runfile A prompts user to re-analyse

Test: Resolution clears re-analysis flag

Given: Runfile A is uploaded
And: Runfile B with failed 1:3s control (extraction date before A) is uploaded
When: The failed control in B is resolved
Then: Runfile list does NOT show A has Westgard resolution issue
And: Opening runfile A does NOT prompt re-analysis

Test: Earlier run not affected

Given: Runfile A with control >3SD from mean is uploaded
When: Runfile B with control <2SD from mean (extraction date before A) is uploaded
Then: Opening runfile B shows no WgInError message

Test: REQ-RULES-WG-004

Back to requirement

Test: SD of zero triggers error

Given: Error code INVALID_SD is configured
And: Rule mapping exists: HDV - PC - {WgInError|Wg12S|Wg13S|Wg14S}
And: Westgard limit configured with:
- Role: PC
- Target: HDV
- SD: 0
- Extraction instrument: default
When: Run is imported with well A1:
- Observations with role: PC, target: HDV
Then: Well A1 has INVALID_SD error

Test: REQ-RULES-WG-005

Back to requirement

Test: Extraction date before configured range

Given: Well with observation
And: Extraction date is before the first configured range
When: Observation is analyzed on {Wg12S|Wg13S|Wg14S|Wg22S|Wg7T}
Then: Well has WESTGARDS_MISSED error

Test: REQ-RULES-WG-012

Back to requirement

Test: High limit violation

Given: Configuration with rules mapping HDV PC WG22S13S
And: Run exists with HDV control with 12s rule high limit target
When: Runfile is imported with A1 well control >= 3SD high limit
Then: A1 well has WG22S13S_HIGH_WELL error
And: Assay Summary MESSAGES column has WG22S13S_HIGH_TARGET error

Test: Low limit violation

Given: Configuration with rules mapping HDV PC WG7T13S
And: Run exists with HDV control with 12s rule low limit target
When: Runfile is imported with A1 well control >= 3SD low limit
Then: A1 well has WG13S22S_LOW_WELL error
And: Assay Summary MESSAGES column has WG13S22S_LOW_TARGET error

Test: Resolution

Given: Well with WG22S13S rule triggered
And: Error resolution configured:
- Error Code: WG22S13S_HIGH_WELL
- Resolution: RPT ALL
- Rules skip on re-analysis: SKIP,RPA,WG22S13S
When: Well is resolved with RPT ALL
Then: Well is resolved as RPT

Test: REQ-RULES-WG-013

Back to requirement

Test: High limit with increasing trend

Given: Configuration with rules mapping HDV PC WG7T13S
And: 6 runs exist with HDV controls in increasing trend
When: Runfile is imported with A1 well control >= 3SD high limit
Then: A1 well has WG7T13S_HIGH_WELL error
And: Assay Summary MESSAGES column has WG7T13S_HIGH_TARGET error

Test: Low limit with decreasing trend

Given: Configuration with rules mapping HDV PC WG7T13S
And: 6 runs exist with HDV controls in decreasing trend
When: Runfile is imported with A1 well control >= 3SD low limit
Then: A1 well has WG7T13S_LOW_WELL error
And: Assay Summary MESSAGES column has WG7T13S_LOW_TARGET error

Test: Resolution

Given: Well with WG7T13S rule triggered
And: Error resolution configured:
- Error Code: WG7T13S_HIGH_WELL
- Resolution: RPT ALL
- Rules skip on re-analysis: SKIP,RPA,WG7T13S
When: Well is resolved with RPT ALL
Then: Well is resolved as RPT

Test: LJ Report display

Given: WG7T13S rule is triggered in CONTROL_A
When: LJ report is generated with CONTROL_A
Then: Event "The last control triggered an error for the 7T & 1.3S rule" is present in LJ table

Design DocumentRelevant Sections
SDD AlgorithmsWestgard Rules (1:2S, 1:3S, 2:2S, 7T), Rule Mapping Architecture

Appendix: Process Artifacts

Completion Checklist

  • All requirements are capability-level (describe behavior, not UI)
  • Requirement variants consolidated (no requirement explosion) - N/A, no consolidation needed
  • UI details are fully demoted to Illustrative section
  • Configuration options are not encoded as requirements
  • Acceptance criteria describe behavior, not UI mechanics
  • Every requirement has acceptance criteria and source traceability
  • Error handling addressed for I/O, validation, and external system requirements
  • Open questions documented with owners assigned - N/A, no open questions
  • Consolidations documented in Reviewer Notes with reversibility info
  • Module can survive a full UI redesign unchanged
  • Refinements do not introduce new capabilities
  • Traceability matrix is complete

Reviewer Notes

No Consolidation Required

All 13 requirements in the source represent distinct Westgard rules with unique triggering conditions, error codes, and behaviors. Per the RULES domain guidance for conservative consolidation, no requirements were merged.

Preserved as Individual Requirements:

Original IDDispositionRationale
REQ-RULES-WG-001PreservedCross-cutting behavior for resolved control handling
REQ-RULES-WG-002PreservedCross-cutting behavior for same-run history
REQ-RULES-WG-003PreservedCross-cutting behavior for time-range scoping
REQ-RULES-WG-004PreservedError handling - INVALID_SD
REQ-RULES-WG-005PreservedError handling - WESTGARDS_MISSED
REQ-RULES-WG-006PreservedDistinct rule - WG12S (2SD threshold)
REQ-RULES-WG-007PreservedDistinct rule - WG13S (3SD threshold)
REQ-RULES-WG-008PreservedDistinct rule - WG14S (4SD threshold)
REQ-RULES-WG-009PreservedDistinct rule - WG22S (consecutive pattern)
REQ-RULES-WG-010PreservedConfiguration option for boundary enforcement
REQ-RULES-WG-011PreservedDistinct rule - WG7T (trend pattern)
REQ-RULES-WG-012PreservedDistinct rule - WG13S22S (combined)
REQ-RULES-WG-013PreservedDistinct rule - WG7T13S (combined)

Rationale: Analytics rules must be precise. Each Westgard rule has distinct mathematical triggering conditions (2SD vs 3SD vs 4SD vs consecutive vs trending) and produces different error codes. Merging would lose critical precision required for QC validation.

Reversibility: Source file preserved at output/srs/rules/rule-westgards.md