Skip to main content
Version: 3.0.0

Managing Quantities Rule

Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: RQUANTASQUAL rule for placeholder substitution in LIMS export messages Domain: RULES-QUANTITIES Precedence: After standard curve processing, during LIMS export


Statement

The system shall support configurable placeholders for quantity values in LIMS export configuration, enabling dynamic content substitution at export time.

This rule enables laboratories to report actual quantity values and limit-of-quantification (LOQ) thresholds to patients, rather than simple Detected/Not Detected results. Placeholders in message templates are resolved against well data, with lab-specific rounding rules applied before substitution.


Quick Reference

IDCore BehaviorPriorityStatus
REQ-RULES-QUANTITIES-001Substitutes {LOQ} and {QUANT} placeholders in LIMS export messagesHIGHDraft

Key Integration Points: LIMS Export Module, Standard Curve Properties, Group Configuration (LOQ), Lab Configuration (rounding)

Rule Summary

PropertyValue
NameRQUANTASQUAL
TriggersWhen processing LIMS export message templates
OutputMessage with placeholders replaced by quantity values

Rule Flowchart (Illustrative)

This diagram illustrates the placeholder substitution logic. Rounding behavior (e.g., Viracor: nearest 100) is lab-specific configuration.


Definitions

TermDefinition
LOQLimit of Quantification - the lowest concentration that can be reliably quantified for a given assay group
QUANTQuantification - the calculated quantity value from PCR analysis after applying rounding rules
PlaceholderA token in the format {TOKEN} that is replaced with dynamic content during LIMS export
RQUANTASQUALRule identifier for Managing Quantities configuration
RQUANTRounded Quantity - quantity value after applying lab-specific rounding rules

Assumptions

  • Users have appropriate permissions to configure LIMS export messages
  • Quantitative assays produce calculated quantity values through standard curve analysis
  • LOQ values are configured for each quantitative assay group
  • Lab-specific rounding rules are defined in the lab configuration

Requirements

Placeholder Substitution (REQ-RULES-QUANTITIES-001)

FR-QUANTITIES-001: Support Quantity Placeholders in LIMS Export Configuration

The system shall support configurable placeholders for quantity values in LIMS export configuration, enabling dynamic content substitution at export time.

Inputs/Outputs

DirectionDataSource/Target
InputMessage template (may contain placeholders)LIMS export configuration
InputWell quantity valueStandard curve analysis
InputGroup LOQ valueGroup configuration
InputRounding rulesLab configuration
OutputProcessed message with substituted valuesLIMS export

Acceptance Criteria

Placeholder Substitution:

  • The {LOQ} placeholder shall be substituted with the applicable group limit (LOQ value from database or configuration)
  • The {QUANT} placeholder shall be substituted with the well's reported quantity value
  • Users shall be able to include placeholder tokens in LIMS export configuration text
  • Message templates with multiple placeholders shall have all placeholders substituted
  • Placeholder syntax shall match the pattern {[A-Z]+}

Template Pass-through:

  • Message templates without placeholders shall pass through unchanged

Rounding:

  • The reported quantity shall reflect any applicable rounding rules defined in lab configuration
  • Rounding shall be applied before placeholder substitution (e.g., Viracor: 1040 rounds to 1000)

Data Validation:

  • Quantity values shall be non-negative numeric values
  • LOQ configuration shall exist for each quantitative assay group

Error Handling

  • Unknown placeholder in template: pass the unknown placeholder through unchanged and log a warning
  • LOQ not configured for group: use a default value or skip substitution
  • Quantity is null or invalid: use placeholder "N/A" or skip substitution
  • Rounding rules not configured: use the raw quantity value without rounding

Trace: Source: 3.0.0-Managing quantities (Rows 1, 2, 3) | Jira: BT-752 | Tests: TC-RQUANTASQUAL-001 to 005 | Related: RQUANT (Rounding Rules)


Configuration Options

OptionDefaultDescriptionAffects
rounding_ruleslab-specificLab-specific rounding behavior (e.g., nearest 10, nearest 100, significant figures)REQ-RULES-QUANTITIES-001
unknown_placeholder_behaviorpass_throughBehavior for unrecognized placeholders (pass_through or error)REQ-RULES-QUANTITIES-001
null_quantity_displayN/ADisplay value when quantity is null or invalidREQ-RULES-QUANTITIES-001

UI Notes (Illustrative)

REQ-RULES-QUANTITIES-001 UI Specifications

Configuration Table Layout:

The message configuration interface displays a table with the following columns:

  • Message: The message text (may contain placeholders)
  • Code: Internal code for the message type (e.g., DETECTED_QUANT, DETECTED_LOQ)
  • Type: Message classification (Information, Warning, Exclude)

