fix bug accessing canonical resources

This commit is contained in:
Grahame Grieve 2023-05-03 11:58:49 +10:00
parent 410f08e6d6
commit 40d73ba2ad
4 changed files with 4 additions and 4 deletions

View File

@ -175,7 +175,7 @@ public class TerminologyClientR2 implements TerminologyClient {
throw new FHIRException("Unable to fetch resource " + Utilities.pathURL(getAddress(), type, id));
}
org.hl7.fhir.r5.model.Resource r5 = VersionConvertorFactory_10_50.convertResource(r2);
if (r5 != null) {
if (r5 == null) {
throw new FHIRException("Unable to convert resource " + Utilities.pathURL(getAddress(), type, id) + " to R5 (internal representation)");
}
if (!(r5 instanceof CanonicalResource)) {

View File

@ -173,7 +173,7 @@ public class TerminologyClientR3 implements TerminologyClient {
throw new FHIRException("Unable to fetch resource " + Utilities.pathURL(getAddress(), type, id));
}
org.hl7.fhir.r5.model.Resource r5 = VersionConvertorFactory_30_50.convertResource(r3);
if (r5 != null) {
if (r5 == null) {
throw new FHIRException("Unable to convert resource " + Utilities.pathURL(getAddress(), type, id) + " to R5 (internal representation)");
}
if (!(r5 instanceof CanonicalResource)) {

View File

@ -189,7 +189,7 @@ public class TerminologyClientR4 implements TerminologyClient {
throw new FHIRException("Unable to fetch resource " + Utilities.pathURL(getAddress(), type, id));
}
org.hl7.fhir.r5.model.Resource r5 = VersionConvertorFactory_40_50.convertResource(r4);
if (r5 != null) {
if (r5 == null) {
throw new FHIRException("Unable to convert resource " + Utilities.pathURL(getAddress(), type, id) + " to R5 (internal representation)");
}
if (!(r5 instanceof CanonicalResource)) {

View File

@ -163,7 +163,7 @@ public class TerminologyClientR5 implements TerminologyClient {
throw new FHIRException("Unable to fetch resources of type " + type + " in R5");
}
org.hl7.fhir.r5.model.Resource r5 = client.read(t, id);
if (r5 != null) {
if (r5 == null) {
throw new FHIRException("Unable to convert resource " + Utilities.pathURL(getAddress(), type, id) + " to R5 (internal representation)");
}
if (!(r5 instanceof CanonicalResource)) {