Skip to main content
Version: 3.0.1

STD: CT Cutoff Rule (WFINALCLS)

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-ct-cutoff-wfinalcls.md Rule Name: WFINALCLS Domain: RULES-CTCUTOFF


Overview

This document specifies tests for the CT Cutoff rule (WFINALCLS) using decision tables and test vectors. The rule evaluates CT (Cycle Threshold) values against configured cutoff boundaries to determine final classification, with specimen-type-aware reporting selection and asymmetric NULL value handling.

Rule Characteristics:

  • Pure business logic (no UI)
  • Threshold-based classification (CT > cutoff = Negative)
  • Specimen-type-aware reporting configuration selection
  • Asymmetric NULL handling (NULL CT = Negative, NULL Quantity = preserve)
  • Error reporting for missing configuration

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-CTCUTOFF-001CT Exceeds Cutoff Sets Negative68100%None
REQ-RULES-CTCUTOFF-002Specimen-Based Reporting Selection46100%None
REQ-RULES-CTCUTOFF-003NULL CT Sets Negative34100%None
REQ-RULES-CTCUTOFF-004NULL Quantity Preserves Classification34100%None
REQ-RULES-CTCUTOFF-005Missing Config Error34100%None

Totals: 5 REQs, 19 Conditions, 26 Test Vectors, 100% Coverage


Input Variables

VariableTypeValid ValuesDescription
obs.final_ctfloat/nullnull, 0-50+Observation CT value
obs.final_quantityfloat/nullnull, numericObservation quantity value
obs.target_idint/nullnull, valid IDTarget identifier
obs.specimen_typestringPlasma, Serum, etc.Specimen type of observation
obs.current_clsstringPositive, Negative, AmbiguousCurrent classification before rule
config.ct_cutofffloat10, 30, 40, etc.Configured CT cutoff threshold
config.use_sample_typebooltrue, falseEnable specimen-type-aware reporting
reporting.specimen_typestringPlasma, Serum, etc.Reporting configuration specimen type
reporting.ct_upper_boundaryfloat10, 30, 40, etc.Reporting CT upper boundary
reporting.last_modifiedtimestampdatetimeLast modification timestamp

Output Variables

VariableTypeDescription
obs.machine_clsstringMachine-determined classification
obs.dx_ai_clsstringDiagnostic AI classification
well.error_codestring/nullError code (CUTOFF_LIMITS_MISSED)
classification_modifiedboolWhether classification was changed

REQ-RULES-CTCUTOFF-001: CT Exceeds Cutoff Sets Negative

Acceptance Criteria:

  • AC1: When CT > cutoff, set machine_cls to Negative
  • AC2: When CT > cutoff, set dx_ai.cls to Negative
  • AC3: When CT > cutoff, set BOTH machine_cls AND dx_ai.cls to Negative
  • AC4: When CT <= cutoff, do not modify classification
  • AC5: Cutoff value shall be configurable per target
  • AC6: Default CT cutoff threshold shall be 40

Decision Table: CT Threshold Evaluation

TVobs.final_ctconfig.ct_cutoffobs.current_clsmachine_clsdx_ai_clscls_modifiedCovers
TV-001-0014540PositiveNegativeNegativetrueAC1, AC2, AC3: CT exceeds cutoff
TV-001-0024140PositiveNegativeNegativetrueAC1, AC2, AC3: CT just over cutoff
TV-001-0033540PositivePositive(unchanged)falseAC4: CT within cutoff
TV-001-0044040PositiveNegativeNegativetrueAC1, AC2, AC3: CT equals cutoff (boundary, code uses >=)
TV-001-00539.9940PositivePositive(unchanged)falseAC4: CT just under cutoff
TV-001-0064530AmbiguousNegativeNegativetrueAC1, AC2: Different cutoff value
TV-001-0074540NegativeNegativeNegativefalseAC1, AC2: Already negative
TV-001-0085040PositiveNegativeNegativetrueAC6: Default cutoff behavior

