Skip to main content
Version: 3.0.1

Specialized Rules Design

Document Type: Rule Design (Tier 2) Domain: RULES-SPECIALIZED Domain Character: Algorithmic SRS References: Multiple specialized rules (see Requirements Covered) Status: Draft Last Updated: 2026-01-25


1. Overview

1.0 Rule Summary

PropertyValue
IntentImplement specialized analytical rules including well-type checks, cross-contamination detection, resolution propagation, repeat sample validation, missing mix handling, inconclusive detection, and standard curve quantification.
InputsWell observations, kit configuration, resolution codes, historical wells, quantification settings
OutputsError codes, LIMS statuses, calculated quantities, resolution propagation
PrecedenceVaries by rule - see individual rule precedence in table below

1.1 Purpose

This document describes the design of specialized analytics rules that handle specific well-type scenarios, cross-contamination detection, resolution workflows, and quantification. These rules are distinct from the core classification and outcome rules, addressing edge cases and specialized laboratory workflows.

1.2 Rules Covered

Rule IDNameDescriptionPrecedence
WCCross TalkDetect cross-talk in HSV/HTLV assays DEPRECATED-
WTWell TransferPropagate control errors to patient wellsAfter control failure detection
WCAFMultiple Control FailuresDetect 2+ control failures in runRun-level QC
RWACResolution Well Affecting ControlApply resolution outcomes to patient wellsAfter control resolution
ADJAdjacent CTDetect cross-contamination between adjacent wellsStandalone
ADJ_ZIKAAdjacent ZikaZika-specific cross-contamination with historyStandalone
RRESOLUTIONResolution LIMSSet LIMS from resolution codeResolution processing
WREPRepeat SampleValidate repeat sample consistencyStandalone
MISSING_MIXESMissing MixesDetect missing mixes for combined outcomesAfter Multi Mix Combined Check
INCONCLUSIVEInconclusiveFlag inconclusive result patternsPost-analysis
QSSCStandard Curve QuantificationCalculate quantity from CT using stored curveQuantification phase

1.3 Requirements Covered

REQ IDTitlePriority
REQ-RULES-WC-001Detect Cross-Talk in Wells DEPRECATED-
REQ-RULES-WT-001Propagate Control Failure Errors to Patient WellsMust
REQ-RULES-WT-002Clear Patient Well Errors on Control ResolutionMust
REQ-RULES-WT-003Check Fallback Mixes for Control ErrorsMust
REQ-RULES-WCAF-001Detect and Mark Multiple Control FailuresMust
REQ-RULES-WCAF-002Exclude Unknown Mix Wells from Failure CountingMust
REQ-RULES-WCAF-003Clear Error When Failures Reduce Below ThresholdMust
REQ-RULES-RWAC-001Apply Resolution Code LIMS Status to Patient WellsMust
REQ-RULES-RWAC-002Use Fallback Controls When Primary Controls UnavailableMust
REQ-RULES-RWAC-003Apply Highest Priority Resolution When Multiple Controls ResolvedMust
REQ-RULES-RWAC-004Allow Error Wells to Receive Resolution OutcomesMust
REQ-RULES-ADJ-001Detect Cross-Contamination Between Adjacent WellsMust
REQ-RULES-ADJ-002Persist Cross-Contamination Errors After Export and Re-AnalysisMust
REQ-RULES-ADJ-003Allow Resolution of Cross-Contamination ErrorsShould
REQ-RULES-ADJ-004Capture Configuration Changes in Audit LogShould
REQ-RULES-ADJ-005Support Quant-Based Cross-Contamination DetectionShould
REQ-RULES-ADJ-006Flag Wells with Missing ConfigurationMust
REQ-RULES-ADJZIKA-001Apply Adjacent Well Contamination ThresholdsMust
REQ-RULES-ADJZIKA-002Suppress Errors for Repeat Accessions with Low-Positive HistoryMust
REQ-RULES-ADJZIKA-003Use Latest Well Number for Same-Accession HistoryMust
REQ-RULES-RRES-001Set Well LIMS Export from Resolution CodeMust
REQ-RULES-REPEATSAMP-001Validate Repeat Sample ConsistencyMust
REQ-RULES-MIXMISS-001Identify Missing Mixes for Combined Outcome EvaluationMust
REQ-RULES-MIXMISS-002Track and Display Missing Mixes InformationMust
REQ-RULES-MIXMISS-003Indicate Re-analysis Readiness for Missing MixesMust
REQ-RULES-MIXMISS-004Execute Multi Mix Combined Check Before Missing CheckMust
REQ-RULES-INCONCLUSIVE-001Generate Inconclusive Sample ErrorMust
REQ-RULES-QSSC-001Execute QSSC Rule with Resolution Code Status AssignmentMust
REQ-RULES-QSSC-002Calculate Quantity Using Stored Standard Curve SettingsMust
REQ-RULES-QSSC-003Set Error When Quantification Standards Are MissingMust

