STD: Extraction Controls Rule (MINEXTRACT)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-extraction-controls.md
Rule Name: MINEXTRACT
Domain: RULES-EXTCTRL
Overview
This document specifies tests for the Extraction Controls rule (MINEXTRACT) using decision tables and test vectors. The rule validates that patient sample wells have matching positive and negative extraction controls (PEC/NEC) based on extraction details.
Rule Characteristics:
- Pure business logic (no UI)
- Multi-field matching (mix, extraction date, instrument, batch)
- Fallback mechanism via backup mix
- Role type recognition ("Quantification & PC" as PEC)
- Label error exclusion filtering
Test Method: TM-API (per Test Plan Section 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-EXTCTRL-001 | Core Validation | 12 | 16 | 100% | None |
| REQ-RULES-EXTCTRL-002 | Fallback Disabled | 4 | 4 | 100% | None |
| REQ-RULES-EXTCTRL-003 | Fallback Enabled | 4 | 4 | 100% | None |
| REQ-RULES-EXTCTRL-004 | Role Type Recognition | 4 | 4 | 100% | None |
| REQ-RULES-EXTCTRL-005 | Label Error Exclusion (MINEXTRACT) | 4 | 4 | 100% | None |
| REQ-RULES-EXTCTRL-006 | Label Error Exclusion (MINCONTROL) | 4 | 4 | 100% | None |
Totals: 6 REQs, 32 Conditions, 36 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
well.role_alias | string | Control, Patient | Well role classification |
well.resolution_codes | array | [], [MINEXTRACT], ... | Applied resolution codes |
well.mix | string | mix1, mix2, ... | Well's assigned mix |
well.extraction_date | date | ISO date string | Extraction date |
well.extraction_instrument | string | EI-1, EI-2, ... | Extraction instrument ID |
well.batch_number | string? | null, "12", ... | Batch number (optional) |
control.role_type | string | PC, NC, Quantification & PC | Control well role type |
control.has_extraction | bool | true, false | Control has extraction attribute |
control.error_type | string? | null, Label Error, Non-Label Error | Error type on control well |
config.fallback_shared_control | bool | true, false | Fallback feature enabled |
config.backup_mix | string? | null, mix1, mix2, ... | Backup mix from role-target mappings |
Output Variables
| Variable | Type | Description |
|---|
well.error_code | string? | Error code assigned (null if passes) |
rule_skipped | bool | Whether rule was bypassed |
control_valid | bool | Whether control well is valid for matching |
REQ-RULES-EXTCTRL-001: Core Validation
Decision Table: Skip Conditions
| TV | well.role_alias | well.resolution_codes | rule_skipped | error_code | Covers |
|---|
| TV-001-001 | Control | [] | true | null | AC: Control wells skipped |
| TV-001-002 | Patient | [MINEXTRACT] | true | null | AC: Resolution bypass |
| TV-001-003 | Patient | [] | false | (depends on controls) | AC: Patient wells evaluated |
| TV-001-004 | Patient | [OTHER_CODE] | false | (depends on controls) | AC: Non-MINEXTRACT resolution ignored |
| TV | same_mix | same_date | same_instrument | same_batch | pec_present | nec_present | error_code | Covers |
|---|
| TV-001-005 | true | true | true | true | true | true | null | AC: All details match, both controls present |
| TV-001-006 | false | true | true | true | true | true | EXTRACTION_CONTROLS_MISSING | AC: Mix mismatch |
| TV-001-007 | true | false | true | true | true | true | EXTRACTION_CONTROLS_MISSING | AC: Date mismatch |
| TV-001-008 | true | true | false | true | true | true | EXTRACTION_CONTROLS_MISSING | AC: Instrument mismatch |
| TV-001-009 | true | true | true | false | true | true | EXTRACTION_CONTROLS_MISSING | AC: Batch mismatch |
| TV-001-010 | true | true | true | null | true | true | null | AC: Batch null on both (matches) |
Decision Table: PEC/NEC Presence
| TV | pec_present | nec_present | all_details_match | error_code | Covers |
|---|
| TV-001-011 | true | true | true | null | AC: Both controls present |
| TV-001-012 | true | false | true | EXTRACTION_CONTROLS_MISSING | AC: NEC missing |
| TV-001-013 | false | true | true | EXTRACTION_CONTROLS_MISSING | AC: PEC missing |
| TV-001-014 | false | false | true | EXTRACTION_CONTROLS_MISSING | AC: Both controls missing |
Decision Table: Batch Number Handling
| TV | patient.batch | control.batch | batch_match | Covers |
|---|
| TV-001-015 | "12" | "12" | true | AC: Exact batch match |
| TV-001-016 | "12" | "13" | false | AC: Batch mismatch |
REQ-RULES-EXTCTRL-002: Fallback Disabled
Decision Table: Fallback Disabled Behavior
| TV | primary_controls_found | fallback_enabled | error_code | Covers |
|---|
| TV-002-001 | true | false | null | AC: Primary controls found, fallback irrelevant |
| TV-002-002 | false | false | EXTRACTION_CONTROLS_MISSING | AC: Missing controls, fallback disabled = error |
| TV-002-003 | true | true | null | AC: Primary controls found, fallback enabled (not used) |
| TV-002-004 | false | true | (check backup) | AC: Missing controls, fallback enabled = check backup |
REQ-RULES-EXTCTRL-003: Fallback Enabled
Decision Table: Backup Mix Search
| TV | primary_controls_found | fallback_enabled | backup_controls_found | error_code | Covers |
|---|
| TV-003-001 | false | true | true | null | AC: Backup mix has matching controls |
| TV-003-002 | false | true | false | EXTRACTION_CONTROLS_MISSING | AC: Backup mix also missing controls |
| TV-003-003 | true | true | N/A | null | AC: Primary found, backup not searched |
| TV-003-004 | false | false | N/A | EXTRACTION_CONTROLS_MISSING | AC: Fallback disabled, backup not searched |
REQ-RULES-EXTCTRL-004: Role Type Recognition
Decision Table: Positive Control Role Types
| TV | control.role_type | control.has_extraction | recognized_as_pec | Covers |
|---|
| TV-004-001 | PC | true | true | AC: Standard PC recognized |
| TV-004-002 | Quantification & PC | true | true | AC: Dual-purpose role recognized as PEC |
| TV-004-003 | NC | true | false | AC: NC not recognized as PEC |
| TV-004-004 | Other | true | false | AC: Other roles not PEC |
Decision Table: Full PEC Matching with Role Types
| TV | pec_role_type | nec_present | all_details_match | error_code | Covers |
|---|
| TV-004-005 | PC | true | true | null | AC: Standard PC satisfies PEC requirement |
| TV-004-006 | Quantification & PC | true | true | null | AC: Quantification & PC satisfies PEC requirement |
Decision Table: Control Validity Based on Error Type
| TV | control.error_type | control_valid | Covers |
|---|
| TV-005-001 | null | true | AC: No error, control valid |
| TV-005-002 | Non-Label Error | true | AC: Non-label error, control still valid |
| TV-005-003 | Label Error | false | AC: Label error excludes control |
| TV | pec_error_type | nec_error_type | other_valid_controls | error_code | Covers |
|---|
| TV-005-004 | Label Error | null | none | EXTRACTION_CONTROLS_MISSING | AC: PEC excluded due to label error |
| TV-005-005 | null | Label Error | none | EXTRACTION_CONTROLS_MISSING | AC: NEC excluded due to label error |
| TV-005-006 | Non-Label Error | null | N/A | null | AC: Non-label error PEC still valid |
| TV-005-007 | null | Non-Label Error | N/A | null | AC: Non-label error NEC still valid |
REQ-RULES-EXTCTRL-006: Label Error Exclusion (MINCONTROL)
Decision Table: MINCONTROL Control Validity
| TV | control.error_type | control_valid_for_mincontrol | Covers |
|---|
| TV-006-001 | null | true | AC: No error, control valid |
| TV-006-002 | Non-Label Error | true | AC: Non-label error, control valid |
| TV-006-003 | Label Error | false | AC: Label error excludes control |
Decision Table: MINCONTROL with Label Error Controls
| TV | pc_error_type | nc_error_type | error_code | Covers |
|---|
| TV-006-004 | Label Error | null | MIN_CONTROLS_MISSING | AC: PC excluded due to label error |
| TV-006-005 | null | Label Error | MIN_CONTROLS_MISSING | AC: NC excluded due to label error |
| TV-006-006 | Non-Label Error | null | null | AC: Non-label error PC valid |
| TV-006-007 | null | Non-Label Error | null | AC: Non-label error NC valid |
Test File Locations
| Requirement | Test File | Automation Status |
|---|
| REQ-RULES-EXTCTRL-001 | tests/Unit/Rules/MinextractRuleTest.php | Automated |
| REQ-RULES-EXTCTRL-002 | tests/Unit/Rules/MinextractRuleTest.php | Automated |
| REQ-RULES-EXTCTRL-003 | tests/Unit/Rules/MinextractRuleTest.php | Automated |
| REQ-RULES-EXTCTRL-004 | tests/Unit/Rules/MinextractRuleTest.php | Automated |
| REQ-RULES-EXTCTRL-005 | tests/Unit/Rules/MinextractRuleTest.php | Automated |
| REQ-RULES-EXTCTRL-006 | tests/Unit/Rules/MincontrolRuleTest.php | Automated |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|
| REQ-RULES-EXTCTRL-001 | BT-5250, BT-3917 | Existing |
| REQ-RULES-EXTCTRL-002 | BT-5250, BT-3917 | Existing |
| REQ-RULES-EXTCTRL-003 | BT-5250, BT-3917 | Existing |
| REQ-RULES-EXTCTRL-004 | BT-5250, BT-4382 (manual) | Partial |
| REQ-RULES-EXTCTRL-005 | BT-5250 | Partial |
| REQ-RULES-EXTCTRL-006 | BT-5252 | Partial |
Supplementary Gap-Fill Tests
| TC | Description | Covers |
|---|
| TC-EXTCTRL-005-COMBINED | Both PEC and NEC with label errors excluded causes extraction controls missing | Supplementary: combined TV-005-004 + TV-005-005 |
| TC-EXTCTRL-005-RECOVERY | PEC with label error excluded but second valid PEC still satisfies requirement | Supplementary: PEC fallback recovery path |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| GAP-001 | REQ-RULES-EXTCTRL-001 | Non-MINEXTRACT resolution code handling (TV-001-004), null batch matching (TV-001-010) | Medium | - |
| GAP-002 | REQ-RULES-EXTCTRL-004 | Non-PEC role rejection (TV-004-004) | Low | - |
| GAP-003 | REQ-RULES-EXTCTRL-005 | Label error exclusion for MINEXTRACT (TV-005-003, TV-005-004, TV-005-005) | High | - |
| GAP-004 | REQ-RULES-EXTCTRL-006 | Label error exclusion for MINCONTROL (TV-006-003, TV-006-004, TV-006-005) | High | - |
Notes
- Corrected: Original traceability referenced BT-1216, BT-3883, BT-4376, BT-4719 which do not exist in the test catalogue
- Primary automated coverage via BT-5250 (MINEXTRACT) with config Quest_EZ_PP_v30.xlsx
- BT-5252 (MINCONTROLS) with config Quest_EZ_MINCONTROLS.xlsx covers REQ-006
- Manual tests BT-3917, BT-3918 cover fallback scenarios; BT-4382 covers Quantification & PC role type
- Label error exclusion logic (REQ-005, REQ-006) lacks corresponding automated tests - tests needed