Decision Table: Configurable Cutoff Per Target

TVtarget_idconfig.ct_cutoffobs.final_ctexpected_outcomeCovers
TV-001-009Target_A3035NegativeAC5: Target-specific cutoff
TV-001-010Target_B4035(preserve)AC5: Different target, different cutoff

REQ-RULES-CTCUTOFF-002: Specimen-Based Reporting Selection

Acceptance Criteria:

  • AC1: When use_sample_type enabled, match specimen type to corresponding reporting config
  • AC2: When use_sample_type disabled, use last modified reporting config
  • AC3: Plasma(CT=25, cutoff=30) = Positive, Serum(CT=25, cutoff=10) = Negative when enabled
  • AC4: Both use Serum cutoff=10 when disabled (last modified)

Decision Table: Specimen Type Matching

TVuse_sample_typeobs.specimen_typeplasma_cutoffserum_cutofflast_modifiedobs.final_ctexpected_clsCovers
TV-002-001truePlasma3010Serum25PositiveAC1, AC3: Plasma uses Plasma cutoff
TV-002-002trueSerum3010Serum25NegativeAC1, AC3: Serum uses Serum cutoff
TV-002-003falsePlasma3010Serum25NegativeAC2, AC4: Uses last modified (Serum)
TV-002-004falseSerum3010Serum25NegativeAC2, AC4: Uses last modified (Serum)
TV-002-005falsePlasma3010Plasma25PositiveAC2: Uses last modified (Plasma)
TV-002-006truePlasma3010Serum35NegativeAC1: Plasma CT > Plasma cutoff

REQ-RULES-CTCUTOFF-003: NULL CT Sets Negative

Acceptance Criteria:

  • AC1: NULL CT value shall set classification to Negative
  • AC2: NULL CT handling applies regardless of other field values
  • AC3: NULL CT is treated as boundary exceeded (asymmetric with NULL Quantity)

Decision Table: NULL CT Handling

TVobs.final_ctobs.final_quantityobs.current_clsconfig.ct_cutoffexpected_clscls_modifiedCovers
TV-003-001NULL1000Positive40NegativetrueAC1: NULL CT sets Negative
TV-003-002NULLNULLPositive40NegativetrueAC2: NULL CT regardless of Qty
TV-003-003NULL1000Ambiguous40NegativetrueAC1: NULL CT from Ambiguous
TV-003-004NULL1000Negative40NegativefalseAC1: NULL CT already Negative

Decision Table: Asymmetric NULL Comparison

TVnull_fieldexpected_behaviorCovers
TV-003-005CTSet Negative (boundary exceeded)AC3: Asymmetric handling
TV-003-006QuantityPreserve classification (boundary NOT passed)AC3: Asymmetric handling

REQ-RULES-CTCUTOFF-004: NULL Quantity Preserves Classification

Acceptance Criteria:

  • AC1: NULL Quantity shall NOT modify classification
  • AC2: Existing classification shall be preserved when Quantity is NULL
  • AC3: NULL Quantity is treated as boundary NOT passed (asymmetric with NULL CT)

Decision Table: NULL Quantity Handling

TVobs.final_ctobs.final_quantityobs.current_clsconfig.ct_cutoffexpected_clscls_modifiedCovers
TV-004-00135NULLPositive40PositivefalseAC1, AC2: NULL Qty preserves Positive
TV-004-00235NULLNegative40NegativefalseAC1, AC2: NULL Qty preserves Negative
TV-004-00335NULLAmbiguous40AmbiguousfalseAC1, AC2: NULL Qty preserves Ambiguous
TV-004-00445NULLPositive40NegativetrueCT > cutoff overrides Qty NULL

Decision Table: Combined NULL Scenarios