1.4 Dependencies


2. Component Architecture

2.1 Component Diagram

2.2 Component Responsibilities

ComponentFileResponsibilityREQ Trace
WcRuleAnalyzer/Rules/WcRule.phpCross-talk detection for HSV/HTLV DEPRECATED - file does not existREQ-RULES-WC-001
WtRuleAnalyzer/Rules/WtRule.phpControl error propagationREQ-RULES-WT-*
WcafRuleAnalyzer/Rules/WcafRule.phpMultiple control failure detectionREQ-RULES-WCAF-*
RwacRuleAnalyzer/Rules/RwacRule.phpResolution-to-patient propagationREQ-RULES-RWAC-*
BaseAdjRuleAnalyzer/Rules/BaseAdjRule.phpBase adjacency detection logicREQ-RULES-ADJ-001, -005, -006
AdjRuleAnalyzer/Rules/AdjRule.phpStandard adjacency detectionREQ-RULES-ADJ-*
AdjZikaRuleAnalyzer/Rules/AdjZikaRule.phpZika-specific adjacency with historyREQ-RULES-ADJZIKA-*
RresolutionRuleAnalyzer/Rules/RresolutionRule.phpResolution code LIMS assignmentREQ-RULES-RRES-001
WrepRuleAnalyzer/Rules/WrepRule.phpRepeat sample validationREQ-RULES-REPEATSAMP-001
MissingMixesRuleAnalyzer/Rules/MissingMixesRule.phpMissing mix detectionREQ-RULES-MIXMISS-*
InconclusiveRuleAnalyzer/Rules/InconclusiveRule.phpInconclusive pattern detectionREQ-RULES-INCONCLUSIVE-001
QsscRuleAnalyzer/Rules/QsscRule.phpStandard curve quantificationREQ-RULES-QSSC-*
SetErrorToWellAnalyzer/Rules/Concerns/SetErrorToWell.phpError assignment concernAll error rules
SetLimsStatusToWellAnalyzer/Rules/Concerns/SetLimsStatusToWell.phpLIMS status assignmentRWAC, RRES, QSSC
CalculateQuantityUsingQuantificationSettingsAnalyzer/Rules/Concerns/...Exponential quantity calculationREQ-RULES-QSSC-002

3. Data Design

3.1 Entities

This rule collection operates across multiple entities:

EntityOwnerRead/WriteUsed By
wellsRUNRPTRead/WriteAll rules
observationsRUNRPTRead/WriteADJ, WREP, QSSC
resolution_codesKITCFGReadRWAC, RRES, QSSC
calculated_quantification_settingsKITCFGReadQSSC
adjacentsKITCFGReadADJ, ADJ_ZIKA
combined_outcomesKITCFGReadMISSING_MIXES
previous_patient_wellsRUNRPTReadWREP, ADJ_ZIKA

3.2 Configuration Structure

// Adjacency Configuration
interface AdjacentConfig {
mix_id: string;
target_id: string;
quant_or_ct: 'Ct' | 'Quant';
potential_contaminated: number; // threshold
potential_contaminating: number; // threshold
}

