#517 Add fallback for for pre-CapabilityStatement STU3 client
This commit is contained in:
parent
69871bb8c2
commit
f6ae22c59c
|
@ -287,7 +287,17 @@ public abstract class RestfulClientFactory implements IRestfulClientFactory {
|
|||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
Class implementingClass = myContext.getResourceDefinition(capabilityStatementResourceName).getImplementingClass();
|
||||
Class implementingClass;
|
||||
try {
|
||||
implementingClass = myContext.getResourceDefinition(capabilityStatementResourceName).getImplementingClass();
|
||||
} catch (DataFormatException e) {
|
||||
if (!myContext.getVersion().getVersion().isOlderThan(FhirVersionEnum.DSTU3) {
|
||||
capabilityStatementResourceName = "Conformance";
|
||||
implementingClass = myContext.getResourceDefinition(capabilityStatementResourceName).getImplementingClass();
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
try {
|
||||
conformance = (IBaseResource) client.fetchConformance().ofType(implementingClass).execute();
|
||||
} catch (FhirClientConnectionException e) {
|
||||
|
|
Loading…
Reference in New Issue