Skip to main content
Version: Next

STD: Well Discrepant CT Control Rule (WDCTC)

Version: v1.0.2 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-wdctc.md Rule Name: WDCTC Domain: RULES-WDCTC


Overview

This document specifies tests for the WDCTC (Well Discrepant CT Control) rule using decision tables and test vectors. The rule detects CT discrepancies between pcr.ai calculated CT values and machine-reported CT values for Control wells.

Rule Characteristics:

  • Pure business logic (no UI)
  • Control wells only (patient wells handled by WDCT rule)
  • Configurable suppression via max_ct_for_ct_discrepancy threshold
  • Configurable skip via minimum_fluorescence_to_positive threshold
  • Fixed CT discrepancy threshold of >2 cycles

Test Method: TM-API (per Test Plan Section 3.3 - Rules use automated API tests)

Verification Approach: Rule verification is performed using data-driven test vectors. Each row in a decision table represents a complete verification scenario with defined inputs and expected outputs. This format enables exhaustive condition coverage while remaining concise and auditable.


Coverage Summary

REQ IDTitleConditionsTest VectorsCoverageGaps
REQ-RULES-WDCTC-001Core CT Discrepancy Detection817100%None
REQ-RULES-WDCTC-002Max CT Threshold Suppression47100%None
REQ-RULES-WDCTC-003Minimum Fluorescence Skip37100%None

Totals: 3 REQs, 15 Conditions, 31 Test Vectors, 100% Coverage


Input Variables

VariableTypeValid ValuesDescription
well.typestringControl, PatientWell type
obs.pcrai_ctfloatnumericCT value calculated by pcr.ai engine
obs.machine_ctfloatnumericCT value reported by thermocycler
obs.classificationstringPositive, Negative, AmbiguousClassification result
obs.final_ctfloatnumericFinal CT value for suppression check
obs.readingsarray[float, ...]Fluorescence readings
target.max_ct_for_ct_discrepancyfloat?null, numericSuppression threshold (null = disabled)
target.minimum_fluorescence_to_positivefloatnumericSkip threshold

Output Variables

VariableTypeDescription
well.errorsarrayError codes assigned to well
target.errorsarrayError codes assigned to target
rule_executedboolWhether the rule ran (false if skipped)
error_generatedboolWhether discrepancy errors were generated

REQ-RULES-WDCTC-001: Core CT Discrepancy Detection

Decision Table: Well Type Filtering

TVwell.typerule_appliesCovers
TV-001-001ControltrueAC: Apply exclusively to Control wells
TV-001-002PatientfalseAC: Not patient wells

Decision Table: Classification Filtering

Note: Negative classification alone does not cause the rule to skip. The skip requires both Negative classification and low fluorescence (max reading < minimum_fluorescence_to_positive). A Negative well with high fluorescence still proceeds to CT discrepancy evaluation. See REQ-RULES-WDCTC-003 and TV-COMB-007.

TVobs.classificationmax_fluor vs fluor_thresholdct_differenceerror_generatedCovers
TV-001-003NegativeBelow (low fluorescence)5 (>2)falseAC: Neg CLS + low fluorescence skips rule
TV-001-004PositiveAbove5 (>2)trueAC: Evaluate non-negative
TV-001-005AmbiguousAbove5 (>2)trueAC: Evaluate non-negative

Decision Table: CT Discrepancy Threshold

TVobs.pcrai_ctobs.machine_ctabs_differenceerror_generatedCovers
TV-001-00630.035.05.0trueAC: Difference > 2 generates error
TV-001-00730.032.12.1trueAC: Difference > 2 (boundary)
TV-001-00830.032.02.0falseAC: Difference = 2 passes
TV-001-00930.031.51.5falseAC: Difference < 2 passes
TV-001-01035.030.05.0trueAC: Absolute value (pcrai > machine)

Decision Table: Error Code Generation

TVct_discrepancy_detectedwell.errorstarget.errorsCovers
TV-001-011true[CONTROL_CTDISC_WELL][CONTROL_CTDISC_TARGET]AC: Both error codes generated
TV-001-012false[][]AC: No errors when no discrepancy

Decision Table: Gap Coverage — Core Detection Scenarios

TVScenarioct_discrepancyclassificationerror_generatedCovers
TV-WDCTC-GAP-001Ambiguous classification for Control wellpresentAmbiguoustrueAC: Ambiguous CLS triggers discrepancy
TV-WDCTC-GAP-002-ABoundary at CT difference 2.0 — no discrepancy2.0 (= threshold)PositivefalseAC: Boundary at exactly 2.0 passes
TV-WDCTC-GAP-002-BBoundary at CT difference 2.1 — triggers discrepancy2.1 (> threshold)PositivetrueAC: Boundary just above 2.0 triggers
TV-WDCTC-GAP-003Reversed CT values (pcrai CT > machine CT)present (reversed)PositivetrueAC: Absolute value of difference used
TV-WDCTC-GAP-004-BNo discrepancy baseline under WDCTC template configabsentPositivefalseAC: No discrepancy produces no error