// Resolution Code Configuration
interface ResolutionCode {
code: string;
lims_status: string | null;
sets_lims_export: boolean;
affected_lims_statuses: string[] | 'All Wells';
resolution_priority: number;
error_code: ErrorCode | null;
}

// Quantification Settings
interface QuantificationSetting {
target_id: string;
slope: number;
intercept: number;
}

4. Interface Design

4.1 Rule Interface

All specialized rules implement the standard rule contract:

interface AnalyzerRuleContract {
public function handle(
ConfigurationRepository $config,
AnalyzableObservation $observation,
RunMix $runMix,
RunTarget $runTarget,
AnalyzableWell $well,
WellCollection $wells,
PatientWellCollection $previousPatientWells,
PecWellCollection $previousPecWells,
RunTargetsCollection $runTargets
): void;
}

4.2 Internal APIs

MethodClassPurpose
containsFailedExtractionControlForMixWell()WellCollectionCheck extraction control failure
containsFailedNonExtractionControlForWell()WellCollectionCheck non-extraction control failure
hasMultipleControlWellsWhichHasNonLabelError()WellCollectionWCAF threshold check
adjacentWells()WellCollectionGet adjacent well positions
getMatchingObservationForObservation()PatientWellCollectionHistorical observation lookup

5. Behavioral Design

5.1 WC Rule (Cross Talk) - DEPRECATED

DEPRECATED (2026-02-02): This rule was never implemented. No WcRule.php exists in the codebase. Section retained for historical reference.

Algorithm: Detect Cross-Talk

Inputs:
- well: Well with observations
- assay_type: string (HSV, HTLV, or other)
- extraction_status: 'first' | 're-extraction'

Outputs:
- void (sets RXT LIMS status and warning on well)

Assumptions:
- Target positivity already determined
- Well is patient sample (not control)

Steps:
1. IF assay_type NOT IN ['HSV', 'HTLV']: RETURN (skip)
2. IF well is control sample: RETURN (skip)
3. IF extraction_status == 're-extraction': RETURN (skip)

4. Count positive non-IC targets in well
5. IF count <= 1: RETURN (no cross-talk)

6. Set LIMS = 'RXT'
7. Generate warning: "{target_a} and {target_b} are both positive. Re-extract sample"

Notes:
- IC targets always excluded from count
- Only first-time extractions trigger rule

Cross-Talk Decision Logic

AssaySample TypeExtractionPositive Non-IC TargetsResult
HSV/HTLVPatientFirst0 or 1No action
HSV/HTLVPatientFirst2+RXT + Warning
HSV/HTLVPatientRe-extractAnyNo action
HSV/HTLVControlAnyAnyNo action
OtherAnyAnyAnyNo action

Precedence: During analytics processing phase. Default: No action when conditions not met.


5.2 WT Rule (Well Transfer) - REQ-RULES-WT-*

Algorithm: Propagate Control Errors

Inputs:
- well: Patient well being evaluated
- wells: All wells in run
- config: Kit configuration
- fallback_enabled: boolean

Outputs:
- void (sets error on well)

Steps:
1. IF well has WT resolution code:
a. Apply LIMS status from resolution
b. RETURN

2. IF wells contain failed extraction control for mix:
a. Set INHERITED_EXTRACTION_FAILURE error on well
b. RETURN

3. IF wells contain failed non-extraction control for well:
a. Set INHERITED_CONTROL_FAILURE error on well
b. RETURN

4. IF fallback_enabled AND no primary control present:
a. Check backup mix controls
b. IF backup control has failure: Set INHERITED_CONTROL_FAILURE

Notes:
- Error message distinguishes extraction vs non-extraction control type
- Errors block export until resolved
- Resolution clears WT errors automatically

WT Error Propagation Decision Logic

Control TypeControl StatusPatient Well Action
ExtractionFailedINHERITED_EXTRACTION_FAILURE
Non-ExtractionFailedINHERITED_CONTROL_FAILURE
AnyPassedNo action
Fallback (enabled)FailedINHERITED_CONTROL_FAILURE
Fallback (disabled)FailedNo action

Precedence: After all control failure detection rules. Default: No error if no associated control has failed.


