Merge pull request #518 from aehrc/master

#517 Add fallback for for pre-CapabilityStatement STU3 client
This commit is contained in:
James Agnew 2016-11-25 18:00:36 -05:00 committed by GitHub
commit fc55c2cae8
1 changed files with 11 additions and 1 deletions

View File

@ -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) {