From 403016f846c041cf69e130fab09479d728fe2f1b Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 7 Dec 2022 11:26:33 -0500 Subject: [PATCH] Bump core version to 5.6.84 (#4326) * WIP. Basic adjustment of r5 IWorkerContext to core refactor * Replace FIXME with UnsupportedOperationException * use fetchResource(class_, uri) instead of UnsupportedOperationException * Fix breaking tests related to fetchResource * Fix breaking validation test Co-authored-by: dotasek --- .../canonical/VersionCanonicalizer.java | 3 +++ .../fhir/r5/hapi/ctx/HapiWorkerContext.java | 23 ++++++++++++------- .../VersionSpecificWorkerContextWrapper.java | 21 ++++++++++------- pom.xml | 2 +- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java b/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java index d1be72e29db..556b406b766 100644 --- a/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java +++ b/hapi-fhir-converter/src/main/java/ca/uhn/hapi/converters/canonical/VersionCanonicalizer.java @@ -53,9 +53,11 @@ import org.hl7.fhir.r4.model.ConceptMap; import org.hl7.fhir.r4.model.Parameters; import org.hl7.fhir.r4.model.ValueSet; import org.hl7.fhir.r5.model.CapabilityStatement; +import org.hl7.fhir.r5.model.PackageInformation; import org.hl7.fhir.r5.model.SearchParameter; import org.hl7.fhir.r5.model.StructureDefinition; +import java.util.Date; import java.util.List; import static org.apache.commons.lang3.StringUtils.isBlank; @@ -188,6 +190,7 @@ public class VersionCanonicalizer { String packageUserData = (String) theResource.getUserData("package"); if (packageUserData != null) { retVal.setUserData("package", packageUserData); + retVal.setSourcePackage(new PackageInformation(packageUserData, new Date())); } return retVal; } diff --git a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java index 904f80cd841..2c6a6a3863c 100644 --- a/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java +++ b/hapi-fhir-structures-r5/src/main/java/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java @@ -14,6 +14,7 @@ import org.fhir.ucum.UcumService; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.TerminologyServiceException; import org.hl7.fhir.r5.context.IWorkerContext; + import org.hl7.fhir.r5.context.IWorkerContextManager; import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.CodeSystem; @@ -22,6 +23,7 @@ import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent; import org.hl7.fhir.r5.model.NamingSystem; +import org.hl7.fhir.r5.model.PackageInformation; import org.hl7.fhir.r5.model.Parameters; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.ResourceType; @@ -302,14 +304,19 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext return retVal; } + public T fetchResourceWithException(Class theClass, String uri, Resource sourceOfReference) throws FHIRException { + throw new UnsupportedOperationException(Msg.code(2213)); + } + + @Override public T fetchResource(Class theClass, String theUri, String theVersion) { return fetchResource(theClass, theUri + "|" + theVersion); } @Override - public T fetchResource(Class class_, String uri, CanonicalResource canonicalForSource) { - throw new UnsupportedOperationException(Msg.code(225)); + public T fetchResource(Class class_, String uri, Resource canonicalForSource) { + return fetchResource(class_,uri); } @Override @@ -328,12 +335,12 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext } @Override - public void cacheResourceFromPackage(Resource res, PackageVersion packageDetails) throws FHIRException { + public void cacheResourceFromPackage(Resource res, PackageInformation packageDetails) throws FHIRException { throw new UnsupportedOperationException(Msg.code(229)); } @Override - public void cachePackage(PackageDetails packageDetails, List list) { + public void cachePackage(PackageInformation packageInformation) { } @@ -344,7 +351,7 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext @Override - public ValueSetExpander.ValueSetExpansionOutcome expandVS(ElementDefinitionBindingComponent theBinding, boolean theCacheOk, boolean theHierarchical) throws FHIRException { + public ValueSetExpander.ValueSetExpansionOutcome expandVS(Resource src,ElementDefinitionBindingComponent theBinding, boolean theCacheOk, boolean theHierarchical) throws FHIRException { throw new UnsupportedOperationException(Msg.code(230)); } @@ -386,12 +393,12 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext } @Override - public boolean hasPackage(PackageVersion packageVersion) { + public boolean hasPackage(PackageInformation packageVersion) { return false; } @Override - public PackageDetails getPackage(PackageVersion packageVersion) { + public PackageInformation getPackage(String id, String ver) { return null; } @@ -416,7 +423,7 @@ public final class HapiWorkerContext extends I18nBase implements IWorkerContext } @Override - public PackageVersion getPackageForUrl(String s) { + public PackageInformation getPackageForUrl(String s) { return null; } 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 596b5367a7b..21f5128e0d6 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 @@ -23,6 +23,7 @@ import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.CodeSystem; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.NamingSystem; +import org.hl7.fhir.r5.model.PackageInformation; import org.hl7.fhir.r5.model.Resource; import org.hl7.fhir.r5.model.StructureDefinition; import org.hl7.fhir.r5.model.ValueSet; @@ -136,12 +137,12 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo } @Override - public boolean hasPackage(PackageVersion packageVersion) { + public boolean hasPackage(PackageInformation packageInformation) { return false; } @Override - public PackageDetails getPackage(PackageVersion packageVersion) { + public PackageInformation getPackage(String id, String ver) { return null; } @@ -172,7 +173,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo } @Override - public PackageVersion getPackageForUrl(String s) { + public PackageInformation getPackageForUrl(String s) { throw new UnsupportedOperationException(Msg.code(2109)); } @@ -211,12 +212,12 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo } @Override - public void cacheResourceFromPackage(Resource res, PackageVersion packageDetails) throws FHIRException { + public void cacheResourceFromPackage(Resource res, PackageInformation packageDetails) throws FHIRException { } @Override - public void cachePackage(PackageDetails packageDetails, List list) { + public void cachePackage(PackageInformation packageInformation) { } @@ -271,7 +272,7 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo } @Override - public ValueSetExpander.ValueSetExpansionOutcome expandVS(org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean Hierarchical) { + public ValueSetExpander.ValueSetExpansionOutcome expandVS(Resource src, org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean Hierarchical) { throw new UnsupportedOperationException(Msg.code(663)); } @@ -350,8 +351,12 @@ public class VersionSpecificWorkerContextWrapper extends I18nBase implements IWo } @Override - public T fetchResource(Class class_, String uri, CanonicalResource canonicalForSource) { - throw new UnsupportedOperationException(Msg.code(668)); + public T fetchResource(Class class_, String uri, Resource canonicalForSource) { + return fetchResource(class_, uri); + } + + public T fetchResourceWithException(Class class_, String uri, Resource sourceOfReference) throws FHIRException { + throw new UnsupportedOperationException(Msg.code(2214)); } @Override diff --git a/pom.xml b/pom.xml index 53a7ed092be..6cb263e559c 100644 --- a/pom.xml +++ b/pom.xml @@ -845,7 +845,7 @@ - 5.6.82-SNAPSHOT + 5.6.84 1.0.3 -Dfile.encoding=UTF-8 -Xmx2048m