REQ-RULES-WDCTC-002: Max CT Threshold Suppression

Decision Table: Suppression Logic

TVmax_ct_for_ct_discrepancyobs.final_ctct_discrepancyerror_generatedCovers
TV-002-001null36truetrueAC: Null threshold = disabled
TV-002-0023536truefalseAC: final_ct > threshold suppresses
TV-002-0033636truefalseAC: final_ct = threshold suppresses (>=)
TV-002-0043736truetrueAC: final_ct < threshold = normal
TV-002-0053534truetrueAC: final_ct below threshold = error
TV-002-0064038falsefalseAC: No discrepancy = no error regardless
TV-WDCTC-GAP-004enabledbelow thresholdfalsefalseAC: No discrepancy while threshold config enabled

REQ-RULES-WDCTC-003: Minimum Fluorescence Skip

Decision Table: Fluorescence Skip Logic

Prerequisite: The fluorescence skip only applies when classification is Negative. Non-Negative classifications (Positive, Ambiguous) bypass this check entirely and proceed directly to CT discrepancy evaluation. See WdctcRule.php line 60: finalClsIsNegative() && maxReadingIsLessThanTargetMinFl().

TVclassificationminimum_fluorescence_to_positivemax(obs.readings)rule_executederror_generatedCovers
TV-003-001Negative10099falsefalseAC: Neg CLS + max < threshold skips rule
TV-003-002Negative100100true(depends)AC: Neg CLS + max = threshold evaluates (strict <)
TV-003-003Negative100101true(depends)AC: Neg CLS + max > threshold evaluates
TV-003-004Negative5049.9falsefalseAC: Neg CLS + below threshold boundary
TV-003-005Negative5050.1true(depends)AC: Neg CLS + above threshold boundary
TV-WDCTC-GAP-005Negativeconfiguredlow fluorescencetruetrueAC: Low fluorescence control well interaction
TV-WDCTC-GAP-006Negativeconfiguredlow fluorescence (combined)truetrueAC: Combined low fluorescence and discrepancy

Combined Scenario Decision Table

This table tests the complete rule execution path with all conditions.

TVwell.typemax_fluorfluor_thresholdclassificationct_diffmax_ct_threshfinal_ctrule_executederror_generatedCovers
TV-COMB-001Patient150100Positive5null30falsefalseWell type filter
TV-COMB-002Control99100Negative5null30falsefalseNeg CLS + low fluorescence skip
TV-COMB-003Control99100Positive5null30truetruePos CLS bypasses fluorescence skip
TV-COMB-004Control150100Positive1.5null30truefalseCT within tolerance
TV-COMB-005Control150100Positive53536truefalseSuppressed by max_ct
TV-COMB-006Control150100Positive5null30truetrueFull error path
TV-COMB-007Control150100Negative5null30truetrueNeg CLS + high fluorescence = evaluate

Automation Status

REQ IDTest VectorsAutomation StatusNotes
REQ-RULES-WDCTC-001TV-001-001 to TV-001-012AutomatedCore detection logic
REQ-RULES-WDCTC-002TV-002-001 to TV-002-006AutomatedSuppression threshold
REQ-RULES-WDCTC-003TV-003-001 to TV-003-005AutomatedFluorescence skip
CombinedTV-COMB-001 to TV-COMB-007AutomatedIntegration scenarios

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
None-All acceptance criteria covered--

Boundary Value Coverage

BoundaryTest VectorStatus
CT difference = 2.0 (threshold)TV-001-008Covered
CT difference = 2.1 (just above)TV-001-007Covered
Fluorescence = thresholdTV-003-002Covered
Fluorescence just belowTV-003-001, TV-003-004Covered
final_ct = max_ct_thresholdTV-002-003Covered
final_ct just above thresholdTV-002-002Covered
final_ct just below thresholdTV-002-005Covered

Traceability to SRS Tests

SRS TestTest VectorStatus
Negative classification + low fluorescence bypasses ruleTV-001-003, TV-003-001, TV-COMB-002Mapped
Negative classification + high fluorescence evaluates normallyTV-COMB-007Mapped
CT discrepancy detectedTV-001-006, TV-001-011Mapped
CT difference within toleranceTV-001-009Mapped
Null threshold - normal rule appliesTV-002-001Mapped
Final CT exceeds threshold - suppressedTV-002-002Mapped
Final CT equals threshold - suppressedTV-002-003Mapped
Final CT below threshold - normal rule appliesTV-002-004, TV-002-005Mapped
Max reading below threshold - rule skippedTV-003-001Mapped
Max reading meets threshold - rule executesTV-003-002Mapped