STD: Resolution Well Affecting Control Rule (RWAC)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-rwac.md
Rule Name: RWAC
Domain: RULES-RWAC
Overview
This document specifies tests for the Resolution Well Affecting Control (RWAC) rule using decision tables and test vectors. The rule propagates resolution outcomes from control wells to their associated patient wells in the same mix.
Rule Characteristics:
- Pure business logic (no UI)
- Resolution code propagation from control to patient wells
- Fallback control support for backup mix scenarios
- Priority-based resolution selection for multiple controls
- Optional error well outcome modification
Test Method: TM-API (per Test Plan §3.3 - 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 ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|
| REQ-RULES-RWAC-001 | Resolution Application | 8 | 10 | 100% | None |
| REQ-RULES-RWAC-002 | Fallback Control Handling | 5 | 6 | 100% | None |
| REQ-RULES-RWAC-003 | Resolution Priority | 3 | 4 | 100% | None |
| REQ-RULES-RWAC-004 | Error Well Handling | 3 | 4 | 100% | None |
Totals: 4 REQs, 19 Conditions, 24 Test Vectors, 100% Coverage
REQ-RULES-RWAC-001: Resolution Application
| Variable | Type | Valid Values | Description |
|---|
control.resolution_code | string | Resolution code identifier | Resolution assigned to control well |
resolution.affected_lims_statuses | string/array | "All Wells", specific LIMS statuses | Statuses the resolution affects |
resolution.lims_status | string? | LIMS status value, null | Target LIMS status to apply |
patient.lims_status | string? | Current LIMS status, null | Patient well's current LIMS status |
patient.error_code | string? | Error code, null | Patient well's error code |
patient.associated_control | bool | true, false | Whether patient has associated control |
Output Variables
| Variable | Type | Description |
|---|
patient.lims_status | string? | Updated LIMS status (or unchanged) |
applied | bool | Whether resolution was applied |
Decision Table: Status Matching
| TV | affected_lims_statuses | patient.lims_status | resolution.lims_status | result_lims_status | applied | Covers |
|---|
| TV-001-001 | "Lims B" | null | "Lims A" | null | false | AC: Status mismatch - no change |
| TV-001-002 | "Lims B" | "Lims B" | "Lims A" | "Lims A" | true | AC: Status match - apply resolution |
| TV-001-003 | "Lims B" | "Lims C" | "Lims A" | "Lims C" | false | AC: Status mismatch - no change |
Decision Table: Null Resolution Status
| TV | affected_lims_statuses | patient.lims_status | resolution.lims_status | result_lims_status | Covers |
|---|
| TV-001-004 | "Lims B" | "Lims B" | null | null | AC: Null resolution status applied |
Decision Table: All Wells Mode
| TV | affected_lims_statuses | patient.lims_status | patient.error_code | resolution.lims_status | result_lims_status | Covers |
|---|
| TV-001-005 | "All Wells" | "Lims B" | null | "Lims A" | "Lims A" | AC: All Wells overrides any status |
| TV-001-006 | "All Wells" | null | null | "Lims A" | "Lims A" | AC: All Wells includes null status |
| TV-001-007 | "All Wells" | "Lims C" | null | "Lims A" | "Lims A" | AC: All Wells any status match |
| TV-001-008 | "All Wells" | null | "Error B" | "Lims A" | "Lims A" | AC: All Wells with error code |
Decision Table: No Associated Control
| TV | patient.associated_control | control.resolution_code | applied | Covers |
|---|
| TV-001-009 | false | "Resolution A" | false | AC: No associated control - skip |
| TV-001-010 | true | null | false | AC: No resolution code - skip |
REQ-RULES-RWAC-002: Fallback Control Handling
| Variable | Type | Valid Values | Description |
|---|
patient.mix | string | Mix identifier | Patient well's mix assignment |
control_label_mapping.mix | string | Mix identifier | Control's primary mix |
control_label_mapping.backup_mixes | array | List of mix identifiers | Mixes that use this as fallback |
original_mix_control_present | bool | true, false | Whether original mix has control |
fallback_control.resolution | string? | Resolution code, null | Fallback control's resolution |
Output Variables
| Variable | Type | Description |
|---|
fallback_applied | bool | Whether fallback control resolution was used |
patient.outcome | string | Final outcome value |
Decision Table: Fallback Control Application
| TV | patient.mix | backup_mixes | original_mix_control_present | fallback_resolution | fallback_applied | Covers |
|---|
| TV-002-001 | "Mix B" | ["Mix B"] | false | "RESOLUTION A" | true | AC: Backup mix, no original control |
| TV-002-002 | "Mix B" | ["Mix B"] | true | "RESOLUTION A" | false | AC: Original mix control takes precedence |
| TV-002-003 | "Mix C" | ["Mix B"] | false | "RESOLUTION A" | false | AC: Not in backup mixes list |
| TV-002-004 | "Mix B" | [] | false | "RESOLUTION A" | false | AC: No backup mixes configured |
Decision Table: No Associated Controls
| TV | patient.mix | has_primary_control | has_fallback_control | outcome_changed | Covers |
|---|
| TV-002-005 | "Mix B" | false | false | false | AC: No controls - skip RWAC |
| TV-002-006 | "Mix B" | false | true | true | AC: Fallback available - apply |
REQ-RULES-RWAC-003: Resolution Priority
| Variable | Type | Valid Values | Description |
|---|
control.role | string | Role identifier | Control well's role |
role.resolution_priority | int | Positive integer | Priority value (1 = highest) |
control.resolution | string | Resolution code | Resolution assigned to control |
resolved_controls | array | List of resolved controls | Multiple controls for same patient |
Output Variables
| Variable | Type | Description |
|---|
selected_resolution | string | Resolution from highest priority control |
patient.lims_status | string | LIMS status from selected resolution |
Decision Table: Priority Selection
| TV | control_A.priority | control_A.lims | control_B.priority | control_B.lims | selected_lims | Covers |
|---|
| TV-003-001 | 2 | "Lims B" | 1 | "Lims C" | "Lims C" | AC: Lower number = higher priority |
| TV-003-002 | 1 | "Lims B" | 2 | "Lims C" | "Lims B" | AC: Priority 1 wins |
| TV-003-003 | 1 | "Lims B" | 1 | "Lims C" | "Lims B" | AC: Equal priority - first wins |
| TV-003-004 | 3 | "Lims A" | null | null | "Lims A" | AC: Single control - use its resolution |
REQ-RULES-RWAC-004: Error Well Handling
| Variable | Type | Valid Values | Description |
|---|
patient.outcome | string | Outcome value including errors | Patient well's current outcome |
resolution.affected_outcomes | array | List of outcome values | Outcomes the resolution can modify |
resolution.outcome | string | Target outcome value | Outcome to set on matching wells |
Output Variables
| Variable | Type | Description |
|---|
patient.outcome | string | Updated outcome value |
applied | bool | Whether resolution was applied |
Decision Table: Error Outcome Replacement
| TV | patient.outcome | affected_outcomes | resolution.outcome | result_outcome | applied | Covers |
|---|
| TV-004-001 | "Error A" | ["Error A"] | "Outcome B" | "Outcome B" | true | AC: Error in affected list - replace |
| TV-004-002 | "Error A" | ["Error B"] | "Outcome B" | "Error A" | false | AC: Error not in affected list - no change |
| TV-004-003 | "Error A" | [] | "Outcome B" | "Error A" | false | AC: Empty affected list - no change |
| TV-004-004 | "Outcome A" | ["Error A", "Outcome A"] | "Outcome B" | "Outcome B" | true | AC: Non-error in affected list - replace |
Automation Status
| REQ ID | Test Vectors | Automation Status | Notes |
|---|
| REQ-RULES-RWAC-001 | TV-001-001 to TV-001-010 | Automated | Core resolution matching |
| REQ-RULES-RWAC-002 | TV-002-001 to TV-002-006 | Automated | Fallback control logic |
| REQ-RULES-RWAC-003 | TV-003-001 to TV-003-004 | Automated | Priority resolution |
| REQ-RULES-RWAC-004 | TV-004-001 to TV-004-004 | Automated | Error well outcomes |
Traceability to Existing Tests
| Requirement | Jira Tests | Config | Status |
|---|
| REQ-RULES-RWAC-001 | BT-5687, BT-5706, BT-5707 | v3/v30/v31 | Existing |
| REQ-RULES-RWAC-001 | BT-5300, BT-5013 | v2 | Existing |
| REQ-RULES-RWAC-002 | BT-5770, BT-5771, BT-5250 | v3/v30/v31 | Existing |
| REQ-RULES-RWAC-002 | BT-5346 | v2 | Existing |
| REQ-RULES-RWAC-003 | BT-5262 | Custom | Existing |
| REQ-RULES-RWAC-004 | BT-5266 | Custom | Existing |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| - | - | No gaps identified | - | - |
All requirements are covered by existing Behat tests. Test vectors align with documented acceptance criteria and existing test scenarios from the SRS. Note: Original references (BT-674, BT-3300, BT-4461, BT-4900) were epics/stories; replaced with actual test IDs.
Coverage Verification
| Requirement | AC Count | TV Count | Mapping |
|---|
| REQ-RULES-RWAC-001 | 5 | 10 | Status Match (2), All Wells (4), Null Status (1), No Control (3) |
| REQ-RULES-RWAC-002 | 4 | 6 | Fallback Application (4), No Controls (2) |
| REQ-RULES-RWAC-003 | 2 | 4 | Priority Selection (4) |
| REQ-RULES-RWAC-004 | 2 | 4 | Error Outcome Replacement (4) |