Skip to main content
Version: Next

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

IDCore BehaviorPriorityStatus
REQ-RULES-WDCTC-001Detect CT discrepancy for Control wells (>2 cycle difference)HIGHDraft
REQ-RULES-WDCTC-002Suppress errors when final CT >= max_ct_for_ct_discrepancy thresholdHIGHDraft
REQ-RULES-WDCTC-003Skip rule when max fluorescence < minimum_fluorescence_to_positiveHIGHDraft

Key Integration Points: Analytics Engine (CT calculation), Kit Configuration (thresholds), Control Well Processing

Rule Summary

PropertyValue
NameWDCTC
ScopeControl wells only
TriggersWhen evaluating CT values for control wells
OutputError codes CONTROL_CTDISC_WELL, CONTROL_CTDISC_TARGET
Related RuleWDCT (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

TermDefinition
CT (Cycle Threshold)The PCR cycle number at which fluorescence crosses a defined threshold
pcr.ai CTThe CT value calculated by the pcr.ai analytics engine
Machine CTThe CT value reported directly by the thermocycler instrument
Control WellA well containing control samples (positive or negative controls) used for quality assurance
CT DiscrepancyA condition where pcr.ai CT and machine CT differ by more than the acceptable threshold (>2)
ClassificationThe 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

DirectionDataSource/Target
Inputpcr.ai CT valueAnalytics engine
InputMachine CT valueThermocycler
InputWell classificationClassification rule
OutputCONTROL_CTDISC_WELLWell error codes
OutputCONTROL_CTDISC_TARGETTarget 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_discrepancyfinal_ctResult
null36Generate error (threshold not applied)
3536Suppress (36 > 35)
3636Suppress (36 >= 36)
3736Generate 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_positivemax(readings)Result
10099Skip rule (99 < 100)
100100Evaluate 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

OptionDefaultTypeDescriptionAffects
max_ct_for_ct_discrepancyNULLNumber (nullable)CT threshold above which discrepancy errors are suppressed. NULL disables suppression.REQ-RULES-WDCTC-002
minimum_fluorescence_to_positive-NumberMinimum fluorescence threshold; readings below this value cause the rule to be skippedREQ-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)

ComponentLocation
Rule ClassAnalyzer/Rules/WdctcRule

Traceability Matrix

RequirementTitleVerificationImplementationTest CasesStatus
REQ-RULES-WDCTC-001Detect CT Discrepancy for Control WellsTestWdctcRuleSee scenariosDraft
REQ-RULES-WDCTC-002Suppress CT Discrepancy Based on Max CT ThresholdTestWdctcRuleSee scenariosDraft
REQ-RULES-WDCTC-003Skip Rule Based on Minimum Fluorescence ThresholdTestWdctcRuleSee scenariosDraft

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

Design DocumentRelevant Sections
SDD AlgorithmsCT Discrepancy Detection

Acceptance Tests

Test: REQ-RULES-WDCTC-001

Back to requirement

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

Back to requirement

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

Back to requirement

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 IDDescriptionDisposition
REQ-RULES-WDCTC-001Core CT discrepancy detectionRetained as-is
REQ-RULES-WDCTC-002Max CT threshold suppression sub-ruleRetained as-is
REQ-RULES-WDCTC-003Minimum fluorescence skip sub-ruleRetained as-is

Rationale: Analytics rules require precise test coverage. Each requirement:

  1. Has distinct trigger conditions
  2. Has distinct outcomes (error, suppress, skip)
  3. Is independently testable
  4. 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