diff --git a/org.hl7.fhir.utilities/src/main/resources/Messages.properties b/org.hl7.fhir.utilities/src/main/resources/Messages.properties index a6bdae0e1..f8b8cd4c7 100644 --- a/org.hl7.fhir.utilities/src/main/resources/Messages.properties +++ b/org.hl7.fhir.utilities/src/main/resources/Messages.properties @@ -643,6 +643,7 @@ SD_ED_SHOULD_BIND_WITH_VS = The element {0} has a type that should have a bindin SD_ED_BIND_UNKNOWN_VS = The valueSet reference {1} on element {0} could not be resolved SD_ED_BIND_NOT_VS = The valueSet reference {1} on element {0} points to something that is not a value set ({2}) SD_ED_BIND_NO_BINDABLE = The element {0} has a binding, but no bindable types are present {1} +SD_ED_BIND_MULTIPLE_TYPES = The element {0} has a binding, and has multiple types ({1}). The binding will apply to all the types DISCRIMINATOR_BAD_PATH = Error processing path expression for discriminator: {0} (src = ''{1}'') SLICING_CANNOT_BE_EVALUATED = Slicing cannot be evaluated: {0} TYPE_SPECIFIC_CHECKS_DT_CANONICAL_RESOLVE = Canonical URL ''{0}'' does not resolve diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java index ffdaf3e6b..8e9b7eced 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/StructureDefinitionValidator.java @@ -211,6 +211,8 @@ public class StructureDefinitionValidator extends BaseValidator { private void validateBinding(List errors, Element binding, NodeStack stack, Set typeCodes, boolean snapshot, String path) { rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), !snapshot || bindableType(typeCodes) != null, I18nConstants.SD_ED_BIND_NO_BINDABLE, path, typeCodes.toString()); + hint(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), typeCodes.size() <= 1, I18nConstants.SD_ED_BIND_MULTIPLE_TYPES, path, typeCodes.toString()); + if (binding.hasChild("valueSet")) { Element valueSet = binding.getNamedChild("valueSet"); String ref = valueSet.hasPrimitiveValue() ? valueSet.primitiveValue() : valueSet.getNamedChildValue("reference");