Rule Tags and Automatic Rule Mapping
Version: v3.1.0 Status: Normative (text), Illustrative (diagrams only) Scope: Rule tag management and tag-driven automatic rule mapping for PCR analysis configurations Domain: RULETAGS
Statement
The system shall provide a structured tag system for analysis rules and an automatic rule mapping engine that uses those tags to generate rule-to-role-to-target mappings. In v3.0.0, rule mappings were managed entirely through manual configuration or XLSX import. In v3.1.0, rules are annotated with four categories of tags -- Mix Property Tags, Role Type Tags, Target Type Tags, and Modifier Tags -- that declaratively describe which observations each rule applies to. When tags are changed or a rule is enabled/disabled, the automatic rule mapper regenerates all strict (auto-generated) mappings for the site by running a sequence of tag-specific generators, each producing the Cartesian product of compatible rules, roles, and targets. Custom (user-defined) mappings are preserved alongside auto-generated ones unless they conflict.
This domain is a sub-domain of Kit Configuration (kitcfg.md). The Rule Tags page is accessed via the Config Mode sidebar (configmode.md -- forthcoming). The generated mappings feed the analysis engine and are visible on the Rule Mappings tab in Config Mode.
Behavior Overview (Illustrative)
This diagram illustrates the high-level behavior. It does not specify UI layout, styling, or interaction details.
Definitions
| Term | Definition |
|---|---|
| Mix Property Tag | A tag on a rule that determines which generator processes the rule (e.g., QUANT, QUAL, SYSTEM, THRESHOLD) |
| Role Type Tag | A tag on a rule that determines which roles the rule maps to (e.g., PATIENT, PC, CROSSOVER) |
| Target Type Tag | A tag on a rule that determines which target types the rule maps to (IC_TARGETS, NON_IC_TARGETS, PASSIVE_TARGETS, ROLE_SPECIFIED_TARGETS) |
| Modifier Tag | A tag that controls rule visibility; currently only HIDDEN (hides rule from non-SUPER_ADMIN users) |
| Generator | A component in the automatic rule mapper that produces mappings for rules with a specific Mix Property Tag |
| Strict Mapping | An auto-generated rule mapping created by the mapper; deleted and regenerated on each mapper run |
| Custom Mapping | A user-defined rule mapping that is preserved across mapper runs unless it conflicts with an auto-generated one |
| Cartesian Product | The set of all (rule, role, target) combinations that satisfy compatibility checks for a given generator |
| Global Mapping | A non-target-specific mapping pattern used across the configuration system for entities like control labels, cut-offs, and adjacents |
Functional Requirements
Rule Tags Management (REQ-RULETAGS-001 through REQ-RULETAGS-009)
FR-RULETAGS-001 Rule Tags Page Access
The system shall provide a Rule Tags page accessible from the Config Mode sidebar under "Other Settings" for SUPER_ADMIN users only.
Acceptance Criteria:
- The Rule Tags link shall appear in the "Other Settings" submenu for users with the SUPER_ADMIN role
- The Rule Tags link shall not be visible to users without the SUPER_ADMIN role
- The page shall be accessible at route
/rule-tags?config_mode=true
Trace: Source: 3.1.0-Rule Tags (Row 1) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-002 Rule Tags Table Display
The system shall display a table listing all rules with their current tag assignments on the Rule Tags page.
Acceptance Criteria:
- The page shall display a sticky header with the title "Rule Tags" and an optional Help Data button
- Rules shall be fetched from
GET /api/plain-rulesand tag definitions fromGET /api/rule-tags - Both API calls shall be made on page load
- The table shall list all rules with their current tag assignments across all four tag categories
Trace: Source: 3.1.0-Rule Tags (Row 2) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-003 Rule Tags Table Columns
The system shall display the Rule Tags table with columns for rule name, availability toggle, and four tag category dropdowns.
Acceptance Criteria:
Column Layout:
- Rule (25% width) -- rule title, read-only
- Availability (8% width) -- toggle to enable/disable the rule
- Mix Property Tags (17% width) -- multi-select dropdown
- Role Type Tags (17% width) -- multi-select dropdown
- Target Type Tags (17% width) -- multi-select dropdown
- Modifier Tags (16% width) -- multi-select dropdown
Trace: Source: 3.1.0-Rule Tags (Row 3) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-004 Rule Availability Toggle
The system shall allow SUPER_ADMIN users to enable or disable a rule via the availability toggle.
Acceptance Criteria:
- When a rule is toggled to disabled, all associated RuleMapping records shall be deleted
- When a previously disabled rule is toggled to enabled, the automatic rule mapper shall run to create/update rule mappings based on the rule's tags
- The toggle shall update via
PUT /api/plain-rules/{rule}
Trace: Source: 3.1.0-Rule Tags (Row 4) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-005 Tag Category Multi-Select Dropdowns
The system shall provide multi-select dropdowns for each tag category with predefined tag options.
Acceptance Criteria:
Mix Property Tags (25 options):
- SYSTEM, QUANT, QUAL, COMBINED_OUTCOME, CT_DELTA, CLS_DISCREPANCY, CLS_INVERT_SIGMOID, CT_DISCREPANCY, MIN_FL, MAX_FL, STORED_STANDARD, QUANTIFY_IN_RUN, ADJACENT_WELL, CONTROL_LIMITS, THRESHOLD, QUANT_ROUNDING, MULTI_MIX_KIT, NEG_CONTROL, POS_CONTROL, NEG_IC_CONTROL, CT_INHIBITION_DELTA, LOD_QUANT, LOD_QUAL, EXTRACTION_CONTROLS, AUTO_BASELINE
Role Type Tags (dynamic):
- Values derived from
Role::typesInUppercase()(e.g., PATIENT, PC, QUANTIFICATION, QUANTIFICATION_PC, CROSSOVER, SAMPLE, IC, NEGATIVE)
Target Type Tags (4 options):
- IC_TARGETS -- IC targets only
- NON_IC_TARGETS -- non-IC, non-passive targets
- PASSIVE_TARGETS -- passive targets only
- ROLE_SPECIFIED_TARGETS -- targets mapped via control label affected target mappings
Modifier Tags (1 option):
- HIDDEN -- hides the rule from non-SUPER_ADMIN users
General:
- All dropdowns shall be disabled during API calls to prevent concurrent modifications
Trace: Source: 3.1.0-Rule Tags (Row 5) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-006 Tag Compatibility Validation
The system shall validate tag compatibility and prevent incompatible tag combinations from being saved.
Acceptance Criteria:
- Tags may define a
not_available_withproperty listing incompatible tags - If a user selects an incompatible combination, a modal warning shall be displayed and the selection shall be prevented
- Validation shall be performed before saving to the API
- Compatible tag selections shall be saved without warning
Trace: Source: 3.1.0-Rule Tags (Row 6) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-007 HIDDEN Modifier Tag Visibility
The system shall restrict the HIDDEN modifier tag to SUPER_ADMIN users and filter hidden rules from non-SUPER_ADMIN views.
Acceptance Criteria:
- The HIDDEN tag shall only be visible in the Modifier Tags dropdown for SUPER_ADMIN users
- For non-SUPER_ADMIN users, rules tagged as HIDDEN shall be filtered out at the SQL level
- Rules tagged as HIDDEN shall not be included in results when non-SUPER_ADMIN users query rules in other parts of the application
Trace: Source: 3.1.0-Rule Tags (Row 7) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-008 Tag Changes Trigger Auto Mapper
The system shall trigger the automatic rule mapper when a rule's tags are changed or a rule is enabled/disabled.
Acceptance Criteria:
- When tags are changed on an enabled rule, the automatic rule mapper shall re-run and rule mappings shall be regenerated based on the new tags
- When tags are changed on a disabled rule, the tags shall be stored but no rule mapping regeneration shall occur
- When a disabled rule is re-enabled, the mapper shall run using the rule's current tag configuration
- The update shall be submitted via
PUT /api/plain-rules/{rule}with updated tag arrays andis_enabledstatus
Trace: Source: 3.1.0-Rule Tags (Row 8) | Jira: BT-4820 | Tests: [Pending]
FR-RULETAGS-009 Rule Tags Help Data
The system shall provide a Help Data toggle button on the Rule Tags page when the help_items feature is enabled.
Acceptance Criteria:
- The Help Data button shall be visible only when the
help_itemsfeature flag is enabled - Clicking the button shall toggle the HelpWidget component for the "Rule Tags" page
- When the
help_itemsfeature is disabled, the button shall not be visible
Trace: Source: 3.1.0-Rule Tags (Row 9) | Jira: BT-4820 | Tests: [Pending]
Automatic Rule Mapping Engine (REQ-RULETAGS-010)
FR-RULETAGS-010 Automatic Rule Mapping Engine
The system shall automatically generate rule-to-role-to-target mappings based on rule tags assigned via the Rule Tags page, using a sequence of tag-specific generators that each produce the Cartesian product of compatible rules, roles, and targets.
Acceptance Criteria:
Core Mapper Behavior:
- When a rule's tags are changed or a rule is enabled/disabled, the automatic rule mapper job shall be dispatched
- The mapper shall load all site configuration data (rules, roles, targets, specimens, control labels, etc.) with indexed caching
- 26 generators shall run in sequence, each producing deduplicated mapping records
- Mappings shall be deduplicated using a hash key combining rule, role, target, specimen, and site identifiers
- All existing strict (auto-generated) mappings for the site shall be deleted before new mappings are inserted
- All generated mappings shall be inserted in batches
- Audit records shall be created for new mappings only
- When a rule is disabled, all rule mappings for that rule shall be deleted
- When a disabled rule is re-enabled, the mapper shall regenerate mappings based on its tags
Cartesian Product and Compatibility (all generators):
- Role-Rule compatibility: rule must have the role's type as a Role Type Tag
- Role-Target compatibility for Sample/Crossover roles: always compatible
- Role-Target compatibility for other roles: must have a control label mapping for the role-mix combination
- IC_TARGETS tag: only IC targets included
- NON_IC_TARGETS tag: only non-IC, non-passive targets included
- PASSIVE_TARGETS tag: only passive targets included
- ROLE_SPECIFIED_TARGETS tag: role must have a control label affected target mapping for the target
Patient Rule Generators:
- AC-010-01: QUANT generator -- The system shall create mappings only for targets belonging to quantitative mixes matching the expected quantification method (Stored Curve or In-Run Standards)
- AC-010-02: QUAL generator -- The system shall create mappings only for targets belonging to qualitative mixes
- AC-010-03: THRESHOLD generator -- The system shall create mappings only for targets that have an expected threshold value set
- AC-010-04: CT_DELTA generator -- The system shall create mappings only for targets that have a delta CT combination configured
- AC-010-05: CT_INHIBITION_DELTA generator -- The system shall create mappings only for targets that have a CT inhibition delta value set (not empty)
- AC-010-06: CLS_DISCREPANCY generator -- The system shall create mappings only for targets where
should_check_cls_discrepancyis true AND the target does NOT have an active calibration withis_hide_invert_sigmoidenabled. CLS_DISCREPANCY and CLS_INVERT_SIGMOID are mutually exclusive - AC-010-07: CLS_INVERT_SIGMOID generator -- The system shall create mappings only for targets where
should_check_cls_discrepancyis true AND the target has an active calibration withis_hide_invert_sigmoidenabled. The rule mapper shall also be dispatched when a calibration is activated or when an active calibration is removed. Maps to rules WDCLS_INVERT_SIGMOID_POS (patient wells) and WDCLSC_INVERT_SIGMOID_POS (control wells) - AC-010-08: CT_DISCREPANCY generator -- The system shall create mappings only for targets with CT discrepancy configured
- AC-010-09: MIN_FL generator -- The system shall create mappings only for targets that have a minimum fluorescence value set
- AC-010-10: MAX_FL generator -- The system shall create mappings only for targets that have a maximum fluorescence value set
- AC-010-11: STORED_STANDARD generator -- The system shall create mappings only for targets belonging to mixes that use the Stored Curve quantification method
- AC-010-12: QUANTIFY_IN_RUN generator -- The system shall create mappings only for targets belonging to mixes that use the In-Run Standards quantification method
- AC-010-13: ADJACENT_WELL generator -- The system shall create mappings only for targets that have cross contamination limits configured
- AC-010-14: QUANT_ROUNDING generator -- The system shall create mappings only for targets that have quantity reportings configured
- AC-010-15: AUTO_BASELINE generator -- The system shall create mappings only for targets that have automatic baseline enabled
- AC-010-16: LOD_QUANT generator -- The system shall create mappings only for targets that have quantitative LoD reportings configured (group 1 quant reportings)
- AC-010-17: LOD_QUAL generator -- The system shall create mappings only for targets that have qualitative LoD reportings configured (group 1 qual reportings)
Control Rule Generators:
- AC-010-18: NEG_CONTROL generator -- The system shall create mappings only for targets configured to verify as negative
- AC-010-19: POS_CONTROL generator -- The system shall create mappings only for targets configured to verify as positive
- AC-010-20: NEG_IC_CONTROL generator -- The system shall create mappings only for targets configured to verify that the IC target is positive AND (v3.1.0 change) whose mix has at least one IC target configured. Previously mappings were created regardless of IC target presence
- AC-010-21: CONTROL_LIMITS generator -- The system shall create mappings only when a control range setting exists for the specific role-target pair
- AC-010-22: EXTRACTION_CONTROLS generator -- The system shall create mappings only for targets that have extraction controls configured
System Rule Generators:
- AC-010-23: SYSTEM generator -- The system shall create mappings for all rules tagged SYSTEM across all compatible role-target combinations (standard Cartesian product with compatibility checking)
- AC-010-24: COMBINED_OUTCOME generator -- The system shall create mappings only for targets that have outcome-to-LIMS-status mappings configured
- AC-010-25: MULTI_MIX_KIT generator -- The system shall create mappings only for targets belonging to a mix that is part of a kit with two or more mixes
- AC-010-26: WESTGARD generator -- The system shall create mappings directly from Westgard limit records (does NOT follow the standard generator pattern; reads rule, role, and target directly from each Westgard limit record)
Custom Mapping Preservation:
- AC-010-27: CUSTOM generator -- The system shall preserve user-defined custom rule mappings that do not conflict with auto-generated ones. The CUSTOM generator runs last, after all other generators. Before it runs, duplicate custom mappings that match auto-generated ones are deleted. Remaining non-conflicting custom mappings are included in the final mapping set
Error Handling:
- If a rule has no Mix Property Tags, no generator will process it and no auto-mappings will be created
- If a rule is disabled, the mapper shall delete all its mappings and not attempt to regenerate
- Conflicting custom mappings (same rule-role-target-specimen combination as an auto-generated mapping) shall be deleted and replaced by the auto-generated one
Trace: Source: 3.1.0-Automatic Rule Mappings (Rows 1-30) | Jira: BT-4820, BT-6160 | Tests: [Pending]
Configuration Options
| Option | Default | Description | Affects |
|---|---|---|---|
| help_items | false | Enables the Help Data toggle button on the Rule Tags page | REQ-RULETAGS-009 |
| use_sample_type | false | When enabled, specimen is included in the mapping hash key and generators produce specimen-aware mappings | REQ-RULETAGS-010 |
Assumptions
- Only users with SUPER_ADMIN role can access the Rule Tags page and modify tag assignments
- The automatic rule mapper is dispatched as a background job after tag changes; mappings are not guaranteed to be available synchronously
- All tag definitions (Mix Property Tags, Target Type Tags, Modifier Tags) are system-defined and not user-configurable; Role Type Tags are derived from configured role types
- The site's complete configuration data (rules, roles, targets, specimens, control labels, Westgard limits, etc.) must be loaded for the mapper to produce correct results
- CLS_DISCREPANCY and CLS_INVERT_SIGMOID generators are mutually exclusive per target -- a target receives mappings from one or the other, never both
- The WESTGARD generator does not follow the standard tag-based Cartesian product pattern; it reads mappings directly from Westgard limit records
- Custom mappings are created by users through the Rule Mappings tab in Config Mode (see kitcfg.md)
UI Notes (Illustrative)
FR-RULETAGS-001 through FR-RULETAGS-009 UI Specifications
Rule Tags Page Layout:
- Sticky header with title "Rule Tags" and optional Help Data button
- Table fills the page below the header
- Each row represents one rule with inline dropdowns for tag assignment
- Availability toggle uses BaseToggleButton component
- Tag dropdowns use MultiSelectorDropdown component, disabled during API calls
Tag Dropdown Behavior:
- Mix Property Tags dropdown lists all 25 predefined values
- Role Type Tags dropdown lists values dynamically from
Role::typesInUppercase() - Target Type Tags dropdown lists 4 predefined values
- Modifier Tags dropdown lists HIDDEN (filtered out for non-SUPER_ADMIN users)
- Incompatible tag combinations trigger a modal warning dialog
FR-RULETAGS-010 UI Specifications
The automatic rule mapper operates in the background and has no direct UI. Its results are visible on the Rule Mappings tab in Config Mode, where auto-mapped rules appear in read-only Patient Rules, Control Rules, and System Rules sections, distinct from user-editable Custom Rules.
Implementation (Illustrative)
| Requirement | Components |
|---|---|
| REQ-RULETAGS-001 | RuleTags.vue, ConfigSidebar.vue |
| REQ-RULETAGS-002 | RuleTagsTable.vue, GET /api/plain-rules, GET /api/rule-tags |
| REQ-RULETAGS-003 | RuleTagsTable.vue, MultiSelectorDropdown |
| REQ-RULETAGS-004 | BaseToggleButton, PUT /api/plain-rules/{rule} |
| REQ-RULETAGS-005 | MultiSelectorDropdown, Role::typesInUppercase() |
| REQ-RULETAGS-006 | Tag not_available_with property, modal validation |
| REQ-RULETAGS-007 | SQL-level filtering of HIDDEN rules for non-SUPER_ADMIN users |
| REQ-RULETAGS-008 | PUT /api/plain-rules/{rule}, mapRules() dispatch |
| REQ-RULETAGS-009 | PushIconButton, HelpWidget |
| REQ-RULETAGS-010 | RuleMapper, 26 generator classes, RuleMappingsForSelectedFiltersGenerator, batch insert/delete, audit logging |
Traceability Matrix
| Requirement | Title | Verification | Implementation | Test Cases | Status |
|---|---|---|---|---|---|
| REQ-RULETAGS-001 | Rule Tags Page Access | Test | RuleTags.vue, ConfigSidebar.vue | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-002 | Rule Tags Table Display | Test | RuleTagsTable.vue | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-003 | Rule Tags Table Columns | Test | RuleTagsTable.vue | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-004 | Rule Availability Toggle | Test | BaseToggleButton, PUT /api/plain-rules | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-005 | Tag Category Multi-Select Dropdowns | Test | MultiSelectorDropdown | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-006 | Tag Compatibility Validation | Test | Tag not_available_with validation | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-007 | HIDDEN Modifier Tag Visibility | Test | SQL-level filtering | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-008 | Tag Changes Trigger Auto Mapper | Test | mapRules() dispatch | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-009 | Rule Tags Help Data | Test | HelpWidget | [Pending] | Draft (v3.1.0) |
| REQ-RULETAGS-010 | Automatic Rule Mapping Engine | Test | RuleMapper, 26 generators | [Pending] | Draft (v3.1.0) |
Notes
- The automatic rule mapper replaces the manual-only rule mapping workflow from v3.0.0; manual (custom) mappings remain supported alongside auto-generated mappings
- The CLS_INVERT_SIGMOID generator is triggered not only by tag changes but also by calibration activation and removal events
- The WESTGARD generator is unique among generators in that it reads rule-role-target associations directly from Westgard limit records rather than computing a Cartesian product from tags
- The NEG_IC_CONTROL generator was updated in v3.1.0 to additionally require the target's mix to have at least one IC target; previously, mappings were created regardless
- Tag values are system-defined constants (except Role Type Tags which are dynamic); they are not user-editable and are not stored in the configuration XLSX
Open Questions
| ID | Question | Source | Owner | Date Raised |
|---|---|---|---|---|
| OQ-001 | No open questions at this time (OQ-008 resolved: 22 auto-mapper rules consolidated into 1 REQ with ACs grouped by Patient/Control/System) | 3.1.0-requirements-inventory.md | - | 2026-03-06 |
Acceptance Tests
Test: REQ-RULETAGS-001
Scenario: SUPER_ADMIN can access Rule Tags page
Given user with role SUPER_ADMIN is in Config Mode
When user hovers over "Other Settings" in the config sidebar
Then "Rule Tags" link is visible in the submenu
Scenario: Non-SUPER_ADMIN cannot see Rule Tags link
Given user with role CLIENT_CONFIG is in Config Mode
When user views "Other Settings"
Then "Rule Tags" link is not visible
Test: REQ-RULETAGS-002
Scenario: Rule Tags page displays table of all rules
Given user navigates to the Rule Tags page
When the page is rendered
Then a table is displayed listing all rules with their current tag assignments
Test: REQ-RULETAGS-003
Scenario: Rule Tags table shows correct columns
Given user views the Rule Tags table
When the table is rendered
Then columns for Rule, Availability, Mix Property Tags, Role Type Tags, Target Type Tags, and Modifier Tags are displayed
Test: REQ-RULETAGS-004
Scenario: Disabling a rule deletes all its mappings
Given user toggles a rule's availability to disabled
When the API call completes
Then the rule is disabled and all its rule mapping records are deleted
Scenario: Re-enabling a rule triggers the auto mapper
Given user toggles a previously disabled rule to enabled
When the API call completes
Then the rule is enabled and the automatic rule mapper runs to create appropriate mappings
Test: REQ-RULETAGS-005
Scenario: Tag dropdowns show predefined options
Given user clicks a tag category dropdown on a rule row
When the dropdown opens
Then all available tags for that category are listed and the user can select/deselect multiple tags
Scenario: Tag dropdowns disabled during API calls
Given an API call is in progress
When user views the tag dropdowns
Then all dropdowns are disabled until the call completes
Test: REQ-RULETAGS-006
Scenario: Incompatible tag combination is prevented
Given user selects a tag that is incompatible with an already-selected tag
When the validation runs
Then a modal warning is displayed indicating the incompatible combination and the selection is prevented
Scenario: Compatible tags are saved without warning
Given user selects tags that are all compatible
When the validation runs
Then no warning is shown and the selection is saved
Test: REQ-RULETAGS-007
Scenario: HIDDEN tag visible to SUPER_ADMIN only
Given user with SUPER_ADMIN role views the Modifier Tags dropdown
When the dropdown options are loaded
Then "HIDDEN" tag is available for selection
Scenario: HIDDEN rules filtered for non-SUPER_ADMIN
Given a non-SUPER_ADMIN user views a page listing rules
When rules are fetched
Then rules tagged as HIDDEN are not included in the results
Test: REQ-RULETAGS-008
Scenario: Tag change on enabled rule triggers mapper
Given user changes the Mix Property Tags on an enabled rule
When the update is saved
Then the automatic rule mapper re-runs and rule mappings are regenerated based on the new tags
Scenario: Tag change on disabled rule stores tags only
Given user changes tags on a disabled rule
When the update is saved
Then the tags are stored but no rule mapping regeneration occurs
Test: REQ-RULETAGS-009
Scenario: Help Data button visible when feature enabled
Given the help_items feature is enabled
When user is on the Rule Tags page
Then a "Help Data" button is visible in the header
Scenario: Help Data button hidden when feature disabled
Given the help_items feature is disabled
When user views the Rule Tags page
Then the "Help Data" button is not visible
Test: REQ-RULETAGS-010
Scenario: Tag-based rule categorization drives mapper
Given a rule has Mix Property Tag "QUANT" and Role Type Tag "PATIENT"
When the automatic mapper runs
Then the QUANT generator processes this rule and creates mappings only for Patient roles
Scenario: Target type tags filter mapping targets
Given a rule has Target Type Tag "IC_TARGETS"
When mappings are generated
Then only IC targets are included in the mappings
Scenario: SYSTEM generator maps across all compatible combinations
Given a rule has the SYSTEM tag
When the generator runs
Then mappings are created for every compatible role-target combination
Scenario: QUANT generator restricts to quantitative mixes
Given a rule has the QUANT tag
When the generator runs
Then mappings are created only for targets belonging to quantitative mixes
Scenario: CLS_DISCREPANCY and CLS_INVERT_SIGMOID are mutually exclusive
Given a target has "Check CLS discrepancy" enabled and an active calibration with "Hide invert sigmoid" enabled
When the generator runs
Then CLS_INVERT_SIGMOID mappings are created for that target and CLS_DISCREPANCY mappings are NOT created
Scenario: NEG_IC_CONTROL requires mix to have IC target (v3.1.0)
Given a target is configured to verify IC positivity but its mix has no IC targets
When the generator runs
Then no NEG_IC_CONTROL mappings are created for that target
Scenario: WESTGARD generator reads directly from limit records
Given a Westgard limit is configured for a specific rule, role, and target
When the generator runs
Then a mapping is created for that exact rule-role-target combination from the limit record
Scenario: CUSTOM generator preserves non-conflicting user mappings
Given a user has created a custom rule mapping that does not conflict with any auto-generated mapping
When the rule mapper runs
Then the custom mapping is preserved alongside the auto-generated mappings
Scenario: Conflicting custom mappings are replaced
Given a user has created a custom rule mapping that conflicts with an auto-generated mapping
When the rule mapper runs
Then the custom mapping is deleted and replaced by the auto-generated one
Scenario: Disabled rule has all mappings deleted
Given a rule is disabled
When the update is processed
Then all rule mappings for that rule are deleted
Scenario: Mapper dispatched on calibration activation
Given a user activates a calibration with "Hide invert sigmoid" enabled
When the activation completes
Then the automatic rule mapper is dispatched to regenerate mappings
Appendix: Process Artifacts
Completion Checklist
- Statement section present (1-2 paragraphs)
- Mermaid diagram present and renders without errors
- Diagram marked as (Illustrative)
- No "non-normative" text anywhere
- All REQ-* IDs assigned (10 requirements)
- All ACs preserved with blank lines before bullet lists
- All Trace references present (Source, Jira)
- Error handling documented
- Config options have Affects column
- Tests at end with back-links
- UI Notes marked (Illustrative)
- Implementation marked (Illustrative)
- Appendix has Completion Checklist and Reviewer Notes
Reviewer Notes
Initial Creation (v3.1.0)
This document was created as a new SRS domain file for v3.1.0. It consolidates two related feature areas:
- Rule Tags Management (Section 2.3 of requirements inventory, 9 requirements from Confluence "Rule Tags" table) -- REQ-RULETAGS-001 through REQ-RULETAGS-009
- Automatic Rule Mapping Engine (Section 2.10 of requirements inventory, 30 Confluence rows consolidated per OQ-008 resolution) -- REQ-RULETAGS-010
Consolidation Decision (OQ-008)
The 22 individual auto-mapper rule generators (originally proposed as REQ-KITCFG-087 through REQ-KITCFG-108) plus 8 infrastructure rows were consolidated into a single requirement (REQ-RULETAGS-010) with 27 acceptance criteria grouped by Patient/Control/System/Custom category. The rationale: each generator follows the same pattern (tag match, compatibility check, Cartesian product) and differs only in its eligibility condition. The granularity is preserved at the AC level and will map directly to test vectors, while keeping the requirement count manageable.
Domain Separation
This file was separated from kitcfg.md to address OQ-015 (massive KITCFG expansion). Rule Tags and the auto-mapper form a cohesive sub-domain with its own page, its own API endpoints, and its own background processing pipeline. Cross-references to kitcfg.md (data model, Rule Mappings tab) and configmode.md (Config Mode sidebar) are maintained.
Source Traceability
| Source Section | Source Rows | This Document |
|---|---|---|
| 3.1.0-Rule Tags (Table 3) | Rows 1-9 | REQ-RULETAGS-001 through REQ-RULETAGS-009 |
| 3.1.0-Automatic Rule Mappings (Table 10) | Rows 1-30 | REQ-RULETAGS-010 (27 ACs) |