# D-SURV Rule Implementation (JIRA ECARS-2368)

**HISTORY:**
###### 24/03/2026: ECARS-2368 - Add a ErrorCodeMapperRule mapping error code into Survival labels

## Overview
This document describes the implementation of the D-SURV (aka TASK-SURVIVAL), a dispostive task mapping errors/warnings into the corresponding Survival labels.

## Rule Description
**Rule Code**: D-SURV
**Rule Type**: TASK  
**Description**: MapS standard Incidence error codes into the specific error labels required by the Survival study
**Protocol**: Incidence 2022 (39 var) (Protocol ID: 11)  
**JIRA Ticket**: ECARS-2368

### Notes
Placeholder.
    
### Rule Logic
Placeholder.

### Calculation Formula
Placeholder.

## Implementation Files
Placeholder.

### 1. Java Implementation
**File**: `src/main/java/eu/europa/ec/jrc/qcs/engine/rule/crossfield/encr2020/ErrorCodeMapperRule.java`

## Testing
Placeholder.

## Files Modified

### quality-check-software project:
1. `src/main/java/eu/europa/ec/jrc/qcs/engine/rule/crossfield/encr2020/ErrorCodeMapperRule.java` (NEW)
2. `src/main/java/eu/europa/ec/jrc/qcs/engine/preset/DefaultRuleID.java` (MODIFIED)
3. `src/main/resources/db/T-SURV_rule_registration.sql` (NEW - SQL script)
4. `qcs.db` (TO BE UPDATED - see instructions above)

## Rule Positioning
The D-SURV rule has been positioned:
- **Priority Level**: 7 (Cross-field validation rules)
- **Execution Order**: After all other Cross-field rules
- **Before**: Cross-record validation rules (priority 8)