TVobs.final_ctobs.final_quantityexpected_behaviorCovers
TV-004-005NULLNULLSet Negative (CT NULL takes precedence)AC3: CT NULL wins
TV-004-00635NULLPreserve classificationAC3: Qty NULL preserves
TV-004-00745NULLSet Negative (CT > cutoff)CT threshold takes effect

REQ-RULES-CTCUTOFF-005: Missing Config Error

Acceptance Criteria:

  • AC1: target_id = NULL shall set CUTOFF_LIMITS_MISSED error
  • AC2: Error code shall be exactly: CUTOFF_LIMITS_MISSED
  • AC3: Error shall be set when observation cannot be matched to any configured cutoff limits

Decision Table: Error Conditions

TVobs.target_idconfig_existsexpected_errorerror_codeCovers
TV-005-001NULLN/AtrueCUTOFF_LIMITS_MISSEDAC1, AC2: NULL target_id
TV-005-002999falsetrueCUTOFF_LIMITS_MISSEDAC3: Config not found
TV-005-0031truefalsenullNormal processing
TV-005-0041truefalsenullValid target with config

Decision Table: Error Code Exactness

TVerror_conditionexpected_error_codeCovers
TV-005-005target_id is NULLCUTOFF_LIMITS_MISSEDAC2: Exact code
TV-005-006config not foundCUTOFF_LIMITS_MISSEDAC2: Exact code

Boundary Value Analysis

CT Threshold Boundaries

BoundaryTest ValueExpectedTest Vector
Below cutoff39 (cutoff=40)PreserveTV-001-003
At cutoff40 (cutoff=40)NegativeTV-001-004
Just above cutoff40.01 (cutoff=40)NegativeTV-001-002
Well above cutoff45 (cutoff=40)NegativeTV-001-001

NULL Value Boundaries

FieldNULL ValueExpectedTest Vector
CTNULLNegativeTV-003-001
QuantityNULLPreserveTV-004-001
BothNULLNegative (CT wins)TV-004-005

Test Implementation

Test File Locations

RequirementTest FileMethodAutomation Status
REQ-RULES-CTCUTOFF-001tests/Unit/Rules/WfinalclsRuleTest.phpTM-APIAutomated
REQ-RULES-CTCUTOFF-002tests/Unit/Rules/WfinalclsRuleSpecimenTypeTest.phpTM-APIAutomated
REQ-RULES-CTCUTOFF-003tests/Unit/Rules/WfinalclsRuleNullCtTest.phpTM-APIAutomated
REQ-RULES-CTCUTOFF-004tests/Unit/Rules/WfinalclsRuleNullQuantityTest.phpTM-APIAutomated
REQ-RULES-CTCUTOFF-005tests/Unit/Rules/WfinalclsRuleErrorTest.phpTM-APIAutomated

Traceability to Existing Tests

RequirementJira TestsStatusNotes
REQ-RULES-CTCUTOFF-001BT-5354ExistingBehat test (Quest_PP_2_22.xlsx config)
REQ-RULES-CTCUTOFF-002BT-4283ExistingManual test (12 steps)
REQ-RULES-CTCUTOFF-003BT-5354PartialCovers TV-003-001, TV-003-005; other TVs are gaps
REQ-RULES-CTCUTOFF-004GapNo existing test coverage
REQ-RULES-CTCUTOFF-005BT-4167ExistingManual test (9 steps)

Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
GAP-001REQ-RULES-CTCUTOFF-003BT-5354 covers TV-003-001 and TV-003-005; TV-003-002 through TV-003-004 need test coverageMediumTBD
GAP-002REQ-RULES-CTCUTOFF-004No existing test coverage for NULL Quantity handlingMediumTBD

Remediation Plan

  1. GAP-001: Create additional test cases for:

    • TV-003-002 (NULL CT + NULL Qty)
    • TV-003-003 (NULL CT from Ambiguous state)
    • TV-003-004 (NULL CT already Negative)
  2. GAP-002: Create test cases for NULL Quantity handling:

    • TV-004-001 through TV-004-007 (NULL Quantity scenarios)