conversion issues fixed, validation issues next

This commit is contained in:
markiantorno 2021-08-19 13:48:59 -04:00
parent 367b338d85
commit 3fdb7c8408
5 changed files with 15 additions and 10 deletions

View File

@ -9,6 +9,8 @@ import ca.uhn.fhir.context.support.ValueSetExpansionOptions;
import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.util.FhirVersionIndependentConcept; import ca.uhn.fhir.util.FhirVersionIndependentConcept;
import org.apache.commons.lang3.Validate; 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_10_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50; import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_50;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_40_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) { private org.hl7.fhir.r5.model.ValueSet expandValueSetDstu3(ValidationSupportContext theValidationSupportContext, org.hl7.fhir.dstu3.model.ValueSet theInput, @Nullable String theWantSystemUrlAndVersion, @Nullable String theWantCode) {
Function<String, org.hl7.fhir.r5.model.CodeSystem> codeSystemLoader = t -> { Function<String, org.hl7.fhir.r5.model.CodeSystem> codeSystemLoader = t -> {
org.hl7.fhir.dstu3.model.CodeSystem codeSystem = (org.hl7.fhir.dstu3.model.CodeSystem) theValidationSupportContext.getRootValidationSupport().fetchCodeSystem(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<String, org.hl7.fhir.r5.model.ValueSet> valueSetLoader = t -> { Function<String, org.hl7.fhir.r5.model.ValueSet> valueSetLoader = t -> {
org.hl7.fhir.dstu3.model.ValueSet valueSet = (org.hl7.fhir.dstu3.model.ValueSet) theValidationSupportContext.getRootValidationSupport().fetchValueSet(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); 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) { private org.hl7.fhir.r5.model.ValueSet expandValueSetR4(ValidationSupportContext theValidationSupportContext, org.hl7.fhir.r4.model.ValueSet theInput, @Nullable String theWantSystemUrlAndVersion, @Nullable String theWantCode) {
Function<String, org.hl7.fhir.r5.model.CodeSystem> codeSystemLoader = t -> { Function<String, org.hl7.fhir.r5.model.CodeSystem> codeSystemLoader = t -> {
org.hl7.fhir.r4.model.CodeSystem codeSystem = (org.hl7.fhir.r4.model.CodeSystem) theValidationSupportContext.getRootValidationSupport().fetchCodeSystem(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<String, org.hl7.fhir.r5.model.ValueSet> valueSetLoader = t -> { Function<String, org.hl7.fhir.r5.model.ValueSet> valueSetLoader = t -> {
org.hl7.fhir.r4.model.ValueSet valueSet = (org.hl7.fhir.r4.model.ValueSet) theValidationSupportContext.getRootValidationSupport().fetchValueSet(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); org.hl7.fhir.r5.model.ValueSet input = (org.hl7.fhir.r5.model.ValueSet) VersionConvertorFactory_40_50.convertResource(theInput);

View File

@ -15,6 +15,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.fhir.ucum.UcumService; 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.convertors.factory.VersionConvertorFactory_10_50;
import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.TerminologyServiceException; import org.hl7.fhir.exceptions.TerminologyServiceException;
@ -691,7 +692,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo
converter = new IVersionTypeConverter() { converter = new IVersionTypeConverter() {
@Override @Override
public Resource toCanonical(IBaseResource theNonCanonical) { 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) { if (theNonCanonical instanceof org.hl7.fhir.dstu2.model.ValueSet) {
org.hl7.fhir.dstu2.model.ValueSet valueSet = (org.hl7.fhir.dstu2.model.ValueSet) theNonCanonical; org.hl7.fhir.dstu2.model.ValueSet valueSet = (org.hl7.fhir.dstu2.model.ValueSet) theNonCanonical;
if (valueSet.hasCodeSystem() && valueSet.getCodeSystem().hasSystem()) { if (valueSet.hasCodeSystem() && valueSet.getCodeSystem().hasSystem()) {

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.common.hapi.validation.validator; 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.convertors.factory.VersionConvertorFactory_30_50;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
@ -7,11 +8,11 @@ import org.hl7.fhir.r5.model.Resource;
public class VersionTypeConverterDstu3 implements VersionSpecificWorkerContextWrapper.IVersionTypeConverter { public class VersionTypeConverterDstu3 implements VersionSpecificWorkerContextWrapper.IVersionTypeConverter {
@Override @Override
public Resource toCanonical(IBaseResource theNonCanonical) { 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 @Override
public IBaseResource fromCanonical(Resource theCanonical) { public IBaseResource fromCanonical(Resource theCanonical) {
return VersionConvertorFactory_30_50.convertResource(theCanonical); return VersionConvertorFactory_30_50.convertResource(theCanonical, new BaseAdvisor_30_50(false));
} }
} }

View File

@ -1,5 +1,6 @@
package org.hl7.fhir.common.hapi.validation.validator; 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.convertors.factory.VersionConvertorFactory_40_50;
import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.Resource;
@ -7,11 +8,11 @@ import org.hl7.fhir.r5.model.Resource;
public class VersionTypeConverterR4 implements VersionSpecificWorkerContextWrapper.IVersionTypeConverter { public class VersionTypeConverterR4 implements VersionSpecificWorkerContextWrapper.IVersionTypeConverter {
@Override @Override
public Resource toCanonical(IBaseResource theNonCanonical) { 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 @Override
public IBaseResource fromCanonical(Resource theCanonical) { public IBaseResource fromCanonical(Resource theCanonical) {
return VersionConvertorFactory_40_50.convertResource(theCanonical); return VersionConvertorFactory_40_50.convertResource(theCanonical, new BaseAdvisor_40_50(false));
} }
} }

View File

@ -747,7 +747,7 @@
<properties> <properties>
<fhir_core_version>5.4.10-SNAPSHOT</fhir_core_version> <fhir_core_version>5.4.10</fhir_core_version>
<ucum_version>1.0.3</ucum_version> <ucum_version>1.0.3</ucum_version>
<surefire_jvm_args>-Dfile.encoding=UTF-8 -Xmx2048m</surefire_jvm_args> <surefire_jvm_args>-Dfile.encoding=UTF-8 -Xmx2048m</surefire_jvm_args>