diff --git a/hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java b/hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java index 579acd9a82a..eeaa6af11aa 100644 --- a/hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java +++ b/hapi-fhir-converter/src/main/java/org/hl7/fhir/convertors/VersionConvertor_30_40.java @@ -32,16 +32,9 @@ import org.hl7.fhir.dstu3.model.ExpansionProfile.SystemVersionProcessingMode; import org.hl7.fhir.dstu3.model.Parameters; import org.hl7.fhir.dstu3.model.Parameters.ParametersParameterComponent; import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.r4.model.BooleanType; -import org.hl7.fhir.r4.model.CodeableConcept; -import org.hl7.fhir.r4.model.Enumeration; +import org.hl7.fhir.r4.model.*; import org.hl7.fhir.r4.model.Expression.ExpressionLanguage; import org.hl7.fhir.r4.model.HealthcareService.HealthcareServiceEligibilityComponent; -import org.hl7.fhir.r4.model.Identifier; -import org.hl7.fhir.r4.model.Reference; -import org.hl7.fhir.r4.model.TerminologyCapabilities; -import org.hl7.fhir.r4.model.Type; -import org.hl7.fhir.r4.model.UriType; import org.hl7.fhir.utilities.Utilities; @@ -76,7 +69,7 @@ import org.hl7.fhir.utilities.Utilities; public class VersionConvertor_30_40 { - private static List CANONICAL_URLS = new ArrayList(); + private static List CANONICAL_URLS = new ArrayList<>(); static { CANONICAL_URLS.add("http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap"); CANONICAL_URLS.add("http://hl7.org/fhir/StructureDefinition/11179-permitted-value-valueset"); @@ -16013,7 +16006,7 @@ public class VersionConvertor_30_40 { tgt.setType(convertQuestionnaireItemType(src.getType())); for (org.hl7.fhir.dstu3.model.Questionnaire.QuestionnaireItemEnableWhenComponent t : src.getEnableWhen()) tgt.addEnableWhen(convertQuestionnaireItemEnableWhenComponent(t)); - tgt.setEnableBehavior(EnableWhenBehavior.ANY); + tgt.setEnableBehavior(Questionnaire.EnableWhenBehavior.ANY); if (src.hasRequired()) tgt.setRequired(src.getRequired()); if (src.hasRepeats()) diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchR4Test.java index cae6b2debd8..d57263707de 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/SearchR4Test.java @@ -95,7 +95,7 @@ public class SearchR4Test { linkSelf = bundle.getLink(Constants.LINK_SELF).getUrl(); assertThat(linkSelf, containsString("_elements=name")); linkNext = bundle.getLink(Constants.LINK_NEXT).getUrl(); - assertThat(linkNext, containsString("_elements=meta,name")); + assertThat(linkNext, containsString("_elements=name")); ourLog.info(toJson(bundle)); @@ -104,7 +104,7 @@ public class SearchR4Test { bundle = executeAndReturnLinkNext(httpGet, EncodingEnum.JSON); assertThat(toJson(bundle), not(containsString("\"active\""))); linkNext = bundle.getLink(Constants.LINK_NEXT).getUrl(); - assertThat(linkNext, containsString("_elements=meta,name")); + assertThat(linkNext, containsString("_elements=name")); assertThat(linkNext, containsString("_elements:exclude=active,birthDate")); // Fetch the next page @@ -112,7 +112,7 @@ public class SearchR4Test { bundle = executeAndReturnLinkNext(httpGet, EncodingEnum.JSON); assertThat(toJson(bundle), not(containsString("\"active\""))); linkNext = bundle.getLink(Constants.LINK_NEXT).getUrl(); - assertThat(linkNext, containsString("_elements=meta,name")); + assertThat(linkNext, containsString("_elements=name")); assertThat(linkNext, containsString("_elements:exclude=active,birthDate")); // Fetch the next page @@ -120,7 +120,7 @@ public class SearchR4Test { bundle = executeAndReturnLinkNext(httpGet, EncodingEnum.JSON); assertThat(toJson(bundle), not(containsString("\"active\""))); linkNext = bundle.getLink(Constants.LINK_NEXT).getUrl(); - assertThat(linkNext, containsString("_elements=meta,name")); + assertThat(linkNext, containsString("_elements=name")); assertThat(linkNext, containsString("_elements:exclude=active,birthDate")); } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidator.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidator.java index 725d085dc49..fa7b2f4c83a 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidator.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/dstu3/hapi/validation/FhirInstanceValidator.java @@ -63,7 +63,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid private IValidationSupport myValidationSupport; private boolean noTerminologyChecks = false; private volatile WorkerContextWrapper myWrappedWorkerContext; - private Function enableWhenEvaluatorSupplier = ctx -> new DefaultEnableWhenEvaluator(); + private Function enableWhenEvaluatorSupplier; private boolean errorForUnknownProfiles; private List extensionDomains = Collections.emptyList(); @@ -86,6 +86,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid myDocBuilderFactory = DocumentBuilderFactory.newInstance(); myDocBuilderFactory.setNamespaceAware(true); myValidationSupport = theValidationSupport; + setEnableWhenEvaluatorSupplier(ctx -> new DefaultEnableWhenEvaluator()); } /** @@ -254,7 +255,6 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid /** * Sets a customized {@link IEnableWhenEvaluator} which is injected to created InstanceValidators - * @param myEnableWhenEvaluator */ public void setEnableWhenEvaluatorSupplier( Function enableWhenEvaluatorSupplier) { @@ -293,9 +293,9 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid v.setAnyExtensionsAllowed(isAnyExtensionsAllowed()); v.setResourceIdRule(IdStatus.OPTIONAL); v.setNoTerminologyChecks(isNoTerminologyChecks()); - v.setMyEnableWhenEvaluator(enableWhenEvaluatorSupplier.apply(wrappedWorkerContext)); + v.setEnableWhenEvaluator(enableWhenEvaluatorSupplier.apply(wrappedWorkerContext)); v.setErrorForUnknownProfiles(isErrorForUnknownProfiles()); - v.addExtensionDomains(extensionDomains); + v.getExtensionDomains().addAll(extensionDomains); List messages = new ArrayList<>(); diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/InstanceValidator.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/InstanceValidator.java index 1821523b812..2919b7bd5da 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/InstanceValidator.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/r4/validation/InstanceValidator.java @@ -2469,7 +2469,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat this.allowXsiLocation = allowXsiLocation; } - public void setMyEnableWhenEvaluator(IEnableWhenEvaluator myEnableWhenEvaluator) { + public void setEnableWhenEvaluator(IEnableWhenEvaluator myEnableWhenEvaluator) { this.myEnableWhenEvaluator = myEnableWhenEvaluator; }