Duplicate Detection Rules
Overview
Section titled “Overview”Duplicate detection rules identify duplicate or conflicting resource definitions.
correctness/duplicate-definition
Section titled “correctness/duplicate-definition”Severity: Error Fixable: Yes (suggests renaming)
Resource names must be unique within the project.
Example:
// ✗ Bad - Duplicate profile namesProfile: PatientProfileParent: Patient* name 1..1
Profile: PatientProfile // Duplicate!Parent: Patient* gender 1..1
Fix: Rename one of the profiles:
Profile: PatientProfileParent: Patient* name 1..1
Profile: PatientDemographicsProfileParent: Patient* gender 1..1
correctness/duplicate-id
Section titled “correctness/duplicate-id”Severity: Error Fixable: No
Resource IDs must be unique across all resources.
Example:
// ✗ BadProfile: PatientProfileId: patient-profile
Extension: PatientExtensionId: patient-profile // Duplicate ID!
suspicious/duplicate-alias
Section titled “suspicious/duplicate-alias”Severity: Warning Fixable: Yes (safe)
Alias definitions should not be duplicated.
Example:
// ✗ BadAlias: $SCT = http://snomed.info/sctAlias: $SCT = http://snomed.info/sct // Duplicate
Rationale
Section titled “Rationale”Preventing duplicates ensures:
- Clear resource identification
- Prevents compilation errors
- Avoids ambiguity in references