5.3 WCAF Rule (Multiple Control Failures) - REQ-RULES-WCAF-*

Algorithm: Detect Multiple Control Failures

Inputs:
- well: Well being evaluated
- wells: All wells in run
- config: Kit configuration

Outputs:
- void (sets CROSS_CNTRL_FAIL_WELL error on well and mix)

Assumptions:
- Wells with unknown mixes are excluded from count
- WCAF-generated errors are not counted in re-evaluation

Steps:
1. IF well is crossover: RETURN (skip)

2. IF well has WCAF resolution code:
a. Apply LIMS status from resolution
b. RETURN

3. IF well is control well:
a. Count control wells with non-label errors (excluding unknown mix)
b. IF count >= 2:
- Set CROSS_CNTRL_FAIL_WELL error on well
- Set CROSS_CNTRL_FAIL_MIX error on mix

Notes:
- Threshold is 2+ failures (not 1)
- Unknown mix wells excluded to prevent configuration issues from triggering
- When errors resolved below threshold, WCAF errors auto-clear

WCAF Threshold Decision Logic

Known Mix FailuresUnknown Mix FailuresTotalResult
0Any0No WCAF
1Any1No WCAF
202WCAF error
212WCAF error
111No WCAF (unknown excluded)

Precedence: Run-level QC rule. Default: No error if fewer than 2 countable failures.


5.4 RWAC Rule (Resolution Well Affecting Control) - REQ-RULES-RWAC-*

Algorithm: Apply Resolution to Patient Wells

Inputs:
- well: Patient well
- wells: All wells in run
- config: Kit configuration (resolution codes, fallback settings)

Outputs:
- void (sets LIMS status on well)

Steps:
1. IF well has RWAC resolution code:
a. Apply LIMS status from resolution
b. RETURN

2. Get associated resolved control wells:
a. First check original mix controls
b. IF fallback enabled AND no original control: check backup mix

3. IF no resolved control found: RETURN

4. IF multiple resolved controls:
a. Sort by resolution_priority ascending (lower = higher priority)
b. Select first (highest priority)

5. Get resolution code from selected control
6. Check affected_lims_statuses:
a. IF 'All Wells': apply to patient well
b. ELSE IF patient LIMS status in affected list: apply
c. ELSE: no change

7. Set well LIMS status to resolution's lims_status

Notes:
- Fallback controls only used when primary absent
- Priority 1 beats priority 2
- Error wells can receive outcomes if error in affected list

RWAC Status Application Decision Logic

affected_lims_statusesPatient Current StatusResult
"All Wells"AnyApply resolution LIMS
["NEG", "POS"]"NEG"Apply resolution LIMS
["NEG", "POS"]"IND"No change
nullAnyNo change

Precedence: After control well resolution assignment. Default: No change if no matching resolution or affected status.


5.5 ADJ Rule (Adjacent CT) - REQ-RULES-ADJ-*

Algorithm: Detect Adjacent Well Cross-Contamination

Inputs:
- observation: Current observation with CT/Quant
- well: Well being evaluated
- wells: All wells in run
- adjacent_config: Contamination thresholds

Outputs:
- void (sets ADJ_CT or ADJ_LIMITS_MISSED error)

Assumptions:
- Wells arranged in standard plate grid
- Only positive, non-IC targets evaluated

Steps:
1. IF well has ADJ resolution code: RETURN

2. IF observation has negative CLS: RETURN (skip negatives)

3. IF adjacent_config is null:
a. Set ADJ_LIMITS_MISSED error
b. RETURN

4. IF observation CT/Quant is null or equals readings count: RETURN

5. Check if observation meets "potentially contaminated" threshold:
- CT mode: observation.ct > potential_contaminated_ct
- Quant mode: observation.quant < potential_contaminated_quant
IF NOT met: RETURN

6. Get adjacent well observations for same target

7. IF any adjacent missing config:
a. Set ADJ_LIMITS_MISSED error
b. RETURN

8. Check if any adjacent meets "potentially contaminating" threshold:
- CT mode: adjacent.ct < potential_contaminating_ct
- Quant mode: adjacent.quant > potential_contaminating_quant
IF met: Set ADJ_CT error

