Skip to main content
Version: Next

STD: RQUANT Rule

Version: v1.0.0 Status: Draft SRS Source: docusaurus/docs/srs/rules/rule-rquant.md Rule Name: RQUANT Domain: RULES-RQUANT


Overview

This document specifies tests for the RQUANT rule using decision tables and test vectors. The rule evaluates sample quantities against configured quantity group thresholds (Groups 2-9) and determines the appropriate reporting format including rounding precision, scientific notation, and detection thresholds.

Rule Characteristics:

  • Pure business logic (no UI)
  • Tiered decision tree with 9 quantity groups
  • Specimen-type-based configuration selection
  • Placeholder-based reporting output
  • Error handling for missing configuration

Test Method: TM-API (per Test Plan - 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-RQUANT-001Evaluate and Format Sample Quantities1826100%None
REQ-RULES-RQUANT-002Handle Missing Configuration34100%None
REQ-RULES-RQUANT-003Select Reporting Configuration by Specimen Type68100%None

Totals: 3 REQs, 27 Conditions, 38 Test Vectors, 100% Coverage


Input Variables (Common)

VariableTypeValid ValuesDescription
quantityfloat0 to unlimitedSample quantity value from PCR analysis
target_idint?null, valid IDTarget identifier for the observation
specimen_typestringPlasma, Serum, ...Sample material type
use_sample_typebooltrue, falseSystem config for specimen-type selection

Configuration Variables

VariableTypeDescription
group_2_thresholdfloatUpper boundary for Group 2 (LoD)
group_3_thresholdfloatUpper boundary for Group 3 (no rounding)
group_4_thresholdfloatUpper boundary for Group 4 (boundary value)
group_5_thresholdfloatUpper boundary for Group 5 (1 sig fig)
group_6_thresholdfloatUpper boundary for Group 6 (2 sig figs)
group_7_thresholdfloatUpper boundary for Group 7 (3 sig figs)
group_8_thresholdfloatUpper boundary for Group 8 (2 sig figs)
group_9_thresholdfloatUpper boundary for Group 9 (sci notation)
reporting_config.specimen_typestringSpecimen type for this config
reporting_config.last_modified_atdatetimeTimestamp for fallback selection

Output Variables

VariableTypeDescription
formatted_quantitystringFormatted quantity for LIMS export
error_codestring?Error code (null if successful)
{QUANT}stringPlaceholder value with applied rounding
{LOQ}stringPlaceholder filled with applicable group limit

REQ-RULES-RQUANT-001: Evaluate and Format Sample Quantities

Decision Table: Tiered Quantity Formatting

Test configuration uses the following threshold values:

  • Group 2: 100, Group 3: 500, Group 4: 1000, Group 5: 5000
  • Group 6: 10000, Group 7: 100000, Group 8: 1000000, Group 9: 10000000
TVquantityexpected_formatformat_ruleCovers
TV-001-00150"Detected: <100"Group 2: detected below LoDAC: qty <= Group 2
TV-001-002100"Detected: <100"Group 2: boundary inclusiveAC: qty = Group 2
TV-001-003250"250"Group 3: no roundingAC: Group 2 < qty <= Group 3
TV-001-004500"500"Group 3: boundary inclusiveAC: qty = Group 3
TV-001-005750"1000"Group 4: boundary valueAC: Group 3 < qty <= Group 4
TV-001-0061000"1000"Group 4: boundary inclusiveAC: qty = Group 4
TV-001-0071040"1,000"Group 5: 1 sig figAC: Group 4 < qty <= Group 5
TV-001-0082500"3,000"Group 5: 1 sig fig (round up)AC: 1 sig fig rounding
TV-001-0095000"5,000"Group 5: boundary inclusiveAC: qty = Group 5
TV-001-0102123"2,100"Group 6: 2 sig figsAC: Group 5 < qty <= Group 6
TV-001-0119999"10,000"Group 6: 2 sig figs (round up)AC: 2 sig fig rounding
TV-001-01212927"12,900"Group 7: 3 sig figsAC: Group 6 < qty <= Group 7
TV-001-01399950"100,000"Group 7: 3 sig figs (round up)AC: 3 sig fig rounding
TV-001-0141565323"1,600,000"Group 8: 2 sig figsAC: Group 7 < qty <= Group 8
TV-001-0151000000"1,000,000"Group 8: boundary inclusiveAC: qty = Group 8
TV-001-0169982000"1.00E+07"Group 9: sci notation 2 sigAC: Group 8 < qty <= Group 9
TV-001-01710000000"1.00E+07"Group 9: boundary inclusiveAC: qty = Group 9
TV-001-01815000000">1.00E+07"Exceeds Group 9AC: qty > Group 9
TV-001-01999999999">1.00E+07"Exceeds Group 9 (large)AC: qty > Group 9

Decision Table: Placeholder Processing

TVtemplatequantityloq_valueexpected_outputCovers
TV-001-020"Report {QUANT}"1040100"Report 1,000"AC: {QUANT} substitution
TV-001-021"LOQ: {LOQ}"50100"LOQ: 100"AC: {LOQ} substitution
TV-001-022"Result: {QUANT}, LOQ: {LOQ}"2123100"Result: 2,100, LOQ: 100"AC: Combined placeholders

Decision Table: Boundary Conditions (Edge Cases)

TVquantitygroup_boundaryexpected_behaviorCovers
TV-001-02399.99Group 2 = 100"Detected: <100"AC: Just below boundary
TV-001-024100.01Group 2 = 100No rounding (Group 3)AC: Just above boundary
TV-001-0250Group 2 = 100"Detected: <100"AC: Zero quantity
TV-001-0260.001Group 2 = 100"Detected: <100"AC: Very small quantity

REQ-RULES-RQUANT-002: Handle Missing Configuration

Decision Table: Error Conditions

TVtarget_idqty_groups_configuredexpected_errorexpected_outputCovers
TV-002-001nullN/ARQUANT_LIMITS_MISSEDnullAC: target_id is null
TV-002-002123falseRQUANT_LIMITS_MISSEDnullAC: Groups not configured
TV-002-003123truenullformatted valueAC: Valid configuration
TV-002-004456partial (missing Group 5)RQUANT_LIMITS_MISSEDnullAC: Incomplete config

REQ-RULES-RQUANT-003: Select Reporting Configuration by Specimen Type

Decision Table: Configuration Selection Logic

TVuse_sample_typesample_specimenconfigs_availableexpected_configCovers
TV-003-001truePlasma[Plasma, Serum]Plasma configAC: Match by specimen
TV-003-002trueSerum[Plasma, Serum]Serum configAC: Match by specimen
TV-003-003falsePlasma[Plasma(older), Serum(newer)]Serum configAC: Last modified wins
TV-003-004falseSerum[Plasma(newer), Serum(older)]Plasma configAC: Last modified wins

Decision Table: Specimen-Specific LOQ Values

Test scenario: HEV target with Plasma LOQ=430, Serum LOQ=228

TVuse_sample_typespecimenquantityexpected_outcomeCovers
TV-003-005truePlasma113"Detected:<430"AC: Plasma-specific LOQ
TV-003-006trueSerum113"Detected:<228"AC: Serum-specific LOQ
TV-003-007falsePlasma113"Detected:<228"AC: Falls back to last modified (Serum)
TV-003-008falseSerum113"Detected:<228"AC: Falls back to last modified (Serum)

Automation Status

REQ IDTest VectorsAutomation StatusNotes
REQ-RULES-RQUANT-001TV-001-001 to TV-001-026AutomatedQuantity formatting
REQ-RULES-RQUANT-002TV-002-001 to TV-002-004AutomatedError handling
REQ-RULES-RQUANT-003TV-003-001 to TV-003-008AutomatedSpecimen selection

Traceability to Existing Tests

RequirementJira TestsStatus
REQ-RULES-RQUANT-001BT-5203Partial (18 TVs)
REQ-RULES-RQUANT-002BT-5203Partial (implicit)
REQ-RULES-RQUANT-003BT-5203Partial (TV-003-005, TV-003-006)

Note: BT-5203 uses v2 config (Viracor 2.25.0.xlsx). No v3 RQUANT test available.


Gap Analysis

Identified Gaps

GapRequirementDescriptionPriorityOwner
GAP-001REQ-RULES-RQUANT-001BT-5203 covers 18 TVs; 12 TVs remain untested (boundary/rounding edge cases: TV-001-008 through TV-001-026)HighTBD
GAP-002REQ-RULES-RQUANT-002BT-5203 provides implicit coverage for TV-002-003; TV-002-001, TV-002-002, TV-002-004 (error handling) untestedMediumTBD
GAP-003REQ-RULES-RQUANT-003BT-5203 covers TV-003-005 (Plasma LOQ), TV-003-006 partial; TV-003-001 to TV-003-004, TV-003-007, TV-003-008 (specimen selection logic) untestedMediumTBD

Remediation Plan

  1. GAP-001: Expand v3 RQUANT test coverage for boundary conditions (TV-001-008, TV-001-009, TV-001-011 through TV-001-026)
  2. GAP-002: Create test scenarios for missing configuration error handling (TV-002-001, TV-002-002, TV-002-004)
  3. GAP-003: Create test scenarios for specimen-type selection logic (TV-003-001 through TV-003-004, TV-003-007, TV-003-008)