WDCTC Rule
Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: Well Discrepant CT Control rule for detecting CT discrepancies in Control wells Domain: RULES-WDCTC Precedence: After classification determination
Statement
The system shall detect CT (Cycle Threshold) discrepancies between pcr.ai calculated CT values and machine-reported CT values for Control wells, flagging errors when the absolute difference exceeds 2 cycles.
The rule ensures data integrity by identifying control wells where CT measurements differ significantly between calculation methods. Two configurable conditions can modify rule behavior: high CT values may suppress error generation, and low fluorescence readings may skip rule evaluation entirely.
Quick Reference
| ID | Core Behavior | Priority | Status |
|---|---|---|---|
| REQ-RULES-WDCTC-001 | Detect CT discrepancy for Control wells (>2 cycle difference) | HIGH | Draft |
| REQ-RULES-WDCTC-002 | Suppress errors when final CT >= max_ct_for_ct_discrepancy threshold | HIGH | Draft |
| REQ-RULES-WDCTC-003 | Skip rule when max fluorescence < minimum_fluorescence_to_positive | HIGH | Draft |
Key Integration Points: Analytics Engine (CT calculation), Kit Configuration (thresholds), Control Well Processing
Rule Summary
| Property | Value |
|---|---|
| Name | WDCTC |
| Scope | Control wells only |
| Triggers | When evaluating CT values for control wells |
| Output | Error codes CONTROL_CTDISC_WELL, CONTROL_CTDISC_TARGET |
| Related Rule | WDCT (patient well variant) |
Rule Flowchart (Illustrative)
This diagram illustrates the rule evaluation sequence. Sub-rules REQ-002 and REQ-003 modify the core detection logic through suppression and skip conditions.
Definitions
| Term | Definition |
|---|---|
| CT (Cycle Threshold) | The PCR cycle number at which fluorescence crosses a defined threshold |
| pcr.ai CT | The CT value calculated by the pcr.ai analytics engine |
| Machine CT | The CT value reported directly by the thermocycler instrument |
| Control Well | A well containing control samples (positive or negative controls) used for quality assurance |
| CT Discrepancy | A condition where pcr.ai CT and machine CT differ by more than the acceptable threshold (>2) |
| Classification | The determination of whether a well is positive, negative, or other status |
Assumptions
- Control wells are identifiable by well type designation
- Both pcr.ai CT and machine CT values are available for comparison
- Classification status is determined before WDCTC rule evaluation
- Target configuration parameters are accessible during rule execution
- Fluorescence readings are available for threshold comparisons
Requirements
Core Detection (REQ-RULES-WDCTC-001)
FR-WDCTC-001: Detect CT Discrepancy for Control Wells
The system shall detect CT discrepancies between pcr.ai and machine CT values for Control wells, flagging an error when the absolute difference exceeds 2 and the classification is not negative.
Inputs/Outputs
| Direction | Data | Source/Target |
|---|---|---|
| Input | pcr.ai CT value | Analytics engine |
| Input | Machine CT value | Thermocycler |
| Input | Well classification | Classification rule |
| Output | CONTROL_CTDISC_WELL | Well error codes |
| Output | CONTROL_CTDISC_TARGET | Target error codes |
Acceptance Criteria
Scope and Filtering:
- Apply this rule exclusively to Control wells, not patient wells
- Skip discrepancy detection for wells with negative classification (end without error)
CT Comparison:
- Compare pcr.ai CT value against machine CT value for each Control well with non-negative classification
- Calculate CT discrepancy as the absolute difference between pcr.ai CT and machine CT
- Use a fixed CT discrepancy threshold of >2 (absolute difference)
Error Generation:
- Flag a CT discrepancy error when the difference between pcr.ai CT and machine CT exceeds 2
- Generate error codes CONTROL_CTDISC_WELL and CONTROL_CTDISC_TARGET when discrepancy is detected
- Produce both well-level and target-level error codes when generating errors
- Respect threshold conditions from sub-rules that may suppress or skip the discrepancy check
Error Handling
- CT difference > 2 (non-negative classification): Generate error codes CONTROL_CTDISC_WELL and CONTROL_CTDISC_TARGET
- Classification is negative: Pass without error
- CT difference <= 2: Pass without error
Trace: Source: 3.0.0-WDCTC rule (Lines 21-43) | Epic: BT-674 | Tests: See scenarios | Related: REQ-RULES-WDCTC-002, REQ-RULES-WDCTC-003
Suppression Condition (REQ-RULES-WDCTC-002)
FR-WDCTC-002: Suppress CT Discrepancy Based on Max CT Threshold
The system shall suppress CT discrepancy errors when the observation's final CT value is greater than or equal to the configured max_ct_for_ct_discrepancy threshold.
Acceptance Criteria
Threshold Evaluation:
- Suppress when
final_ct >= max_ct_for_ct_discrepancy - Use >= (greater than or equal to) for the threshold comparison to determine suppression
- Treat a null threshold value as disabled, applying normal discrepancy detection
- Disable the suppression feature entirely when the threshold is null
Example Scenarios:
| max_ct_for_ct_discrepancy | final_ct | Result |
|---|---|---|
| null | 36 | Generate error (threshold not applied) |
| 35 | 36 | Suppress (36 > 35) |
| 36 | 36 | Suppress (36 >= 36) |
| 37 | 36 | Generate error (36 < 37) |
Trace: Source: 3.0.0-WDCTC: Consider 'Max CT for CT Discrepancy' (Lines 45-127) | Jira: BT-5308 | Epic: BT-5307 | Tests: See scenarios | Related: REQ-RULES-WDCTC-001
Skip Condition (REQ-RULES-WDCTC-003)
FR-WDCTC-003: Skip Rule Based on Minimum Fluorescence Threshold
The system shall skip the WDCTC rule entirely when the maximum fluorescence reading in the observation is below the configured minimum_fluorescence_to_positive threshold.
Acceptance Criteria
Fluorescence Evaluation:
- Use the maximum value among all fluorescence readings in the observation for comparison
- Calculate the maximum reading from all readings in the observation array
- Use < (strictly less than) for the fluorescence comparison to determine skip condition
Pre-condition Behavior:
- Evaluate the fluorescence check as a pre-condition before main discrepancy evaluation
- When skipped due to insufficient fluorescence, do not generate any error codes
Example Scenarios:
| minimum_fluorescence_to_positive | max(readings) | Result |
|---|---|---|
| 100 | 99 | Skip rule (99 < 100) |
| 100 | 100 | Evaluate normally (100 >= 100) |
Trace: Source: 3.0.0-WDCTC: Consider Minimum Fluorescence in WD Rules (Lines 129-188) | Jira: BT-5368 | Epic: BT-5367 | Tests: See scenarios | Related: REQ-RULES-WDCTC-001
Configuration Options
| Option | Default | Type | Description | Affects |
|---|---|---|---|---|
max_ct_for_ct_discrepancy | NULL | Number (nullable) | CT threshold above which discrepancy errors are suppressed. NULL disables suppression. | REQ-RULES-WDCTC-002 |
minimum_fluorescence_to_positive | - | Number | Minimum fluorescence threshold; readings below this value cause the rule to be skipped | REQ-RULES-WDCTC-003 |
UI Notes (Illustrative)
FR-WDCTC-001 UI Specifications
- Rule execution flow is documented in the associated flow diagram (image175.png)
- Error codes displayed: CONTROL_CTDISC_WELL, CONTROL_CTDISC_TARGET
Implementation (Illustrative)
| Component | Location |
|---|---|
| Rule Class | Analyzer/Rules/WdctcRule |
Traceability Matrix
| Requirement | Title | Verification | Implementation | Test Cases | Status |
|---|---|---|---|---|---|
| REQ-RULES-WDCTC-001 | Detect CT Discrepancy for Control Wells | Test | WdctcRule | See scenarios | Draft |
| REQ-RULES-WDCTC-002 | Suppress CT Discrepancy Based on Max CT Threshold | Test | WdctcRule | See scenarios | Draft |
| REQ-RULES-WDCTC-003 | Skip Rule Based on Minimum Fluorescence Threshold | Test | WdctcRule | See scenarios | Draft |
Notes
- The WDCTC rule is the Control well variant; WDCT handles patient wells with equivalent logic
- The CT discrepancy threshold of >2 is hardcoded and not configurable
- Rule execution order: Minimum Fluorescence Check -> Classification Check -> CT Discrepancy Check -> Max CT Suppression
- Sub-rules modify the core rule behavior through suppression (REQ-002) or skip (REQ-003) conditions
Related Design Documents
| Design Document | Relevant Sections |
|---|---|
| SDD Algorithms | CT Discrepancy Detection |
Acceptance Tests
Test: REQ-RULES-WDCTC-001
Test: Negative classification bypasses rule
Given: A Control well with negative classification
And: pcr.ai CT value is 30
And: machine CT value is 35
When: WDCTC rule is evaluated
Then: The system shall pass without error
And: No error codes shall be generated
Test: CT discrepancy detected
Given: A Control well with positive classification
And: pcr.ai CT value is 30
And: machine CT value is 35
When: WDCTC rule is evaluated
Then: The system shall generate error code CONTROL_CTDISC_WELL
And: The system shall generate error code CONTROL_CTDISC_TARGET
Test: CT difference within tolerance
Given: A Control well with positive classification
And: pcr.ai CT value is 30
And: machine CT value is 31.5
When: WDCTC rule is evaluated
Then: The system shall pass without error
Test: REQ-RULES-WDCTC-002
Test: Null threshold - normal rule applies
Given: A Control well A1 with observation O1
And: pcr.ai CT differs from machine CT by more than 2
And: target.max_ct_for_ct_discrepancy is null
And: observation.final_ct is 36
When: WDCTC rule is evaluated
Then: The system shall generate CT discrepancy error
Test: Final CT exceeds threshold - suppressed
Given: A Control well A1 with observation O1
And: pcr.ai CT differs from machine CT by more than 2
And: target.max_ct_for_ct_discrepancy is 35
And: observation.final_ct is 36
When: WDCTC rule is evaluated
Then: The system shall NOT generate CT discrepancy error
Test: Final CT equals threshold - suppressed
Given: A Control well A1 with observation O1
And: pcr.ai CT differs from machine CT by more than 2
And: target.max_ct_for_ct_discrepancy is 36
And: observation.final_ct is 36
When: WDCTC rule is evaluated
Then: The system shall NOT generate CT discrepancy error
Test: Final CT below threshold - normal rule applies
Given: A Control well A1 with observation O1
And: pcr.ai CT differs from machine CT by more than 2
And: target.max_ct_for_ct_discrepancy is 37
And: observation.final_ct is 36
When: WDCTC rule is evaluated
Then: The system shall generate CT discrepancy error
Test: REQ-RULES-WDCTC-003
Test: Max reading below threshold - rule skipped
Given: A Control well A1 with observation O1 on target T1
And: target.minimum_fluorescence_to_positive is 100
And: max(observation.readings) is 99
When: WDCTC rule is evaluated
Then: The rule shall be skipped
And: No error codes shall be generated
Test: Max reading meets threshold - rule executes
Given: A Control well A1 with observation O1 on target T1
And: target.minimum_fluorescence_to_positive is 100
And: max(observation.readings) is 100
When: WDCTC rule is evaluated
Then: The rule shall evaluate normally
And: If other conditions are satisfied, discrepancy errors may be generated
Appendix: Process Artifacts
Completion Checklist
- All requirements are capability-level (describe behavior, not UI)
- Requirement variants consolidated (no requirement explosion) - N/A for RULES domain
- 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 (none identified)
- Consolidations documented in Reviewer Notes with reversibility info
- Module can survive a full UI redesign unchanged
- Refinements folded into acceptance criteria
- Traceability matrix is complete
Reviewer Notes
Conservative Consolidation Applied
Per RULES domain guidance, no consolidation was performed. All three requirements represent distinct, independently testable capabilities:
| Original ID | Description | Disposition |
|---|---|---|
| REQ-RULES-WDCTC-001 | Core CT discrepancy detection | Retained as-is |
| REQ-RULES-WDCTC-002 | Max CT threshold suppression sub-rule | Retained as-is |
| REQ-RULES-WDCTC-003 | Minimum fluorescence skip sub-rule | Retained as-is |
Rationale: Analytics rules require precise test coverage. Each requirement:
- Has distinct trigger conditions
- Has distinct outcomes (error, suppress, skip)
- Is independently testable
- Maps to specific configuration parameters
Reversibility: N/A - no consolidation performed.
Given/When/Then Preservation
All 9 original test scenarios from the source document have been preserved:
- REQ-RULES-WDCTC-001: 3 scenarios
- REQ-RULES-WDCTC-002: 4 scenarios
- REQ-RULES-WDCTC-003: 2 scenarios