Notes:
- Errors persist through export and re-analysis
- Resolution available via Manage Outcomes
- Config changes logged to audit trail

ADJ Detection Logic (CT Mode)

Current Well CTAdjacent Well CTContaminated ThresholdContaminating ThresholdResult
35183025ADJ_CT (35 > 30 AND 18 < 25)
28183025No error (28 < 30)
35283025No error (28 > 25)
nullAnyAnyAnyNo error (skip)

Precedence: Standalone detection rule. Default: No error if thresholds not exceeded.


5.6 ADJ_ZIKA Rule - REQ-RULES-ADJZIKA-*

Algorithm: Zika-Specific Adjacent Contamination with History

Inputs:
- observation: Current observation
- well: Well being evaluated
- wells: All wells in run
- previousPatientWells: Historical patient wells

Outputs:
- void (sets ZIKA_ADJ_CT or ZIKA_ADJ_LIMITS_MISSED error)

Steps:
1. Find historical well for same accession and mix:
a. Filter by accession match
b. Filter by mix match
c. Sort by well number descending
d. Take first (latest well position)

2. IF no historical well:
a. Execute standard ADJ rule with ZIKA error codes
b. RETURN

3. Get matching observation from historical well

4. IF no matching observation:
a. Execute standard ADJ rule
b. RETURN

5. IF observation has no adjacent config: RETURN

6. Check if historical observation has "low-positive" quantity:
- Low-positive = quantity > 0 AND quantity <= potential_contaminated
IF historical is low-positive: RETURN (suppress error)

7. Execute standard ADJ rule with ZIKA error codes

Notes:
- Historical suppression prevents false positives on repeat samples
- Latest well number used when multiple wells share accession on same run
- Uses Quant mode (not CT)

ADJ_ZIKA Suppression Logic

Historical QtyContaminated ThresholdCurrent ScenarioResult
50200Would trigger ADJSuppressed (50 in 1-200 range)
300200Would trigger ADJZIKA_ADJ_CT (300 > 200)
nullAnyWould trigger ADJZIKA_ADJ_CT (no history)
AnyAnyDoesn't triggerNo error

Precedence: Standalone detection rule. Default: Falls through to standard ADJ logic.


5.7 RRESOLUTION Rule - REQ-RULES-RRES-001

Algorithm: Resolution Code LIMS Assignment

Inputs:
- well: Well with potential resolution codes
- config: Resolution code configurations

Outputs:
- void (sets LIMS status on well)

Steps:
1. IF well has no resolution codes OR has RRESOLUTION code:
a. Apply LIMS status from resolution codes
b. RETURN

2. FOR each resolution code on well:
a. Get resolution configuration from kit
b. IF not found: CONTINUE

c. Get LIMS status:
- IF resolution has error_code: use error_code.lims_status
- ELSE: use resolution.lims_status

d. IF LIMS status exists:
- Set well LIMS status
- BREAK (first match wins)

Notes:
- First matching resolution code with LIMS status wins
- Supports both direct lims_status and error_code.lims_status paths

Precedence: Resolution processing phase. Default: No modification if no resolution or no LIMS configuration.


5.8 WREP Rule (Repeat Sample) - REQ-RULES-REPEATSAMP-001

Algorithm: Validate Repeat Sample Consistency

Inputs:
- observation: Current observation
- well: Patient well
- previousPatientWells: Historical wells for comparison

Outputs:
- void (sets RQ_CLS or RQ_LOG error)

Steps:
1. IF well is not patient well: RETURN

2. IF well has WREP resolution code:
a. Apply LIMS status from resolution
b. RETURN

3. Get matching historical observation:
- Same accession, same mix, same target

4. IF no matching observation: RETURN (first-time sample)

5. IF classifications differ:
a. Set RQ_CLS error
b. RETURN

6. IF current classification is negative: RETURN (pass)

7. Calculate Log10 quantity difference:
diff = ABS(LOG10(current.quantity) - LOG10(previous.quantity))

8. IF diff > 0.5:
a. Set RQ_LOG error

