Outcome Determination Rules Design
Document Type: Rule Design (Tier 2) Domain: RULES-OUTCOME Domain Character: Algorithmic Status: Draft Last Updated: 2026-01-25
1. Overview
1.0 Rule Summary
| Property | Value |
|---|---|
| Intent | Determine final well and target outcomes through sigmoid curve validation, combined outcome matching, and control well quality checks. This rule group evaluates PCR amplification patterns, assigns LIMS outcomes, and propagates control failures to patient wells. |
| Inputs | Well observations (readings, classification, CT, role), sigmoid curve direction, combined outcome configurations, control well statuses, mix configurations |
| Outputs | LIMS outcome codes, error codes (well and target level), classification discrepancy flags, QC failure propagation |
| Precedence | After classification rules (WDCLS/WDCT); before RQUAL fallback assignment |
1.1 Purpose
The Outcome Determination Rules evaluate well observation results to assign final outcomes. This rule group encompasses:
- Sigmoid Curve Validation - Validates that curve shape matches classification polarity
- Combined Outcome Matching - Maps observation attributes to configured LIMS outcomes
- Control Well QC - Validates positive/negative control wells and propagates failures
These rules ensure that PCR analysis results are internally consistent and that quality control failures properly invalidate affected patient results.
1.2 Requirements Covered
| REQ ID | Title | Priority |
|---|---|---|
| REQ-RULES-COMBOUTCTRL-001 | Combined Outcome Control Matching | Must |
| REQ-RULES-SWCOMBOUT-001 | Single Well Combined Outcome Assignment | Must |
| REQ-RULES-MWCOMBOUT-001 | Multiple Wells Combined Outcome Assignment | Must |
| REQ-RULES-POSSIGMOID-001 | Positive Well Sigmoid Validation | Must |
| REQ-RULES-POSSIGMOID-002 | Positive Sigmoid Resolution Skip | Must |
| REQ-RULES-POSSIGMOID-003 | Positive Sigmoid Manual Skip | Must |
| REQ-RULES-NEGSIGMOID-001 | Negative Well Sigmoid Validation | Must |
| REQ-RULES-NEGSIGMOID-002 | Negative Sigmoid Resolution Skip | Must |
| REQ-RULES-NEGSIGMOID-003 | Negative Sigmoid Manual Skip | Must |
| REQ-RULES-DSIGMOID-001 | Downward Sigmoid Positive Validation | Must |
| REQ-RULES-DSIGMOID-002 | Downward Sigmoid Negative Validation | Must |
| REQ-RULES-DSIGMOID-003 | Downward Sigmoid Ambiguous Exclusion | Must |
| REQ-RULES-DSIGMOID-004 | Downward Sigmoid Override Exclusion | Must |
| REQ-RULES-DSIGMOID-005 | Classification Discrepancy Flag | Must |
| REQ-RULES-POSSIGMOIDCTRL-001 | Positive Sigmoid Control Validation | Must |
| REQ-RULES-POSSIGMOIDCTRL-002 | Positive Sigmoid Control Display | Should |
| REQ-RULES-NEGSIGMOIDCTRL-001 | Negative Sigmoid Control Validation | Must |
| REQ-RULES-NEGSIGMOIDCTRL-002 | Negative Sigmoid Control Patient Exclusion | Must |
| REQ-RULES-NEGSIGMOIDCTRL-003 | Negative Sigmoid Control Resolution Skip | Must |
| REQ-RULES-NEGSIGMOIDCTRL-004 | Negative Sigmoid Control Manual Skip | Must |
| REQ-RULES-NEGSIGMOIDCTRL-005 | Negative Sigmoid Control Display | Should |
| REQ-RULES-DSIGMOIDCTRL-001 | Sigmoid Control Evaluation | Must |
| REQ-RULES-DSIGMOIDCTRL-002 | Sigmoid Control Error Reporting | Should |
| REQ-RULES-WDCLSINVSIG-001 | WDCLS Invert Sigmoid Skip | Must |
| REQ-RULES-WDCLSINVSIG-002 | WDCLS Invert CT Threshold Skip | Must |
| REQ-RULES-WDCLSINVSIG-003 | WDCLS Invert Fluorescence Skip | Must |
| REQ-RULES-WDCLSCINVSIG-001 | WDCLSC Invert Sigmoid Skip | Must |
| REQ-RULES-WDCLSCINVSIG-002 | WDCLSC Invert CT Threshold Skip | Must |
| REQ-RULES-WDCLSCINVSIG-003 | WDCLSC Invert Fluorescence Skip | Must |
| REQ-RULES-CONTROLFAIL-001 | Control Failure Patient Marking | Must |
| REQ-RULES-CONTROLFAIL-002 | Unknown Mix Exclusion | Must |
| REQ-RULES-NEC-001 | Negative Control Validation | Must |
| REQ-RULES-BPEC-001 | Positive Control Validation | Must |
| REQ-RULES-CC-001 | Curve Control CT Bounds | Must |
| REQ-RULES-CC-002 | Curve Control Missing Config | Must |
1.3 Constraints
Tier 2 Constraint: This document describes design patterns and decision logic. It links to reference docs for configuration schemas.
1.4 Rule Categories
| Category | Rules | Purpose |
|---|---|---|
| Sigmoid Validation | POSITIVE_SIGMOID, NEGATIVE_SIGMOID, SIGMOID, SIGMOID_CONTROL | Validate curve shape vs classification |
| Sigmoid Control | POSITIVE_SIGMOID_CONTROL, NEGATIVE_SIGMOID_CONTROL | Sigmoid validation for control wells only |
| Invert Sigmoid | WDCLS_INVERT_SIGMOID_POS, WDCLSC_INVERT_SIGMOID_POS | Skip discrepancy when sigmoid pattern explains difference |
| Combined Outcomes | COMBINED_OUTCOME_CONTROL, SINGLE_WELL_COMBINED_OUTCOME, MULTIPLE_WELLS_COMBINED_OUTCOME | Map observations to LIMS outcomes |
| Control QC | BNC (NEC), BPEC, BCC, CONTROL_FAIL | Validate control wells and propagate failures |
1.5 Dependencies
2. Component Architecture
2.1 Component Diagram
2.2 Component Responsibilities
| Component | File | Responsibility | REQ Trace |
|---|---|---|---|
PositiveSigmoidRule | Analyzer/Rules/PositiveSigmoidRule.php | Validate positive wells have upward sigmoid | REQ-POSSIGMOID-* |
NegativeSigmoidRule | Analyzer/Rules/NegativeSigmoidRule.php | Validate negative wells have downward sigmoid | REQ-NEGSIGMOID-* |
SigmoidControlRule | Analyzer/Rules/SigmoidControlRule.php | Sigmoid validation with classification problem support | REQ-DSIGMOIDCTRL-* |
SigmoidIdentifier | Support/SigmoidIdentifier.php | Determine sigmoid direction from readings | All sigmoid rules |
WdclsInvertSigmoidPosRule | Analyzer/Rules/WdclsInvertSigmoidPosRule.php | Skip CLS discrepancy for valid invert patterns | REQ-WDCLSINVSIG-* |
WdclscInvertSigmoidPosRule | Analyzer/Rules/WdclscInvertSigmoidPosRule.php | Skip CLS discrepancy for control wells | REQ-WDCLSCINVSIG-* |
CombinedOutcomeControlRule | Analyzer/Rules/CombinedOutcomeControlRule.php | Match outcomes with role verification | REQ-COMBOUTCTRL-001 |
SingleWellCombinedOutcomeRule | Analyzer/Rules/SingleWellCombinedOutcomeRule.php | Assign outcomes for single-mix configurations | REQ-SWCOMBOUT-001 |
MultipleWellsCombinedOutcomeRule | Analyzer/Rules/MultipleWellsCombinedOutcomeRule.php | Cross-well patient matching | REQ-MWCOMBOUT-001 |
BncRule | Analyzer/Rules/BncRule.php | Validate negative controls are negative | REQ-NEC-001 |
BpecRule | Analyzer/Rules/BpecRule.php | Validate positive controls are positive | REQ-BPEC-001 |
BccRule | Analyzer/Rules/BccRule.php | Validate CT within control bounds | REQ-CC-* |
ControlFailRule | Analyzer/Rules/ControlFailRule.php | Propagate control failures to patients | REQ-CONTROLFAIL-* |
3. Data Design
3.1 Entities
This rule group reads from well/observation data and writes to well error codes:
| Entity | Owner | Read/Write | Fields Used |
|---|---|---|---|
wells | RUNRPT | Read/Write | type, error_code, lims_outcome, resolution_code, mix_id |
observations | RUNRPT | Read/Write | readings, final_cls, manual_cls, final_ct, problems, error_code |
combined_outcomes | KITCFG | Read | role, type, mix_results, target_results |
control_range_settings | KITCFG | Read | upper_bound, lower_bound, role_to_target_mapping |
3.2 Sigmoid Direction Determination
interface SigmoidResult {
direction: 'upward' | 'downward' | 'not_sigmoid';
middle_index: number;
penultimate_index: number;
middle_value: number;
penultimate_value: number;
}
// For readings array of length n:
// middle_index = floor(n / 2)
// penultimate_index = n - 2
// upward: middle_value < penultimate_value
// downward: middle_value > penultimate_value
// not_sigmoid: middle_value == penultimate_value OR n < 4
3.3 Error Code Registry
| Rule Category | Well Error | Target Error |
|---|---|---|
| Positive Sigmoid | INCORRECT_POSITIVE_SIGMOID | INCORRECT_POSITIVE_SIGMOID_TARGET |
| Negative Sigmoid | INCORRECT_NEGATIVE_SIGMOID | INCORRECT_NEGATIVE_SIGMOID_TARGET |
| Downward Sigmoid | INCORRECT_SIGMOID | - |
| NEC Validation | NEC_FAILURE_WELL | NEC_FAILURE_TARGET |
| BPEC Validation | FAILED_POS_WELL | FAILED_POS_TARGET |
| BCC - High | CONTROL_OUT_OF_RANGE_HIGH_WELL | CONTROL_OUT_OF_RANGE_HIGH_TARGET |
| BCC - Low | CONTROL_OUT_OF_RANGE_LOW_WELL | CONTROL_OUT_OF_RANGE_LOW_TARGET |
| BCC - Config | CC_LIMITS_MISSED | - |
| Control Fail | INHERITED_CONTROL_FAILURE | - |
4. Interface Design
4.1 Rule Interface
All outcome rules implement the standard rule interface:
interface RuleInterface {
public function execute(Well $well, Kit $kit): void;
public function getName(): string;
public function getPrecedence(): int;
}
4.2 Sigmoid Identifier API
class SigmoidIdentifier {
public function identify(array $readings): SigmoidResult;
public function isUpward(array $readings): bool;
public function isDownward(array $readings): bool;
}
5. Behavioral Design
5.1 Sigmoid Validation Algorithm
Algorithm: Validate Sigmoid Curve Direction
Inputs:
- well: Well - The well being evaluated
- observation: Observation - Contains readings and classification
- expected_direction: 'upward' | 'downward' - Expected sigmoid for this classification
Outputs:
- void (modifies well.error_code, target.error_code)
Assumptions:
- Observation has readings array with at least 4 values
- Classification has been determined (final_cls available)
- Resolution codes and manual classifications are accessible
Steps:
1. Check skip conditions:
a. IF observation has manual_cls assigned: RETURN (no error)
b. IF well has matching resolution_code: RETURN (no error)
2. Check classification scope:
a. IF final_cls is null OR final_cls == 'Amb': RETURN (no error)
b. IF final_cls does not match rule target polarity: RETURN (no error)
3. Determine sigmoid direction:
a. IF readings.length < 4: RETURN (insufficient data)
b. middle_index = floor(readings.length / 2)
c. penultimate_index = readings.length - 2
d. IF readings[middle_index] > readings[penultimate_index]: direction = 'downward'
e. ELSE IF readings[middle_index] < readings[penultimate_index]: direction = 'upward'
f. ELSE: RETURN (not a sigmoid)
4. Validate direction:
a. IF direction != expected_direction:
- Set well.error_code = INCORRECT_{polarity}_SIGMOID
- Set target.error_code = INCORRECT_{polarity}_SIGMOID_TARGET
- Set observation.classification_discrepancy_flag = true
Notes:
- POSITIVE_SIGMOID rule expects upward sigmoid for positive classification
- NEGATIVE_SIGMOID rule expects downward sigmoid for negative classification
- Resolution code value matches rule name (e.g., POSITIVE_SIGMOID, NEGATIVE_SIGMOID)
5.1.1 Sigmoid Direction Decision Logic
| Sigmoid Direction | Classification | Error Assigned? |
|---|---|---|
| Upward | Positive | No (valid) |
| Upward | Negative | Yes (INCORRECT_NEGATIVE_SIGMOID) |
| Downward | Positive | Yes (INCORRECT_POSITIVE_SIGMOID) |
| Downward | Negative | No (valid) |
| Not Sigmoid | Any | No (insufficient data) |
| * | Amb/Null | No (excluded) |
Precedence: Skip conditions evaluated first, then classification scope, then sigmoid direction. Default: If sigmoid cannot be determined, no error is assigned. Unreachable: None.
5.1.2 Skip Condition Decision Logic
| Has Manual CLS | Has Resolution Code | Rule Executes? |
|---|---|---|
| Yes | * | No |
| No | Yes (matching) | No |
| No | No/Other | Yes |
Precedence: Manual classification checked before resolution code. Default: Rule executes if no skip condition is met. Unreachable: None.
5.2 Control Sigmoid Validation (Control Wells Only)
Algorithm: Validate Sigmoid for Control Wells
Inputs:
- well: Well - The control well being evaluated
- observation: Observation - Contains readings and classification
Outputs:
- void (modifies well.error_code, target.error_code)
Assumptions:
- Well type is Control (not Patient)
- Same sigmoid determination algorithm applies
Steps:
1. Check well type:
a. IF well.type == 'Patient': RETURN (no error - excluded)
2. Check skip conditions:
a. IF observation has manual_cls assigned: RETURN (no error)
b. IF well has matching resolution_code: RETURN (no error)
3. Determine sigmoid direction (same as §5.1)
4. Validate direction vs classification:
a. POSITIVE_SIGMOID_CONTROL: downward + positive = error
b. NEGATIVE_SIGMOID_CONTROL: upward + negative = error
5. Assign errors if validation fails:
- POSITIVE_SIGMOID_CONTROL: INCORRECT_POSITIVE_SIGMOID, INCORRECT_POSITIVE_SIGMOID_TARGET
- NEGATIVE_SIGMOID_CONTROL: INCORRECT_NEGATIVE_SIGMOID, INCORRECT_NEGATIVE_SIGMOID_TARGET
Notes:
- Patient wells are explicitly excluded from control sigmoid rules
- Error display in Assay Summary grouped by Mix and Target
5.2.1 Control Sigmoid Decision Logic (POSITIVE_SIGMOID_CONTROL)
| Well Type | Sigmoid | Classification | Error? |
|---|---|---|---|
| Patient | * | * | No (excluded) |
| Control | Upward | Positive | No (valid) |
| Control | Upward | Negative | No |
| Control | Downward | Positive | Yes |
| Control | Downward | Negative | No (valid) |
Precedence: Well type checked first; patient wells never produce errors. Default: Control wells with upward sigmoid + positive or downward + negative pass. Unreachable: None.
5.2.2 Control Sigmoid Decision Logic (NEGATIVE_SIGMOID_CONTROL)
| Well Type | Sigmoid | Classification | Error? |
|---|---|---|---|
| Patient | * | * | No (excluded) |
| Control | Upward | Positive | No |
| Control | Upward | Negative | Yes |
| Control | Downward | Positive | No |
| Control | Downward | Negative | No (valid) |
Precedence: Well type checked first. Default: No error for valid patterns. Unreachable: None.
5.3 Invert Sigmoid Skip Logic
Algorithm: Skip CLS Discrepancy for Valid Invert Pattern
Inputs:
- observation: Observation - Contains readings, classification, CT
- target: Target - Contains threshold configurations
- is_control: bool - Whether this is a control well
Outputs:
- bool - Whether to skip the discrepancy error
Assumptions:
- A CLS discrepancy exists (DXAI cls != machine cls)
- Minimum fluorescence check passed
Steps:
1. Check minimum fluorescence:
a. IF max(readings) < minimum_fluorescence_to_positive: SKIP RULE ENTIRELY
2. Determine sigmoid direction
3. Check sigmoid + classification pattern:
a. IF direction == 'downward' AND final_cls == 'negative': SKIP ERROR
b. ELSE: Continue to CT check
4. Check CT threshold:
a. IF max_ct_for_cls_discrepancy is null: APPLY ERROR
b. IF final_ct >= max_ct_for_cls_discrepancy: SKIP ERROR
c. ELSE: APPLY ERROR
Notes:
- Downward sigmoid + negative classification is a valid invert pattern
- This indicates the sample is truly negative despite DXAI/machine disagreement
- CT threshold skip applies to high-cycle results where reliability decreases
5.3.1 Invert Sigmoid Decision Logic
| Min FL Met? | Sigmoid | Classification | CT >= Max? | Result |
|---|---|---|---|---|
| No | * | * | * | Skip rule entirely |
| Yes | Downward | Negative | * | Skip discrepancy error |
| Yes | Downward | Positive | * | Apply discrepancy error |
| Yes | Upward | Negative | * | Apply discrepancy error |
| Yes | Upward | Positive | * | Apply discrepancy error |
| Yes | * | * | Yes (config set) | Skip discrepancy error |
| Yes | * | * | No | Apply discrepancy error |
Precedence: Minimum fluorescence -> Sigmoid pattern -> CT threshold. Default: Apply discrepancy error if no skip condition met. Unreachable: None.
5.4 Combined Outcome Control Matching
Algorithm: Match Combined Outcome with Role Verification
Inputs:
- well: Well - The well being evaluated
- observation: Observation - Contains role, classification, CT, quantity, problems
- combined_outcome: CombinedOutcome - Configuration to match against
Outputs:
- void (modifies well.lims_outcome, well.error_code, target.error_code)
Steps:
1. Role verification (gate):
a. IF combined_outcome.role != observation.role: SKIP (no match)
2. Result matching:
a. IF target_result.result == 'Any': match = true
b. ELSE IF target_result.result == 'Classification/Discrepancy':
match = 'CLASSIFICATION' IN observation.problems
c. ELSE: match = (target_result.result == observation.final_cls)
d. IF NOT match: SKIP
3. Range checks:
a. IF configured AND NOT in_range(final_ct, min_ct, max_ct): SKIP
b. IF configured AND NOT in_range(quantity, min_quant, max_quant): SKIP
4. All targets check:
a. All target_results must be satisfied (AND logic)
b. IF any target fails: SKIP this outcome
5. Apply outcome:
a. IF combined_outcome.type == 'error':
- Set well.error_code = combined_outcome.well_error_code
- Set well.lims_outcome = null
- IF target_error configured: Set run_target.error_code
b. ELSE:
- Set well.lims_outcome = combined_outcome.lims_code
5.4.1 Combined Outcome Result Matching
| Config Result | Observation | CLASSIFICATION Problem | Match? |
|---|---|---|---|
| Any | * | * | Yes |
| Classification/Discrepancy | * | Yes | Yes |
| Classification/Discrepancy | * | No | No |
| "Pos" | Pos | * | Yes |
| "Pos" | Neg | * | No |
| "Neg" | Neg | * | Yes |
| "Neg" | Pos | * | No |
Precedence: Role -> Result -> CT/Qty ranges (all AND logic). Default: No match if any condition fails. Unreachable: None.
5.5 Single vs Multiple Well Combined Outcomes
Algorithm: Route Combined Outcome by Mix Count
Inputs:
- combined_outcome: CombinedOutcome - Configuration with mix_results
- well: Well - The well being evaluated
Outputs:
- bool - Whether outcome was assigned
Steps:
1. Count mix results:
mix_count = combined_outcome.mix_results.length
2. Route by count:
a. IF mix_count == 1: Use SingleWellCombinedOutcomeRule
b. IF mix_count >= 2: Use MultipleWellsCombinedOutcomeRule
Notes:
- Single-mix outcomes apply directly to the well
- Multi-mix outcomes require cross-well patient matching
- Wells not matched by single-mix remain eligible for multi-mix
5.5.1 Mix Count Routing Decision
| Mix Results Count | Rule Applied |
|---|---|
| 1 | SingleWellCombinedOutcomeRule |
| 2+ | MultipleWellsCombinedOutcomeRule |
Precedence: Single-well rules evaluate first; multi-well as fallback. Default: Well remains unassigned if no outcome matches. Unreachable: None (count >= 1 always true if outcome exists).
5.6 Control Well QC Validation
Algorithm: Validate Control Well QC
Inputs:
- well: Well - Control well being validated
- control_type: 'NEC' | 'NEG' | 'PEC' | 'POS' - Control well type
- observation: Observation - Contains classification and CT
Outputs:
- void (modifies well.error_code, target.error_code)
Steps:
1. NEC/NEG Validation (BNC rule):
a. IF well.type IN ['NEC', 'NEG']:
- IF observation.final_cls == 'positive':
- Set NEC_FAILURE_WELL on well
- Set NEC_FAILURE_TARGET on target
2. PEC Validation (BPEC rule):
a. IF well.type IN ['PEC', 'POS']:
- IF observation.final_cls == 'negative':
- Set FAILED_POS_WELL on well
- Set FAILED_POS_TARGET on target
3. Curve Control Validation (BCC rule):
a. IF control_range_setting not found for role-to-target:
- Set CC_LIMITS_MISSED on well
- RETURN
b. IF observation.final_cls != 'positive':
- Set FAILED_POS_WELL on well
- Set FAILED_POS_TARGET on target
- RETURN
c. IF final_ct > upper_bound:
- Set CONTROL_OUT_OF_RANGE_HIGH_WELL on well
- Set CONTROL_OUT_OF_RANGE_HIGH_TARGET on target
d. IF final_ct < lower_bound:
- Set CONTROL_OUT_OF_RANGE_LOW_WELL on well
- Set CONTROL_OUT_OF_RANGE_LOW_TARGET on target
5.6.1 NEC Validation Decision Logic
| Well Type | Classification | Error? |
|---|---|---|
| NEC | Negative | No |
| NEC | Positive | Yes (NEC_FAILURE) |
| NEG | Negative | No |
| NEG | Positive | Yes (NEC_FAILURE) |
| Other | * | No (not applicable) |
Precedence: Well type checked first. Default: Non-control wells are not evaluated. Unreachable: None.
5.6.2 BCC Validation Decision Logic
| Config Exists? | Classification | CT vs Bounds | Error? |
|---|---|---|---|
| No | * | * | CC_LIMITS_MISSED |
| Yes | Negative | * | FAILED_POS |
| Yes | Positive | > upper | CONTROL_OUT_OF_RANGE_HIGH |
| Yes | Positive | < lower | CONTROL_OUT_OF_RANGE_LOW |
| Yes | Positive | In bounds | No |
Precedence: Config -> Classification -> Upper bound -> Lower bound. Default: Pass if all checks pass. Unreachable: None.
5.7 Control Failure Propagation
Algorithm: Propagate Control Failures to Patient Wells
Inputs:
- run: Run - Contains all wells
- patient_well: Well - Patient well being evaluated
Outputs:
- void (modifies patient_well.error_code)
Assumptions:
- Control wells have been validated by NEC/BPEC/BCC rules
- Well type and mix status are determined
Steps:
1. Get all control wells in run:
control_wells = run.wells.where(type = 'Control')
2. Filter by mix status:
known_mix_controls = control_wells.where(mix != 'unknown')
3. Check for failures:
failed_controls = known_mix_controls.where(has_failure = true)
4. Propagate if failures exist:
IF failed_controls.length > 0:
patient_well.error_code = INHERITED_CONTROL_FAILURE
Notes:
- Only control wells with known mixes count as failures
- Unknown mix wells are excluded to prevent false positives
- A single control failure invalidates all patient wells in the run
5.7.1 Control Failure Propagation Decision Logic
| Any Known-Mix Control Failed? | Patient Well Gets Error? |
|---|---|
| No | No |
| Yes | Yes (INHERITED_CONTROL_FAILURE) |
Precedence: Unknown-mix controls are filtered out before failure check. Default: No error if no known-mix controls have failed. Unreachable: None.
6. Error Handling
| Condition | Detection | Response | Fallback |
|---|---|---|---|
| Insufficient readings | readings.length < 4 | Skip sigmoid validation | No error assigned |
| Missing control range config | role-to-target lookup fails | Set CC_LIMITS_MISSED | Rule does not evaluate bounds |
| Missing classification | final_cls is null | Skip validation rules | Allow downstream rules |
| No matching combined outcome | Empty matches list | Fall through | RQUAL rule handles |
| All controls have unknown mix | known_mix_controls.length == 0 | No failure propagation | Patients unaffected |
7. Configuration
| Setting | Location | Default | Effect | REQ |
|---|---|---|---|---|
| Resolution codes | per-rule | Rule name | Bypass sigmoid validation | POSSIGMOID-002, NEGSIGMOID-002, etc. |
minimum_fluorescence_to_positive | target config | Required | Skip invert sigmoid rule | WDCLSINVSIG-003, WDCLSCINVSIG-003 |
max_ct_for_cls_discrepancy | target config | null | Skip discrepancy at high CT | WDCLSINVSIG-002, WDCLSCINVSIG-002 |
control_range.upper_bound | per-mapping | Required | Max CT for curve control | CC-001 |
control_range.lower_bound | per-mapping | Required | Min CT for curve control | CC-001 |
combined_outcome.role | outcome config | Required | Role verification gate | COMBOUTCTRL-001 |
combined_outcome.type | outcome config | 'outcome' | error vs outcome behavior | COMBOUTCTRL-001 |
8. Implementation Mapping
8.1 Code Locations
| Component | Path |
|---|---|
| Positive Sigmoid | app/Analyzer/Rules/PositiveSigmoidRule.php |
| Negative Sigmoid | app/Analyzer/Rules/NegativeSigmoidRule.php |
| Sigmoid Control | app/Analyzer/Rules/SigmoidControlRule.php |
| Sigmoid Identifier | app/Support/SigmoidIdentifier.php |
| WDCLS Invert Sigmoid | app/Analyzer/Rules/WdclsInvertSigmoidPosRule.php |
| WDCLSC Invert Sigmoid | app/Analyzer/Rules/WdclscInvertSigmoidPosRule.php |
| Combined Outcome Control | app/Analyzer/Rules/CombinedOutcomeControlRule.php |
| Single Well Combined | app/Analyzer/Rules/SingleWellCombinedOutcomeRule.php |
| Multiple Wells Combined | app/Analyzer/Rules/MultipleWellsCombinedOutcomeRule.php |
| Satisfies Combined Outcome | app/Analyzer/Rules/Concerns/CombinedOutcomes/SatisfiesCombinedOutcome.php |
| Set Outcome to Well | app/Analyzer/Rules/Concerns/CombinedOutcomes/SetOutcomeToWell.php |
| Check CLS Discrepancy | app/Analyzer/Rules/Concerns/CombinedOutcomes/CheckCLSDiscrepancy.php |
| Check CT Discrepancy | app/Analyzer/Rules/Concerns/CombinedOutcomes/CheckCTDiscrepancy.php |
| NEC Rule (BNC) | app/Analyzer/Rules/BncRule.php |
| BPEC Rule | app/Analyzer/Rules/BpecRule.php |
| BCC Rule | app/Analyzer/Rules/BccRule.php |
| Control Fail Rule | app/Analyzer/Rules/ControlFailRule.php |
| Set Error to Well | app/Analyzer/Rules/Concerns/SetErrorToWell.php |
8.2 Requirement Traceability
| REQ ID | Design Section | Primary Code |
|---|---|---|
| REQ-RULES-COMBOUTCTRL-001 | §5.4 | CombinedOutcomeControlRule.php |
| REQ-RULES-SWCOMBOUT-001 | §5.5 | SingleWellCombinedOutcomeRule.php |
| REQ-RULES-MWCOMBOUT-001 | §5.5 | MultipleWellsCombinedOutcomeRule.php |
| REQ-RULES-POSSIGMOID-001 | §5.1 | PositiveSigmoidRule.php |
| REQ-RULES-POSSIGMOID-002 | §5.1.2 | PositiveSigmoidRule.php |
| REQ-RULES-POSSIGMOID-003 | §5.1.2 | PositiveSigmoidRule.php |
| REQ-RULES-NEGSIGMOID-001 | §5.1 | NegativeSigmoidRule.php |
| REQ-RULES-NEGSIGMOID-002 | §5.1.2 | NegativeSigmoidRule.php |
| REQ-RULES-NEGSIGMOID-003 | §5.1.2 | NegativeSigmoidRule.php |
| REQ-RULES-DSIGMOID-001 | §5.1 | SigmoidRule.php |
| REQ-RULES-DSIGMOID-002 | §5.1 | SigmoidRule.php, NegativeSigmoidRule.php |
| REQ-RULES-DSIGMOID-003 | §5.1 | SigmoidRule.php |
| REQ-RULES-DSIGMOID-004 | §5.1.2 | SigmoidRule.php |
| REQ-RULES-DSIGMOID-005 | §5.1 | SigmoidRule.php |
| REQ-RULES-POSSIGMOIDCTRL-001 | §5.2 | PositiveSigmoidControlRule.php |
| REQ-RULES-POSSIGMOIDCTRL-002 | §5.2 | PositiveSigmoidControlRule.php |
| REQ-RULES-NEGSIGMOIDCTRL-001 | §5.2.2 | NegativeSigmoidControlRule.php |
| REQ-RULES-NEGSIGMOIDCTRL-002 | §5.2.1 | NegativeSigmoidControlRule.php |
| REQ-RULES-NEGSIGMOIDCTRL-003 | §5.1.2 | NegativeSigmoidControlRule.php |
| REQ-RULES-NEGSIGMOIDCTRL-004 | §5.1.2 | NegativeSigmoidControlRule.php |
| REQ-RULES-NEGSIGMOIDCTRL-005 | §5.2 | NegativeSigmoidControlRule.php |
| REQ-RULES-DSIGMOIDCTRL-001 | §5.2 | SigmoidControlRule.php |
| REQ-RULES-DSIGMOIDCTRL-002 | §5.2 | SigmoidControlRule.php |
| REQ-RULES-WDCLSINVSIG-001 | §5.3 | WdclsInvertSigmoidPosRule.php |
| REQ-RULES-WDCLSINVSIG-002 | §5.3.1 | WdclsInvertSigmoidPosRule.php |
| REQ-RULES-WDCLSINVSIG-003 | §5.3.1 | WdclsInvertSigmoidPosRule.php |
| REQ-RULES-WDCLSCINVSIG-001 | §5.3 | WdclscInvertSigmoidPosRule.php |
| REQ-RULES-WDCLSCINVSIG-002 | §5.3.1 | WdclscInvertSigmoidPosRule.php |
| REQ-RULES-WDCLSCINVSIG-003 | §5.3.1 | WdclscInvertSigmoidPosRule.php |
| REQ-RULES-CONTROLFAIL-001 | §5.7 | ControlFailRule.php |
| REQ-RULES-CONTROLFAIL-002 | §5.7.1 | ControlFailRule.php |
| REQ-RULES-NEC-001 | §5.6, §5.6.1 | BncRule.php |
| REQ-RULES-BPEC-001 | §5.6 | BpecRule.php |
| REQ-RULES-CC-001 | §5.6.2 | BccRule.php |
| REQ-RULES-CC-002 | §5.6.2 | BccRule.php |
9. Design Decisions
| Decision | Rationale | Alternatives Considered |
|---|---|---|
| Separate sigmoid rules by polarity | Clearer error attribution, independent testing | Single unified rule (rejected: less precise errors) |
| Control wells excluded from patient sigmoid rules | Different validation requirements for controls | Apply same rules to all (rejected: inappropriate for QC) |
| Invert sigmoid pattern recognized as valid | Downward sigmoid + negative = truly negative sample | Treat all discrepancies as errors (rejected: false positives) |
| Dual-level error codes (well + target) | Traceability at both granularities | Well-only errors (rejected: loses target context) |
| Unknown mix exclusion from control failure | Prevent false positives from unidentifiable configs | Include all controls (rejected: configuration drift issues) |
| CT threshold for discrepancy skip | Late-cycle results less reliable | No threshold (rejected: excessive false errors) |
10. Performance Considerations
| Scenario | Concern | Mitigation |
|---|---|---|
| Large runfiles (>384 wells) | Control failure propagation | Early exit if no failures found |
| Many combined outcomes (>50) | Matching iteration | Role pre-filter, priority grouping |
| Sigmoid calculation | Array operations | Cache sigmoid direction per observation |
| Multi-mix patient matching | Cross-well grouping | Index on accession, batch by patient |
11. Related Documents
| Document | Relevant Sections |
|---|---|
| SRS: rule-combined-outcomes-control.md | Combined outcome control requirements |
| SRS: rule-positive-sigmoid.md | Positive sigmoid requirements |
| SRS: rule-negative-sigmoid.md | Negative sigmoid requirements |
| SRS: rule-downward-sigmoid.md | Downward sigmoid requirements |
| SRS: rule-wdcls-invert-sigmoid.md | WDCLS invert sigmoid requirements |
| SRS: rule-control-fail.md | Control failure requirements |
| SRS: rule-nec.md | NEC validation requirements |
| SRS: rule-bpec.md | BPEC validation requirements |
| SRS: rule-cc.md | Curve control requirements |
| SDS: Combined Outcomes | Detailed combined outcome design |
| SDS: Rules Engine | Framework overview |