Example Configuration Rows:

MessageCodeType
DetectedDETECTEDInformation
Detected:<{LOQ}DETECTED_LOQInformation
Detected: {Quant}DETECTED_QUANTInformation
Not detectedNOT DETECTEDInformation
Inhibited positiveINHPWarning
InhibitedINHNWarning
Re-extractedRXTWarning
Re-amplifyRPTWarning
Well excludedEXCLUDEExclude

Message Type Assignment:

ConditionMessage TemplateCode
Quantity detected, above LOQDetected: {Quant}DETECTED_QUANT
Quantity detected, below LOQDetected:<{LOQ}DETECTED_LOQ
Quantity not detectedNot detectedNOT DETECTED

Implementation (Illustrative)

ComponentLocation
QuantityWeightRuleAnalyzer/Rules/QuantityWeightRule.php

Traceability Matrix

RequirementTitleVerificationImplementationTest CasesStatus
REQ-RULES-QUANTITIES-001Support Quantity Placeholders in LIMS Export ConfigurationTestQuantityWeightRuleTC-RQUANTASQUAL-001 to 005Draft

Notes

  • Rounding rules are lab-specific and defined outside the scope of this rule
  • Example rounding behaviors:
    • Viracor: Round to nearest 100 (1040 becomes 1000, 1050 becomes 1100)
    • Generic: No rounding (raw value used)
  • This rule enables quantity reporting to meet patient reporting needs beyond simple Detected/Not Detected outcomes
  • The placeholder system provides flexibility for different message formats across result types
  • Legacy systems may use static messages; this rule enables migration to dynamic content

Open Questions

None identified.


Acceptance Tests

Test: REQ-RULES-QUANTITIES-001

Back to requirement

Test TC-RQUANTASQUAL-001: LOQ Placeholder Substitution

Given: A message template containing {LOQ} placeholder
And: The group LOQ is configured as 100
When: The system processes the template "Detected:<{LOQ}"
Then: The system shall produce output "Detected:<100"

Test TC-RQUANTASQUAL-002: QUANT Placeholder Substitution

Given: A message template containing {QUANT} placeholder
And: The well quantity is 5000
And: No rounding rules are configured
When: The system processes the template "Detected: {QUANT}"
Then: The system shall produce output "Detected: 5000"

Test TC-RQUANTASQUAL-003: QUANT with Rounding (Viracor Example)

Given: A message template containing {QUANT} placeholder
And: The raw well quantity is 1040
And: Viracor rounding rules are configured (round to nearest 100)
When: The system processes the template "Report {QUANT}"
Then: The system shall produce output "Report 1000"

Test TC-RQUANTASQUAL-004: Multiple Placeholders

Given: A message template containing both {QUANT} and {LOQ} placeholders
And: The well quantity is 500
And: The group LOQ is 100
When: The system processes the template "Result: {QUANT} (LOQ: {LOQ})"
Then: The system shall produce output "Result: 500 (LOQ: 100)"

Test TC-RQUANTASQUAL-005: No Placeholders

Given: A static message template without placeholders
And: The well quantity is 500
When: The system processes the template "Detected"
Then: The system shall produce output "Detected" unchanged

Design DocumentRelevant Sections
SDD AlgorithmsPlaceholder Substitution

Appendix: Process Artifacts

Completion Checklist

  • All requirements are capability-level (describe behavior, not UI)
  • Requirement variants consolidated (no requirement explosion)
  • 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 for I/O, validation, and external system requirements
  • Open questions documented with owners assigned
  • 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

Source Analysis: REQ-RULES-QUANTITIES-001

The source material contained a single well-defined requirement with clear acceptance criteria. No consolidation was necessary as this represents a single cohesive capability.

Original ItemSource ReferenceDisposition
REQ-RULES-QUANTITIES-0013.0.0-Managing quantities (Rows 1, 2, 3)Preserved as REQ-RULES-QUANTITIES-001

Rationale: Single requirement covers the complete placeholder substitution capability. Acceptance criteria from source preserved and enhanced with additional test conditions derived from the SDD test scenarios.

SDD Integration: Test scenarios from the SDD (RQUANTASQUAL-001 through RQUANTASQUAL-005) were incorporated as acceptance tests to ensure comprehensive coverage.

Reversibility: To review original structure, reference:

  • Source: output/pilot/rules/rule-managing-quantities/rule-managing-quantities-restructured.md
  • SDD: output/pilot/rules/rule-managing-quantities/sdd/rule-managing-quantities-design.md
  • Confluence: 3.0.0-Managing quantities