Notes:
- Uses most recent previous sample when multiple exist
- Threshold 0.5 applies to Log10 values (approximately 3x difference)
- Only positive samples checked for quantitative consistency

WREP Decision Logic

Previous CLSCurrent CLSLog10 DiffResult
nullAnyN/APass (first-time)
PositiveNegativeN/ARQ_CLS error
NegativePositiveN/ARQ_CLS error
NegativeNegativeN/APass
PositivePositive0.3Pass
PositivePositive0.7RQ_LOG error

Precedence: Standalone validation rule. Default: Pass if first-time or consistent.


5.9 MISSING_MIXES Rule - REQ-RULES-MIXMISS-*

Algorithm: Detect Missing Mixes for Combined Outcomes

Inputs:
- well: Patient well
- wells: All wells in run
- config: Combined outcome mappings
- recentlyUploadedWells: Wells from other recent runs

Outputs:
- void (sets COMBINED_MIXES_WELLS_MISSING error)

Assumptions:
- Multi Mix Combined Check executes before this rule
- mixes_missing toggle controls rule activation

Steps:
1. IF well has no mix OR not patient well: RETURN

2. Get combined outcome mappings with mixes_missing=true

3. FOR each mapping:
a. Get required mixes from mapping

b. FOR each required mix:
- Check if successful well exists for mix
- "Successful" = no error, or has mixes_missing error, or has info-typed LIMS
- IF allow_other_runs_to_be_used:
- Also check recently uploaded wells with mixes_missing error

c. IF any mix missing:
- Set COMBINED_MIXES_WELLS_MISSING error
- Store list of missing mix names
- Populate outcome message with missing mixes

4. On new run import with missing mix now available:
- Update old run status to "Reanalysis required (Missing mixes uploaded)"
- Only if all previously missing mixes now available
- Only if no existing resolution status

Notes:
- Wells with mixes_missing error are considered "successful" for mix availability
- Cross-run resolution requires wells with mixes_missing error (not just any well)

Successful Well Definition

Well StateSuccessful?
No errorsYes
COMBINED_MIXES_WELLS_MISSING errorYes
Information-typed LIMSYes
Label ErrorNo
Warning ErrorNo
Warning/Exclude LIMSNo

Precedence: After Multi Mix Combined Check. Default: No error if all mixes present.


5.10 INCONCLUSIVE Rule - REQ-RULES-INCONCLUSIVE-001

Algorithm: Detect Inconclusive Result Pattern

Inputs:
- well: Well with observations
- config: Kit configuration (error codes)

Outputs:
- void (sets INCONCLUSIVE_WELL error)

Steps:
1. IF well has INCONCLUSIVE resolution code:
a. Set LIMS status to 'INCONCLUSIVE'
b. RETURN

2. Get non-IC, active target observations

3. Check if:
- At least one observation has Negative final CLS
- At least one observation has Positive final CLS

4. IF both conditions met:
a. Set INCONCLUSIVE_WELL error
b. Flag for bulk management visibility

Notes:
- Passive targets excluded from evaluation
- IC targets excluded from evaluation
- Enables bulk processing of inconclusive samples

INCONCLUSIVE Pattern Detection

Non-IC Target 1Non-IC Target 2Result
PositivePositiveNo error
NegativeNegativeNo error
PositiveNegativeINCONCLUSIVE_WELL
NegativePositiveINCONCLUSIVE_WELL

Precedence: Post-analysis (after classification). Default: No error if pattern not detected.


5.11 QSSC Rule (Standard Curve Quantification) - REQ-RULES-QSSC-*

Algorithm: Calculate Quantity from Standard Curve

Inputs:
- observation: Observation with CT value
- well: Well (for quantity multiplier)
- config: Quantification settings, resolution codes

Outputs:
- void (sets quantity on observation, or error, or LIMS status)

Steps:
1. IF well has QSSC resolution code:
a. Apply LIMS status from resolution code config
b. RETURN (bypass calculation)

2. Get quantification settings for observation's target:
- slope, intercept

