STD: Negative Control Inhibition Rule (BICQUAL)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-negative-control-inhibition.md
Rule Name: BICQUAL
Domain: RULES-NECINH
Overview
This document specifies tests for the Negative Control Inhibition rule (BICQUAL) using decision tables and test vectors. The rule detects inhibition in Negative Extraction Control (NEC) wells by evaluating Internal Control (IC) amplification results and generates appropriate error codes when inhibition is detected.
Rule Characteristics:
- Pure business logic (no UI)
- Simple threshold evaluation (CT > 35)
- Classification-based fallback (Negative with null CT)
- Dual error output (well-level and run-target-level)
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 | Version |
|---|
| REQ-RULES-NECINH-001 | Detect Inhibition in NEC Wells | 8 | 10 | 100% | None | v3.0.0 |
| REQ-RULES-NECINH-002 | Missing IC Observation Detection | 4 | 5 | 100% | None | @V3_1_0 |
| REQ-RULES-NECINH-003 | IC_MAPPED_BUT_NO_IC_TARGET Error Code Properties | 9 | 9 | 100% | None | @V3_1_0 |
Totals: 3 REQs, 21 Conditions, 24 Test Vectors, 100% Coverage
REQ-RULES-NECINH-001: Detect Inhibition in NEC Wells
| Variable | Type | Valid Values | Description |
|---|
well.type | string | NEC, PEC, Patient, ... | Well control type |
obs.ic_ct | float? | null, numeric (0-50) | IC target CT value |
obs.ic_cls | string | Positive, Negative | IC target final classification |
Output Variables
| Variable | Type | Description |
|---|
well.error_code | string? | BIQUAL_WELL or null |
run_target.error_code | string? | BICQUAL_TARGET or null |
Constants
| Constant | Value | Description |
|---|
IC_CT_THRESHOLD | 35 | CT threshold above which IC amplification is considered inhibited |
Decision Table: Well Type Filter
| TV | well.type | rule_triggered | Covers |
|---|
| TV-001-001 | NEC | true | AC: Rule triggers on NEC wells |
| TV-001-002 | PEC | false | AC: Rule skips non-NEC wells |
| TV-001-003 | Patient | false | AC: Rule skips non-NEC wells |
Decision Table: CT Threshold Evaluation
| TV | obs.ic_ct | obs.ic_cls | well.error_code | run_target.error_code | Covers |
|---|
| TV-001-004 | 25.0 | Positive | null | null | AC: Normal IC (CT << 35) |
| TV-001-005 | 35.0 | Positive | null | null | AC: Boundary (CT = 35 exactly, no error) |
| TV-001-006 | 36.0 | Positive | BIQUAL_WELL | BICQUAL_TARGET | AC: Inhibited (CT > 35) |
| TV-001-007 | 45.0 | Positive | BIQUAL_WELL | BICQUAL_TARGET | AC: Late IC (CT >> 35) |
Decision Table: Negative Classification Handling
| TV | obs.ic_ct | obs.ic_cls | well.error_code | run_target.error_code | Covers |
|---|
| TV-001-008 | null | Negative | BIQUAL_WELL | BICQUAL_TARGET | AC: Negative classification with null CT |
| TV-001-009 | null | Positive | null | null | AC: Null CT with Positive classification (edge case) |
Decision Table: Combined Conditions
| TV | obs.ic_ct | obs.ic_cls | well.error_code | run_target.error_code | Covers |
|---|
| TV-001-010 | 35.0 | Negative | BIQUAL_WELL | BICQUAL_TARGET | AC: Boundary CT with Negative classification |
Boundary Value Analysis
| Boundary | Below | At | Above | Covers |
|---|
| CT = 35 | TV-001-004 (CT=25) | TV-001-005 (CT=35) | TV-001-006 (CT=36) | Threshold behavior |
REQ-RULES-NECINH-002: Missing IC Observation Detection
Version: @V3_1_0 | Jira: BT-6126
| Variable | Type | Valid Values | Description |
|---|
well.ic_mapping | boolean | true, false | Whether the well has an IC control rule mapped (BICQUAL rule assigned) |
well.ic_observation | object? | null, Observation | The IC target observation in the well's observation collection |
well.resolution_codes | string? | null, "BICQUAL", ... | Resolution codes applied to the well |
Output Variables
| Variable | Type | Description |
|---|
well.error_code | string? | IC_MAPPED_BUT_NO_IC_TARGET or null |
inhibition_checks_performed | boolean | Whether standard IC inhibition checks (REQ-RULES-NECINH-001) proceed |
Decision Table: Resolution Code Guard
| TV | well.resolution_codes | well.ic_observation | well.error_code | inhibition_checks_performed | Covers |
|---|
| TV-002-001 | "BICQUAL" | N/A | null (resolution applied) | false | AC: Resolution code bypass skips all checks including missing IC |
Decision Table: IC Observation Presence
| TV | well.ic_mapping | well.ic_observation | well.error_code | inhibition_checks_performed | Covers |
|---|
| TV-002-002 | Yes | null | IC_MAPPED_BUT_NO_IC_TARGET | false | AC: IC mapped but no IC target observation raises error and prevents further analysis |
| TV-002-003 | Yes | Present (CT=25, Pos) | null | true | AC: IC target observation present proceeds to standard inhibition checks |
| TV-002-004 | Yes | Present (CT=36, Pos) | BIQUAL_WELL (from REQ-001) | true | AC: IC target observation present, inhibition detected via standard checks |
Decision Table: Early Exit Behavior
| TV | well.ic_mapping | well.ic_observation | run_target.error_code | Covers |
|---|
| TV-002-005 | Yes | null | null (no run target error) | AC: IC_MAPPED_BUT_NO_IC_TARGET is well-level only, no run target error generated |
REQ-RULES-NECINH-003: IC_MAPPED_BUT_NO_IC_TARGET Error Code Properties
Version: @V3_1_0 | Jira: BT-6126
Error Code Property Verification
| TV | Property | Expected Value | Source | Covers |
|---|
| TV-003-001 | error_code | IC_MAPPED_BUT_NO_IC_TARGET | Migration + Seeder | AC: Error code identifier |
| TV-003-002 | error_message | "IC is mapped but no IC target observation was found." | Migration + Seeder | AC: Error message text |
| TV-003-003 | error_level | Well (1) | Migration + Seeder | AC: Well-level error |
| TV-003-004 | error_type | Error (1) | Migration + Seeder | AC: Error type |
| TV-003-005 | does_prevent_analyse | Yes (1) | Migration + Seeder | AC: Prevents analysis |
| TV-003-006 | is_inhibited | No (0) | Migration + Seeder | AC: Does not indicate inhibition |
| TV-003-007 | causes_missing_mixes | No (0) | Migration + Seeder | AC: Does not cause missing mixes |
Decision Table: Site-Scoped Provisioning
| TV | Site Has Error Code? | Migration Action | Result | Covers |
|---|
| TV-003-008 | No | Insert new record | Error code created for site | AC: Site-scoped provisioning via migration |
| TV-003-009 | Yes | Skip insert | No duplicate record | AC: Idempotent migration (no duplicates) |
Error Code Verification
| TV | Error Type | Expected Code | Prefix Validation | Covers |
|---|
| TV-001-006 | Well Error | BIQUAL_WELL | BIQUAL (single I) | AC: Well error uses BIQUAL prefix |
| TV-001-006 | Run Target Error | BICQUAL_TARGET | BICQUAL (with IC) | AC: Run target error uses BICQUAL prefix |
Traceability to Existing Tests
| Requirement | Jira Tests | Automation Status |
|---|
| REQ-RULES-NECINH-001 | BT-5175 | Automated (2 TVs) |
| REQ-RULES-NECINH-001 | BT-1315, BT-1318, BT-1338, BT-1340, BT-1138, BT-1141, BT-1164, BT-2786 | Manual (8 TVs) |
| REQ-RULES-NECINH-002 | BT-6126 | Pending (@V3_1_0) |
| REQ-RULES-NECINH-003 | BT-6126 | Pending (@V3_1_0) |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| None | - | All test vectors covered; REQ-002/003 automation pending v3.1.0 deployment | - | - |
Coverage Notes
- All acceptance criteria from SRS are covered by test vectors
- Boundary value at CT=35 explicitly tested (TV-001-005)
- Error code prefix validation included
- Both well-level and run-target-level outputs verified
- REQ-RULES-NECINH-002: Missing IC observation early exit verified — confirms no run target error generated (well-level only)
- REQ-RULES-NECINH-003: Error code properties verified against migration and seeder source; site-scoped provisioning idempotency covered