From c5ace67136f68e0574504af64425bc54c79342bd Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 22 May 2019 11:12:56 +1000 Subject: [PATCH] fix evaluation of discriminators where elements may repeat --- .../java/org/hl7/fhir/r5/validation/InstanceValidator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java index ab02e8fa9..6c8ec00a9 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/r5/validation/InstanceValidator.java @@ -2743,7 +2743,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat CodeableConcept cc = (CodeableConcept) fixed; buildCodeableConceptExpression(ed, expression, discriminator, cc); } else { - expression.append(" and (" + discriminator + " = "); + expression.append(" and ("); if (fixed instanceof StringType) { Gson gson = new Gson(); String json = gson.toJson((StringType)fixed); @@ -2760,7 +2760,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat expression.append(((BooleanType)fixed).asStringValue()); } else throw new DefinitionException("Unsupported fixed value type for discriminator(" + discriminator + ") for slice " + ed.getId() + ": " + fixed.getClass().getName()); - expression.append(")"); + expression.append(" in " + discriminator +")"); } }