3. IF settings missing OR no slope/intercept:
a. Set QUANT_STANDARDS_MISSING error
b. RETURN

4. Calculate quantity:
quantity = multiplier * pow(10, ((ct - intercept) / slope))

5. Set observation quantity

Notes:
- Uses accurate CT (not rounded)
- Multiplier is well-level scaling factor
- Exponential formula is authoritative (base-10 logarithmic)

QSSC Calculation Examples

CTSlopeInterceptMultiplierQuantity
28.1235-130175.248873017358
28.12345678-130175.256361986851
360.1230.234100466 (approx)
40-13010.0000000001

Precedence: Quantification phase. Default: Error if configuration missing.


6. Error Handling

RuleConditionError CodeResponse
WCCross-talk detectedRXT (LIMS)Block export, generate warning DEPRECATED
WTExtraction control failedINHERITED_EXTRACTION_FAILUREBlock export
WTNon-extraction control failedINHERITED_CONTROL_FAILUREBlock export
WCAF2+ control failuresCROSS_CNTRL_FAIL_WELLMark for replate
ADJCross-contamination detectedADJ_CTFlag for resolution
ADJMissing configurationADJ_LIMITS_MISSEDBlock rule execution
ADJ_ZIKACross-contamination detectedZIKA_ADJ_CTFlag for resolution
ADJ_ZIKAMissing configurationZIKA_ADJ_LIMITS_MISSEDBlock rule execution
WREPClassification mismatchRQ_CLSFlag for review
WREPQuantity threshold exceededRQ_LOGFlag for review
MIXMISSMixes missingCOMBINED_MIXES_WELLS_MISSINGBlock until mixes available
INCONCInconclusive patternINCONCLUSIVE_WELLFlag for bulk management
QSSCMissing settingsQUANT_STANDARDS_MISSINGBlock quantification

7. Configuration

SettingRulePathDefaultEffect
fallback_shared_controlWT, RWACClient configfalseEnable fallback mix checking
resolution_priorityRWACPer rolePer roleLower = higher priority
potential_contaminated_ctADJPer mix/targetRequiredContaminated threshold
potential_contaminating_ctADJPer mix/targetRequiredContaminating threshold
quant_or_ctADJPer mix/targetCtEvaluation mode
mixes_missingMIXMISSPer combined outcomefalseEnable missing mixes check
allow_other_runs_to_be_usedMIXMISSPer combined outcomefalseCross-run resolution
wrep_log_quant_thresholdWREPClient config0.5Log10 difference threshold

See Configuration Reference for full documentation.


8. Implementation Mapping

8.1 Code Locations

ComponentPath
WC Rulecode/app/Analyzer/Rules/WcRule.php DEPRECATED - file does not exist
WT Rulecode/app/Analyzer/Rules/WtRule.php
WCAF Rulecode/app/Analyzer/Rules/WcafRule.php
RWAC Rulecode/app/Analyzer/Rules/RwacRule.php
Base ADJ Rulecode/app/Analyzer/Rules/BaseAdjRule.php
ADJ Rulecode/app/Analyzer/Rules/AdjRule.php
ADJ Zika Rulecode/app/Analyzer/Rules/AdjZikaRule.php
RRESOLUTION Rulecode/app/Analyzer/Rules/RresolutionRule.php
WREP Rulecode/app/Analyzer/Rules/WrepRule.php
Missing Mixes Rulecode/app/Analyzer/Rules/MissingMixesRule.php
Inconclusive Rulecode/app/Analyzer/Rules/InconclusiveRule.php
QSSC Rulecode/app/Analyzer/Rules/QsscRule.php
Error Settercode/app/Analyzer/Rules/Concerns/SetErrorToWell.php
LIMS Settercode/app/Analyzer/Rules/Concerns/SetLimsStatusToWell.php
Quantity Calculatorcode/app/Analyzer/Rules/Concerns/CalculateQuantityUsingQuantificationSettings.php

8.2 Requirement Traceability

