From 3fdb7c8408a550d228c7c6c58eb34254dac9e012 Mon Sep 17 00:00:00 2001 From: markiantorno Date: Thu, 19 Aug 2021 13:48:59 -0400 Subject: [PATCH] conversion issues fixed, validation issues next --- .../InMemoryTerminologyServerValidationSupport.java | 10 ++++++---- .../validator/VersionSpecificWorkerContextWrapper.java | 3 ++- .../validator/VersionTypeConverterDstu3.java | 5 +++-- .../validation/validator/VersionTypeConverterR4.java | 5 +++-- pom.xml | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupport.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupport.java index 1880fcf3003..86699f95fed 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupport.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/InMemoryTerminologyServerValidationSupport.java @@ -9,6 +9,8 @@ import ca.uhn.fhir.context.support.ValueSetExpansionOptions; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.util.FhirVersionIndependentConcept; import org.apache.commons.lang3.Validate; +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50; +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50; @@ -439,11 +441,11 @@ public class InMemoryTerminologyServerValidationSupport implements IValidationSu private org.hl7.fhir.r5.model.ValueSet expandValueSetDstu3(ValidationSupportContext theValidationSupportContext, org.hl7.fhir.dstu3.model.ValueSet theInput, @Nullable String theWantSystemUrlAndVersion, @Nullable String theWantCode) { Function codeSystemLoader = t -> { org.hl7.fhir.dstu3.model.CodeSystem codeSystem = (org.hl7.fhir.dstu3.model.CodeSystem) theValidationSupportContext.getRootValidationSupport().fetchCodeSystem(t); - return (CodeSystem) VersionConvertorFactory_30_50.convertResource(codeSystem); + return (CodeSystem) VersionConvertorFactory_30_50.convertResource(codeSystem, new BaseAdvisor_30_50(false)); }; Function valueSetLoader = t -> { org.hl7.fhir.dstu3.model.ValueSet valueSet = (org.hl7.fhir.dstu3.model.ValueSet) theValidationSupportContext.getRootValidationSupport().fetchValueSet(t); - return (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_30_50.convertResource(valueSet); + return (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_30_50.convertResource(valueSet, new BaseAdvisor_30_50(false)); }; org.hl7.fhir.r5.model.ValueSet input = (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_30_50.convertResource(theInput); @@ -455,11 +457,11 @@ public class InMemoryTerminologyServerValidationSupport implements IValidationSu private org.hl7.fhir.r5.model.ValueSet expandValueSetR4(ValidationSupportContext theValidationSupportContext, org.hl7.fhir.r4.model.ValueSet theInput, @Nullable String theWantSystemUrlAndVersion, @Nullable String theWantCode) { Function codeSystemLoader = t -> { org.hl7.fhir.r4.model.CodeSystem codeSystem = (org.hl7.fhir.r4.model.CodeSystem) theValidationSupportContext.getRootValidationSupport().fetchCodeSystem(t); - return (CodeSystem) VersionConvertorFactory_40_50.convertResource(codeSystem); + return (CodeSystem) VersionConvertorFactory_40_50.convertResource(codeSystem, new BaseAdvisor_40_50(false)); }; Function valueSetLoader = t -> { org.hl7.fhir.r4.model.ValueSet valueSet = (org.hl7.fhir.r4.model.ValueSet) theValidationSupportContext.getRootValidationSupport().fetchValueSet(t); - return (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_40_50.convertResource(valueSet); + return (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_40_50.convertResource(valueSet, new BaseAdvisor_40_50(false)); }; org.hl7.fhir.r5.model.ValueSet input = (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_40_50.convertResource(theInput); diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java index 9d111bff259..f54880a0913 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionSpecificWorkerContextWrapper.java @@ -15,6 +15,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.time.DateUtils; import org.fhir.ucum.UcumService; +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.TerminologyServiceException; @@ -691,7 +692,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo converter = new IVersionTypeConverter() { @Override public Resource toCanonical(IBaseResource theNonCanonical) { - Resource retVal = VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) theNonCanonical); + Resource retVal = VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) theNonCanonical, new BaseAdvisor_10_50(false)); if (theNonCanonical instanceof org.hl7.fhir.dstu2.model.ValueSet) { org.hl7.fhir.dstu2.model.ValueSet valueSet = (org.hl7.fhir.dstu2.model.ValueSet) theNonCanonical; if (valueSet.hasCodeSystem() && valueSet.getCodeSystem().hasSystem()) { diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterDstu3.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterDstu3.java index e969bf75e5c..f025f50cf3e 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterDstu3.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterDstu3.java @@ -1,5 +1,6 @@ package org.hl7.fhir.common.hapi.validation.validator; +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.Resource; @@ -7,11 +8,11 @@ import org.hl7.fhir.r5.model.Resource; public class VersionTypeConverterDstu3 implements VersionSpecificWorkerContextWrapper.IVersionTypeConverter { @Override public Resource toCanonical(IBaseResource theNonCanonical) { - return VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) theNonCanonical); + return VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) theNonCanonical, new BaseAdvisor_30_50(false)); } @Override public IBaseResource fromCanonical(Resource theCanonical) { - return VersionConvertorFactory_30_50.convertResource(theCanonical); + return VersionConvertorFactory_30_50.convertResource(theCanonical, new BaseAdvisor_30_50(false)); } } diff --git a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterR4.java b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterR4.java index 819261285c4..761ef392d05 100644 --- a/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterR4.java +++ b/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/validator/VersionTypeConverterR4.java @@ -1,5 +1,6 @@ package org.hl7.fhir.common.hapi.validation.validator; +import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_50; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.r5.model.Resource; @@ -7,11 +8,11 @@ import org.hl7.fhir.r5.model.Resource; public class VersionTypeConverterR4 implements VersionSpecificWorkerContextWrapper.IVersionTypeConverter { @Override public Resource toCanonical(IBaseResource theNonCanonical) { - return VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) theNonCanonical); + return VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) theNonCanonical, new BaseAdvisor_40_50(false)); } @Override public IBaseResource fromCanonical(Resource theCanonical) { - return VersionConvertorFactory_40_50.convertResource(theCanonical); + return VersionConvertorFactory_40_50.convertResource(theCanonical, new BaseAdvisor_40_50(false)); } } diff --git a/pom.xml b/pom.xml index 90b82a4eca4..2428e886f62 100644 --- a/pom.xml +++ b/pom.xml @@ -747,7 +747,7 @@ - 5.4.10-SNAPSHOT + 5.4.10 1.0.3 -Dfile.encoding=UTF-8 -Xmx2048m