STD: Qualitative Reporting Rule (RQUAL)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-reporting-qual.md
Rule Name: RQUAL
Domain: RULES-RQUAL
Overview
This document specifies tests for the Qualitative Reporting (RQUAL) rule using decision tables and test vectors. The rule determines qualitative reporting outcomes (Detected/Not Detected) by comparing sample CT values against configured cutoff thresholds, with support for specimen-type-specific configurations.
Rule Characteristics:
- Pure business logic (no UI)
- CT threshold comparison (CT < CutOff = Detected, CT >= CutOff = Not Detected)
- Specimen-type-specific configuration selection when enabled
- Last-modified fallback when sample type mode disabled
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 ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|
| REQ-RULES-RQUAL-001 | Qualitative Threshold Evaluation | 6 | 8 | 100% | None |
| REQ-RULES-RQUAL-002 | Specimen-Specific Configuration Selection | 8 | 10 | 100% | None |
Totals: 2 REQs, 14 Conditions, 18 Test Vectors, 100% Coverage
REQ-RULES-RQUAL-001: Qualitative Threshold Evaluation
| Variable | Type | Valid Values | Description |
|---|
sample.ct | float | numeric (positive) | Sample CT (cycle threshold) value |
config.upper_boundary | float | numeric (positive) | CutOff threshold from reporting configuration |
sample.reporting_type | string | Qualitative, Quantitative | Sample reporting configuration |
Output Variables
| Variable | Type | Description |
|---|
outcome | string | Detected, Not Detected, Error |
rule_applied | bool | Whether RQUAL rule was executed |
Decision Table: CT vs CutOff Comparison
| TV | sample.ct | config.upper_boundary | outcome | Covers |
|---|
| TV-001-001 | 25 | 30 | Detected | AC: CT < CutOff = Detected (low CT = strong signal) |
| TV-001-002 | 30 | 30 | Not Detected | AC: CT >= CutOff = Not Detected (boundary) |
| TV-001-003 | 35 | 30 | Not Detected | AC: CT >= CutOff = Not Detected |
| TV-001-004 | 10 | 10 | Not Detected | AC: CT >= CutOff at minimum boundary |
| TV-001-005 | 9.99 | 10 | Detected | AC: CT < CutOff = Detected (just below boundary) |
| TV-001-006 | 0.5 | 30 | Detected | AC: Very low CT value = strong signal = Detected |
Decision Table: Rule Scope Filter
| TV | sample.reporting_type | rule_applied | Covers |
|---|
| TV-001-007 | Qualitative | true | AC: Rule applied to qualitative samples |
| TV-001-008 | Quantitative | false | AC: Rule skipped for quantitative samples |
REQ-RULES-RQUAL-002: Specimen-Specific Configuration Selection
| Variable | Type | Valid Values | Description |
|---|
setting.use_sample_type | bool | true, false | System setting for specimen-type matching |
sample.specimen_type | string | Plasma, Serum, ... | Sample specimen type |
sample.mix | string | identifier | Sample mix identifier |
sample.target | string | identifier | Sample target identifier |
configs[] | array | reporting configurations | Available reporting configurations |
config.specimen_type | string | Plasma, Serum, ... | Configuration specimen type |
config.last_modified | datetime | timestamp | Configuration modification timestamp |
config.upper_boundary | float | numeric | CutOff threshold |
Output Variables
| Variable | Type | Description |
|---|
selected_config | object | The reporting configuration used for evaluation |
outcome | string | Detected, Not Detected based on selected config |
Decision Table: Sample Type Mode Enabled
| TV | use_sample_type | sample.specimen | sample.ct | plasma.upper_boundary | serum.upper_boundary | selected_config | outcome | Covers |
|---|
| TV-002-001 | true | Plasma | 25 | 30 | 10 | Plasma | Detected | AC: Match specimen to config (CT 25 < Plasma cutoff 30 = Detected) |
| TV-002-002 | true | Serum | 25 | 30 | 10 | Serum | Not Detected | AC: Match specimen to config (CT 25 >= Serum cutoff 10 = Not Detected) |
| TV-002-003 | true | Plasma | 35 | 30 | 10 | Plasma | Not Detected | AC: Plasma specimen CT >= cutoff = Not Detected |
| TV-002-004 | true | Serum | 5 | 30 | 10 | Serum | Detected | AC: Serum specimen CT < cutoff = Detected |
Decision Table: Sample Type Mode Disabled (Last Modified Fallback)
| TV | use_sample_type | sample.specimen | sample.ct | plasma.last_mod | serum.last_mod | serum.upper_boundary | selected_config | outcome | Covers |
|---|
| TV-002-005 | false | Plasma | 25 | 2023-11-08 00:00 | 2023-11-08 00:01 | 10 | Serum (last mod) | Not Detected | AC: Uses most recent config (CT 25 >= cutoff 10 = Not Detected) |
| TV-002-006 | false | Serum | 25 | 2023-11-08 00:00 | 2023-11-08 00:01 | 10 | Serum (last mod) | Not Detected | AC: Uses most recent config regardless of specimen (CT 25 >= 10) |
| TV-002-007 | false | Plasma | 5 | 2023-11-08 00:00 | 2023-11-08 00:01 | 10 | Serum (last mod) | Detected | AC: Last modified fallback, CT < cutoff = Detected |
Decision Table: Configuration Match by Mix/Target/Specimen
| TV | sample.mix | sample.target | sample.specimen | config.mix | config.target | config.specimen | match | Covers |
|---|
| TV-002-008 | HEV | HEV | Plasma | HEV | HEV | Plasma | true | AC: Full match on Mix, Target, Specimen |
| TV-002-009 | HEV | HEV | Plasma | HEV | HEV | Serum | false | AC: Specimen mismatch |
| TV-002-010 | HEV | HAV | Plasma | HEV | HEV | Plasma | false | AC: Target mismatch |
Error Handling
Decision Table: Configuration Errors
| TV | Condition | Expected Behavior | Covers |
|---|
| TV-ERR-001 | No matching reporting config for specimen type | Fall through to subsequent rules or raise configuration error | AC: Error handling - missing config |
| TV-ERR-002 | Sample type mode enabled, no specimen type match | Use fallback selection logic | AC: Error handling - no specimen match |
Traceability to Existing Tests
| Requirement | SRS Test Cases | Jira | Status |
|---|
| REQ-RULES-RQUAL-001 | TV-001-001 to TV-001-008 | BT-5241 | Partial |
| REQ-RULES-RQUAL-002 | TC-RQUAL-002-01, TC-RQUAL-002-02 | BT-5204, BT-5191 | Partial |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Automation Status |
|---|
| GAP-001 | REQ-RULES-RQUAL-001 | No dedicated test cases for core CT threshold comparison | High | Automated |
- GAP-001: Create test coverage for TV-001-001 through TV-001-008 covering:
- CT < CutOff boundary conditions
- CT >= CutOff boundary conditions
- Rule scope filter (qualitative vs quantitative samples)
Existing Coverage
REQ-RULES-RQUAL-002 has existing test cases (TC-RQUAL-002-01, TC-RQUAL-002-02) documented in the SRS that cover specimen-type-specific configuration selection with sample type mode enabled and disabled scenarios.
Test Data Reference
Standard Test Configuration
Based on SRS example configuration:
Reportings:
| Config Name | Mix | Target | Specimen Type | Upper Boundary | Last Modified |
|---|
| Plasma Config | HEV | HEV | Plasma | 30 | 2023-11-08 00:00:00 |
| Serum Config | HEV | HEV | Serum | 10 | 2023-11-08 00:01:00 |
Rule Mappings:
| Mix | Target | Specimen Type | Rule |
|---|
| HEV | HEV | Plasma | RQUAL |
| HEV | HEV | Serum | RQUAL |