STD: Reporting Quant as Qual Rule (RQUANTASQUAL)
Version: v1.0.0 Status: Draft SRS Source:
docusaurus/docs/srs/rules/rule-reporting-quant-as-qual.mdRule Name: RQUANTASQUAL Domain: RULES-RQUANTQUAL
Overview
This document specifies tests for the Reporting Quant as Qual rule using decision tables and test vectors. The rule converts quantitative PCR results (CT/Quantity values) into qualitative outcomes (Detected/Not Detected) by comparing against configured Limit of Detection (LoD) thresholds.
Rule Characteristics:
- Pure business logic (no UI)
- Threshold comparison (inclusive boundary)
- Specimen-type-based threshold selection (when enabled)
- Fallback to last-modified reporting configuration (when specimen matching disabled)
Test Method: TM-API (per Test Plan §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 ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|---|---|---|---|---|
| REQ-RULES-RQUANTQUAL-001 | Qualitative Outcome Determination | 4 | 6 | 100% | None |
| REQ-RULES-RQUANTQUAL-002 | Specimen-Based Threshold Selection | 6 | 10 | 100% | None |
Totals: 2 REQs, 10 Conditions, 16 Test Vectors, 100% Coverage
REQ-RULES-RQUANTQUAL-001: Qualitative Outcome Determination
Input Variables
| Variable | Type | Valid Values | Description |
|---|---|---|---|
obs.quantity | float | ≥ 0 | Measured quantity from PCR analysis |
obs.ct_value | float | > 0 | Measured CT (cycle threshold) value |
config.lod_threshold | float | > 0 | Configured Limit of Detection (upper boundary) |
Output Variables
| Variable | Type | Description |
|---|---|---|
well.outcome | string | Qualitative result: "Detected" or "Not Detected" |
Decision Table: Threshold Comparison
Tests the core quant-as-qual conversion logic. The LoD boundary is inclusive (>= yields Detected).
| TV | obs.quantity | config.lod_threshold | expected_outcome | Covers |
|---|---|---|---|---|
| TV-001-001 | 100 | 50 | Detected | AC: Quantity above threshold |
| TV-001-002 | 50 | 50 | Detected | AC: Quantity at threshold (boundary inclusive) |
| TV-001-003 | 30 | 50 | Not Detected | AC: Quantity below threshold |
Decision Table: CT Value Boundary
Tests boundary behavior using CT values at the LoD threshold.
| TV | obs.ct_value | config.lod_threshold | expected_outcome | Covers |
|---|---|---|---|---|
| TV-001-004 | 25 | 30 | Detected | AC: CT below threshold (lower CT = higher quantity) |
| TV-001-005 | 30 | 30 | Detected | AC: CT at boundary (inclusive) |
| TV-001-006 | 35 | 30 | Not Detected | AC: CT above threshold (higher CT = lower quantity) |
REQ-RULES-RQUANTQUAL-002: Specimen-Based Threshold Selection
Input Variables
| Variable | Type | Valid Values | Description |
|---|---|---|---|
config.use_sample_type | bool | true, false | Enable specimen-type-specific threshold selection |
well.specimen_type | string | Plasma, Serum, ... | Sample matrix category |
reporting.specimen_type | string | Plasma, Serum, ... | Reporting configuration specimen type |
reporting.lod_threshold | float | > 0 | LoD threshold for the reporting configuration |
reporting.last_modified | timestamp | datetime | Last modification timestamp of reporting config |
Output Variables
| Variable | Type | Description |
|---|---|---|
selected_lod | float | The LoD threshold selected for comparison |
well.outcome | string | Qualitative result based on selected threshold |
Decision Table: Specimen Type Enabled
When use_sample_type is enabled, the system selects the LoD threshold matching the well's specimen type.
| TV | use_sample_type | well.specimen | plasma_lod | serum_lod | obs.ct | expected_lod | expected_outcome | Covers |
|---|---|---|---|---|---|---|---|---|
| TV-002-001 | true | Plasma | 30 | 10 | 25 | 30 | Not Detected | AC: Plasma well uses Plasma LoD (25 < 30) |
| TV-002-002 | true | Serum | 30 | 10 | 25 | 10 | Detected | AC: Serum well uses Serum LoD (25 >= 10) |
| TV-002-003 | true | Plasma | 30 | 10 | 35 | 30 | Not Detected | AC: CT above Plasma threshold |
| TV-002-004 | true | Serum | 30 | 10 | 5 | 10 | Detected | AC: CT well below Serum threshold |
Decision Table: Specimen Type Disabled (Legacy Mode)
When use_sample_type is disabled, the system uses the last-modified reporting configuration regardless of specimen type.
| TV | use_sample_type | plasma_last_mod | serum_last_mod | well.specimen | obs.ct | expected_lod | expected_outcome | Covers |
|---|---|---|---|---|---|---|---|---|
| TV-002-005 | false | 2023-11-08 00:00:00 | 2023-11-08 00:01:00 | Plasma | 25 | 10 (Serum) | Detected | AC: Uses last modified (Serum newer) |
| TV-002-006 | false | 2023-11-08 00:01:00 | 2023-11-08 00:00:00 | Serum | 25 | 30 (Plasma) | Not Detected | AC: Uses last modified (Plasma newer) |
Decision Table: All Wells Same Threshold (Disabled Mode)
When sample type is disabled, all wells in the same run use the same LoD threshold.
| TV | use_sample_type | last_mod_lod | well_A.specimen | well_B.specimen | obs.ct | well_A_outcome | well_B_outcome | Covers |
|---|---|---|---|---|---|---|---|---|
| TV-002-007 | false | 10 | Plasma | Serum | 25 | Detected | Detected | AC: Same threshold for all wells |
| TV-002-008 | false | 30 | Plasma | Serum | 25 | Not Detected | Not Detected | AC: Uniform threshold application |
Decision Table: Rule Mapping Requirement
Specimen-based threshold selection requires rule mappings to be configured per specimen type.
| TV | use_sample_type | plasma_mapping | serum_mapping | well.specimen | rule_applies | Covers |
|---|---|---|---|---|---|---|
| TV-002-009 | true | configured | configured | Plasma | true | AC: Rule mapping exists |
| TV-002-010 | true | configured | missing | Serum | false | AC: Rule mapping required per specimen |
Traceability to Existing Tests
| Requirement | Jira Tests | Automation Status |
|---|---|---|
| REQ-RULES-RQUANTQUAL-001 | BT-5204 | Automated (3 TVs) |
| REQ-RULES-RQUANTQUAL-002 | BT-4283 | Manual |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|---|---|---|---|
| None | - | All acceptance criteria have corresponding test vectors | - | - |
Coverage Notes
-
REQ-RULES-RQUANTQUAL-001: Core threshold comparison is fully covered by TV-001-001 through TV-001-006, including boundary conditions.
-
REQ-RULES-RQUANTQUAL-002: Specimen-based selection is covered by:
- Enabled mode scenarios (TV-002-001 through TV-002-004)
- Disabled/legacy mode scenarios (TV-002-005 through TV-002-008)
- Rule mapping requirement (TV-002-009, TV-002-010)