NEC - Negative Control Validation
Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: Validates that negative control wells do not produce positive classifications Domain: RULES-NEC Precedence: After well classification, before final result reporting
Statement
The system shall validate that negative control wells (NEC and NEG types) do not produce positive classification results, failing the validation with an error when a positive classification is detected.
This rule is part of the quality control validation pipeline within the Rules Engine. It detects potential contamination, reagent failure, or other assay problems by ensuring control wells that should never contain target analyte do not report positive results.
Quick Reference
| ID | Core Behavior | Priority | Status |
|---|---|---|---|
| REQ-RULES-NEC-001 | Validates negative control wells have non-positive classifications | HIGH | Draft |
Key Integration Points: Rules Engine, Well Classification System, Audit Logging System
Rule Summary
| Property | Value |
|---|---|
| Name | BNC (also known as "Negative controls are valid") |
| Triggers | When negative control well (NEC or NEG type) is evaluated |
| Output | Pass validation or set error codes NEC_FAILURE_WELL / NEC_FAILURE_TARGET |
Rule Flowchart (Illustrative)
This diagram illustrates the NEC rule decision logic. It does not specify UI layout, styling, or interaction details.
Definitions
| Term | Definition |
|---|---|
| NEC | Negative Extraction Control - a control well type used to verify absence of contamination |
| NEG | Negative Control - a control well type that should not produce positive results |
| Negative Control Well | A well containing no target analyte, used to detect contamination or false positives |
| Classification | The result determination for a well (positive, negative, or other states) |
Assumptions
- Well classification results are available before the NEC rule executes
- Wells have been assigned a well type (NEC, NEG, or other) prior to rule evaluation
- The Rules Engine invokes the NEC rule as part of the quality control validation pipeline
Requirements
Negative Control Validation (REQ-RULES-NEC-001)
FR-NEC-001: Validate Negative Control Well Classification
The system shall validate that negative control wells (NEC and NEG types) do not have a positive classification result, failing the validation with an error when a positive classification is detected.
Acceptance Criteria
Scope and Applicability:
- The NEC rule shall apply only to well types NEC and NEG
- The system shall not apply the NEC rule to non-control well types
- The rule shall execute after classification results are available but before final results are reported
Pass Conditions:
- Given a negative control well (NEC type) with a negative classification, the system shall pass the NEC validation
- Given a negative control well (NEG type) with a negative classification, the system shall pass the NEC validation
Fail Conditions:
- Given a negative control well (NEC type) with a positive classification, the system shall fail the well with an error
- Given a negative control well (NEG type) with a positive classification, the system shall fail the well with an error
Error Code Assignment:
- When validation fails, the system shall raise error code NEC_FAILURE_WELL at the well level
- When validation fails, the system shall raise error code NEC_FAILURE_TARGET at the target level
Error Handling
| Condition | Response |
|---|---|
| Negative control well has positive classification | Fail with NEC_FAILURE_WELL at well level and NEC_FAILURE_TARGET at target level |
Trace: Source: 3.0.0-NEC Rule (Row 1, Objective, Flow Diagram) | Jira: BT-674 (Epic) | Tests: See scenarios
Configuration Options
| Option | Default | Description | Affects |
|---|---|---|---|
| - | - | No configuration options identified | - |
Note: No configuration options identified in source material. This rule has fixed behavior.
UI Notes (Illustrative)
REQ-RULES-NEC-001 UI Specifications
Flow Diagram:
- Flow diagram reference: media/image161.png (shows NEC rule validation flow)
Audit Display:
- When the rule fails, the following information should be available for display:
- Well identifier
- Expected result (negative)
- Actual classification (positive)
- Error codes generated
- Timestamp
Implementation (Illustrative)
| Component | Location |
|---|---|
| Rule Class | Analyzer/Rules/BncRule.php |
| Error Setter | Analyzer/Rules/Concerns/SetErrorToWell.php |
Traceability Matrix
| Requirement | Title | Verification | Implementation | Test Cases | Status |
|---|---|---|---|---|---|
| REQ-RULES-NEC-001 | Validate Negative Control Well Classification | Test | BncRule | See scenarios | Draft |
Notes
- The NEC rule is part of the quality control validation pipeline within the Rules Engine
- Rule ID in implementation: BNC (also known as "Negative controls are valid")
- This rule is essential for detecting contamination or reagent failure in laboratory assays
- The rule should be executed after well classification but before final result reporting
Acceptance Tests
Test: REQ-RULES-NEC-001
Test: Valid NEC well passes validation
Given: A well with type NEC (Negative Extraction Control)
And: The well classification result is negative
When: The NEC rule is executed
Then: The system shall pass the NEC validation
And: No error codes shall be generated
Test: Valid NEG well passes validation
Given: A well with type NEG (Negative Control)
And: The well classification result is negative
When: The NEC rule is executed
Then: The system shall pass the NEC validation
And: No error codes shall be generated
Test: Invalid NEC well fails validation
Given: A well with type NEC (Negative Extraction Control)
And: The well classification result is positive
When: The NEC rule is executed
Then: The system shall fail the well
And: The system shall generate error code NEC_FAILURE_WELL
And: The system shall generate error code NEC_FAILURE_TARGET
Test: Invalid NEG well fails validation
Given: A well with type NEG (Negative Control)
And: The well classification result is positive
When: The NEC rule is executed
Then: The system shall fail the well
And: The system shall generate error code NEC_FAILURE_WELL
And: The system shall generate error code NEC_FAILURE_TARGET
Test: Non-control well is not evaluated
Given: A well with type SAMPLE (non-control well)
And: The well classification result is positive
When: The NEC rule is executed
Then: The system shall not apply the NEC rule
And: No error codes shall be generated for this well by the NEC rule
Related Design Documents
| Design Document | Relevant Sections |
|---|---|
| SDD Algorithms | Rules Engine Pipeline |
Appendix: Process Artifacts
Completion Checklist
- All requirements are capability-level (describe behavior, not UI)
- Requirement variants consolidated (no requirement explosion)
- UI details are fully demoted to Illustrative section
- Configuration options are not encoded as requirements
- Acceptance criteria describe behavior, not UI mechanics
- Every requirement has acceptance criteria and source traceability
- Error handling addressed for I/O, validation, and external system requirements
- Open questions documented with owners assigned
- Consolidations documented in Reviewer Notes with reversibility info
- Module can survive a full UI redesign unchanged
- Refinements folded into acceptance criteria
- Traceability matrix is complete
Reviewer Notes
No Consolidation Required
This domain contains a single requirement (REQ-RULES-NEC-001) that represents a distinct validation capability. No consolidation was performed.
| Original Item | Source Reference | Disposition |
|---|---|---|
| REQ-RULES-NEC-001 | 3.0.0-NEC Rule (Row 1, Objective, Flow Diagram) | Preserved as REQ-RULES-NEC-001 |
Rationale: The source contained one requirement describing the negative control validation capability. The SDD provided additional technical details (error codes, decision matrix) which were incorporated as acceptance criteria (AC-06 through AC-09) to ensure precise analytics validation.
Reversibility: To reference original structure:
- Source:
output/pilot/rules/rule-nec/rule-nec-restructured.md - SDD:
output/pilot/rules/rule-nec/sdd/rule-nec-design.md - Confluence: 3.0.0-NEC Rule