REQ IDDesign SectionPrimary Code
REQ-RULES-WC-001Section 5.1WcRule.php DEPRECATED
REQ-RULES-WT-001Section 5.2WtRule.php
REQ-RULES-WT-002Section 5.2WtRule.php
REQ-RULES-WT-003Section 5.2WtRule.php
REQ-RULES-WCAF-001Section 5.3WcafRule.php
REQ-RULES-WCAF-002Section 5.3WcafRule.php
REQ-RULES-WCAF-003Section 5.3WcafRule.php
REQ-RULES-RWAC-001Section 5.4RwacRule.php
REQ-RULES-RWAC-002Section 5.4RwacRule.php
REQ-RULES-RWAC-003Section 5.4RwacRule.php
REQ-RULES-RWAC-004Section 5.4RwacRule.php
REQ-RULES-ADJ-001Section 5.5AdjRule.php, BaseAdjRule.php
REQ-RULES-ADJ-002Section 5.5AdjRule.php
REQ-RULES-ADJ-003Section 5.5AdjRule.php
REQ-RULES-ADJ-004Section 5.5Audit logging
REQ-RULES-ADJ-005Section 5.5BaseAdjRule.php
REQ-RULES-ADJ-006Section 5.5BaseAdjRule.php
REQ-RULES-ADJZIKA-001Section 5.6AdjZikaRule.php
REQ-RULES-ADJZIKA-002Section 5.6AdjZikaRule.php
REQ-RULES-ADJZIKA-003Section 5.6AdjZikaRule.php
REQ-RULES-RRES-001Section 5.7RresolutionRule.php
REQ-RULES-REPEATSAMP-001Section 5.8WrepRule.php
REQ-RULES-MIXMISS-001Section 5.9MissingMixesRule.php
REQ-RULES-MIXMISS-002Section 5.9MissingMixesRule.php
REQ-RULES-MIXMISS-003Section 5.9MissingMixesRule.php
REQ-RULES-MIXMISS-004Section 5.9MissingMixesRule.php
REQ-RULES-INCONCLUSIVE-001Section 5.10InconclusiveRule.php
REQ-RULES-QSSC-001Section 5.11QsscRule.php
REQ-RULES-QSSC-002Section 5.11QsscRule.php, CalculateQuantityUsingQuantificationSettings.php
REQ-RULES-QSSC-003Section 5.11QsscRule.php

9. Design Decisions

DecisionRationaleAlternatives Considered
Inheritance for ADJ rulesShare core logic, specialize error codes/historyDuplicate code (rejected: maintenance burden)
Resolution code bypass patternConsistent manual override mechanismPer-rule bypass logic (rejected: inconsistent)
Threshold-based contaminationConfigurable per assay/targetHardcoded thresholds (rejected: inflexible)
Cross-run for missing mixesSupport multi-run workflowsSingle-run only (rejected: workflow limitation)
Log10 for quantity comparisonIndustry standard for PCRLinear comparison (rejected: inappropriate scale)
Exponential formula for QSSCCorrects earlier linear model errorLinear formula (rejected: mathematically incorrect)

10. Performance Considerations

RuleScenarioConcernMitigation
ADJLarge plates (384 wells)O(n) adjacent lookupsPre-compute adjacency map
WREPMany historical samplesDatabase queriesIndex on accession/mix
MIXMISSCross-run lookupsMultiple run queriesCache recently uploaded wells
RWACMultiple controlsPriority sortingSort once per well

DocumentRelevant Sections
SRS: rule-wc.mdWC requirements DEPRECATED
SRS: rule-wt.mdWT requirements
SRS: rule-wcaf.mdWCAF requirements
SRS: rule-rwac.mdRWAC requirements
SRS: rule-adj.mdADJ requirements
SRS: rule-adj-zika.mdADJ_ZIKA requirements
SRS: rule-rresolution.mdRRESOLUTION requirements
SRS: rule-repeat-sample.mdWREP requirements
SRS: rule-mixes-missing.mdMISSING_MIXES requirements
SRS: rule-managing-inconclusive.mdINCONCLUSIVE requirements
SRS: rule-qssc.mdQSSC requirements
SDS: Rules EngineFramework overview
SDS: Combined OutcomesCombined outcome rules