Merge pull request #518 from aehrc/master
#517 Add fallback for for pre-CapabilityStatement STU3 client
This commit is contained in:
commit
fc55c2cae8
|
@ -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