diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java index c9d0b5cca..b622febb4 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java @@ -3946,7 +3946,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat String id = element.getChildValue("id"); if (!Utilities.noString(id)) { - rule(errors, IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), !stack.getIds().containsKey(id) || stack.getIds().get(id) == element, I18nConstants.DUPLICATE_ID, id); + if (stack.getIds().containsKey(id) && stack.getIds().get(id) != element) { + rule(errors, IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), false, I18nConstants.DUPLICATE_ID, id); + } stack.getIds().put(id, element); } if (definition.getPath().equals("StructureDefinition.snapshot")) {