Reporting Quant as Qual Rule (RQUANTASQUAL)
Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: RQUANTASQUAL rule for converting quantitative PCR results to qualitative outcomes Domain: RULES-RQUANTQUAL Precedence: After quantification completes
Statement
The system shall convert quantitative PCR results into qualitative outcomes (Detected/Not Detected) by comparing measured quantity or CT values against configured Limit of Detection (LoD) thresholds.
When specimen-type matching is enabled, the rule selects the LoD threshold specific to the well's specimen type (e.g., Plasma vs Serum). When disabled, the rule uses the most recently modified reporting configuration regardless of specimen type, maintaining backwards compatibility.
Quick Reference
| ID | Core Behavior | Priority | Status |
|---|---|---|---|
| REQ-RULES-RQUANTQUAL-001 | Converts quantitative results to Detected/Not Detected based on LoD threshold | HIGH | Draft |
| REQ-RULES-RQUANTQUAL-002 | Selects LoD threshold based on specimen type when enabled | HIGH | Draft |
Key Integration Points: Quantification system, Reporting configuration, Rule mapping, Specimen type system
Rule Summary
| Property | Value |
|---|---|
| Name | RQUANTASQUAL |
| Triggers | After quantification completes |
| Input | Well observations with CT/Quantity values |
| Output | Qualitative outcome (Detected/Not Detected) |
Rule Flowchart (Illustrative)
This diagram illustrates the core quant-as-qual conversion logic. The LoD boundary comparison is inclusive (>= yields Detected).
Definitions
| Term | Definition |
|---|---|
| LoD (Limit of Detection) | The configured threshold value below which a quantitative measurement is considered undetectable |
| Quant-as-Qual | A reporting mode where quantitative PCR results are converted to qualitative outcomes (Detected/Not Detected) |
| Specimen Type | The sample matrix category (e.g., Plasma, Serum) that may affect detection sensitivity |
| Upper Boundary | The LoD threshold value configured in the reporting configuration |
| Rule Mapping | Configuration associating a mix/target/specimen combination with a specific rule |
Assumptions
- Quantification has completed before the RQUANTASQUAL rule executes
- Well observations contain valid CT or Quantity values
- At least one reporting configuration exists for the mix/target combination
- Rule mappings are configured to associate the RQUANTASQUAL rule with applicable targets
Requirements
Qualitative Outcome Determination (REQ-RULES-RQUANTQUAL-001)
FR-RQUANTQUAL-001: Report Quantitative Results as Qualitative Outcomes
The system shall report quantitative results as qualitative outcomes based on comparison against the Limit of Detection threshold.
Inputs/Outputs
| Direction | Data | Source/Target |
|---|---|---|
| Input | Well observation (CT value, Quantity) | PCR analysis |
| Input | LoD threshold (upper boundary) | Reporting configuration |
| Output | Qualitative outcome (Detected/Not Detected) | Well record |
Acceptance Criteria
Threshold Comparison:
- Given a well observation with Quantity >= LoD threshold, when the RQUANTASQUAL rule executes, then the result outcome shall be "Detected"
- Given a well observation with Quantity < LoD threshold, when the RQUANTASQUAL rule executes, then the result outcome shall be "Not Detected"
- Given a well observation with CT value at exactly the LoD boundary, when the RQUANTASQUAL rule executes, then the result outcome shall be "Detected" (boundary is inclusive)
Trace: Source: 3.0.0-Reporting Quant as Qual (Row 1, Objective) | Jira: BT-674 | Tests: See scenarios
Specimen-Based Threshold Selection (REQ-RULES-RQUANTQUAL-002)
FR-RQUANTQUAL-002: Select LoD Threshold Based on Specimen Type
The system shall select the LoD reporting threshold based on specimen type when sample type matching is enabled.
Inputs/Outputs
| Direction | Data | Source/Target |
|---|---|---|
| Input | Well specimen type | Well record |
| Input | Use sample type flag | System configuration |
| Input | Multiple reporting configurations (per specimen) | Kit configuration |
| Output | Selected LoD threshold | Rule execution context |
Acceptance Criteria
Specimen Type Enabled:
- Given "use sample type" is enabled, the system shall use the reporting configuration matching the well's specimen type for LoD threshold selection
- The system shall require rule mappings to be configured per specimen type for specimen-based thresholds to apply
Specimen Type Disabled (Legacy Mode):
- Given "use sample type" is disabled, the system shall use the last modified reporting configuration (by timestamp) for the mix/target combination, regardless of specimen type
- Given sample type disabled with multiple reportings, when any well is evaluated, then all wells shall use the same LoD threshold (the last modified reporting)
Example Scenarios:
| Scenario | Sample Type | Plasma LoD | Serum LoD | Well Specimen | CT Value | Expected Outcome |
|---|---|---|---|---|---|---|
| Enabled, Plasma well | Enabled | 30 | 10 | Plasma | 25 | Not Detected (25 < 30) |
| Enabled, Serum well | Enabled | 30 | 10 | Serum | 25 | Detected (25 >= 10) |
| Disabled, any well | Disabled | 30 | 10 (last modified) | Plasma | 25 | Detected (uses 10) |
Trace: Source: 3.0.0-RQUANTASQUAL Rule - Should use unique reporting based on specimen (Row 1) | Jira: BT-4204, BT-4283 | Tests: BT-4283, See scenarios
Configuration Options
| Option | Default | Description | Affects |
|---|---|---|---|
use_sample_type | false | Enable specimen-type-specific LoD threshold selection | REQ-RULES-RQUANTQUAL-002 |
UI Notes (Illustrative)
Reporting Configuration Fields
| Field | Example | Purpose |
|---|---|---|
| Mix | HEV | Reagent mixture identifier |
| Target | HEV | Detection target |
| Specimen type | Plasma, Serum | Sample matrix category |
| Quant or CT | Ct | Measurement mode |
| Group | 1 LoD | Configuration grouping |
| Upper Boundary | 30 | LoD threshold value |
| Last modified timestamp | 2023-11-08 00:00:00 | For fallback selection when sample type disabled |
Rule Mapping Configuration Fields
| Field | Example |
|---|---|
| Mix | HEV |
| Target | HEV |
| Specimen type | Plasma |
| Rule | RQUANTASQUAL |
Flow Diagram Reference
The RQUANTASQUAL rule flow is visualized in media/image166.png:
- Start - Rule execution begins
- Decision: Is quantity >= LoD?
- Yes: Result is "Detected"
- No: Result is "Not Detected"
- End - Qualitative outcome assigned to well
Implementation (Illustrative)
| Component | Location |
|---|---|
| Rule Class | Analyzer/Rules/RquantasqualRule.php |
| LIMS Status Setter | Analyzer/Rules/Concerns/SetLimsStatusToWell.php |
Traceability Matrix
| Requirement | Title | Verification | Implementation | Test Cases | Status |
|---|---|---|---|---|---|
| REQ-RULES-RQUANTQUAL-001 | Report Quantitative Results as Qualitative Outcomes | Test | RquantasqualRule.handle() | [Pending] | Draft |
| REQ-RULES-RQUANTQUAL-002 | Select LoD Threshold Based on Specimen Type | Test | RquantasqualRule.handle(), ConfigurationRepository.getFirstGroupReportingForObservation() | BT-4283 | Draft |
Notes
- This rule is used for assays that perform quantitative analysis but require qualitative reporting
- The LoD threshold is configured per target in the reporting configuration
- Specimen-based thresholds are particularly important for assays where sample matrix affects detection sensitivity
- Legacy behavior (sample type disabled) uses timestamp-based fallback to maintain backwards compatibility
- Error handling not included as this rule operates on already-validated well observations. Error conditions (missing CT value, missing reporting configuration) are handled by upstream systems.
Acceptance Tests
Test: REQ-RULES-RQUANTQUAL-001
Test: Quantity at or above threshold yields Detected
Given: Well observation with Quantity = 100
And: LoD threshold = 50
When: RQUANTASQUAL rule executes
Then: Result outcome shall be "Detected"
Test: Quantity below threshold yields Not Detected
Given: Well observation with Quantity = 30
And: LoD threshold = 50
When: RQUANTASQUAL rule executes
Then: Result outcome shall be "Not Detected"
Test: Boundary is inclusive (exactly at LoD)
Given: Well observation with CT value = 30
And: LoD threshold = 30
When: RQUANTASQUAL rule executes
Then: Result outcome shall be "Detected"
Test: REQ-RULES-RQUANTQUAL-002
Test: Specimen-based threshold selection (BT-4283)
Given: Configuration setup
Reportings:
Plasma:
Mix: HEV
Target: HEV
Specimen type: Plasma
Quant or CT: Ct
Group: 1 LoD
Upper Boundary: 30
Last modified at: 2023-11-08 00:00:00
Serum:
Mix: HEV
Target: HEV
Specimen type: Serum
Quant or CT: Ct
Group: 1 LoD
Upper Boundary: 10
Last modified at: 2023-11-08 00:01:00
Rule mappings:
Plasma:
Mix: HEV
Target: HEV
Specimen type: Plasma
Rule: RQUANTASQUAL
Serum:
Mix: HEV
Target: HEV
Specimen type: Serum
Rule: RQUANTASQUAL
Runfile:
Well A1: Mix=HEV, Target=HEV, Specimen=Plasma, Ct=25
Well A2: Mix=HEV, Target=HEV, Specimen=Serum, Ct=25
When: Use sample type is enabled
And: Import the runfile
And: Open imported run and observe A1 and A2 wells
Then: A1 (Plasma) shall have Not Detected outcome (Ct=25 < threshold=30)
And: A2 (Serum) shall have Detected outcome (Ct=25 >= threshold=10)
When: Use sample type is disabled
And: Import the runfile
And: Open imported run and observe A1 and A2 wells
Then: A1 shall have Detected outcome (uses last modified Serum threshold=10)
And: A2 shall have Detected outcome (uses last modified Serum threshold=10)
Related Design Documents
| Design Document | Relevant Sections |
|---|---|
| SDD Algorithms | RQUANTASQUAL Rule Algorithm |
Appendix: Process Artifacts
Completion Checklist
- All requirements are capability-level (describe behavior, not UI)
- Requirement variants consolidated (no requirement explosion) - N/A, only 2 requirements
- UI details are fully demoted to Illustrative section
- Configuration options are not encoded as requirements
- Acceptance criteria describe behavior, not UI mechanics
- Every requirement has acceptance criteria and source traceability
- Error handling addressed - N/A, upstream systems handle errors
- Open questions documented with owners assigned - N/A, no open questions
- Consolidations documented in Reviewer Notes with reversibility info
- Module can survive a full UI redesign unchanged
- Refinements do not introduce new capabilities
- Traceability matrix is complete
Reviewer Notes
No Consolidation Required
The source document contained exactly 2 requirements representing distinct system capabilities:
| Requirement | Capability | Justification |
|---|---|---|
| REQ-RULES-RQUANTQUAL-001 | Core quant-as-qual comparison logic | Primary rule behavior |
| REQ-RULES-RQUANTQUAL-002 | Specimen-based threshold selection | Configuration-driven threshold routing |
These requirements were preserved as-is per the RULES domain guidance for conservative consolidation. No requirement explosion pattern was detected.
Reversibility: N/A - No consolidation performed.
Source Reference:
output/pilot/rules/rule-reporting-quant-as-qual/rule-reporting-quant-as-qual-restructured.md