better error message when terminology server not available

This commit is contained in:
Grahame Grieve 2019-10-02 14:50:44 +10:00
parent 85a1256b24
commit 511ff03657
1 changed files with 10 additions and 6 deletions

View File

@ -217,12 +217,16 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
} }
public String connectToTSServer(TerminologyClient client, String log) throws URISyntaxException, FHIRException { public String connectToTSServer(TerminologyClient client, String log) {
tlog("Connect to "+client.getAddress()); try {
txClient = client; tlog("Connect to "+client.getAddress());
txLog = new HTMLClientLogger(log); txClient = client;
txClient.setLogger(txLog); txLog = new HTMLClientLogger(log);
return txClient.getCapabilitiesStatementQuick().getSoftware().getVersion(); txClient.setLogger(txLog);
return txClient.getCapabilitiesStatementQuick().getSoftware().getVersion();
} catch (Exception e) {
throw new FHIRException("Unable to connect to terminology server. Use parameter '-tx n/a' tun run without using terminology services to validate LOINC, SNOMED, ICD-X etc. Error = "+e.getMessage(), e);
}
} }
public void loadFromFile(InputStream stream, String name, IContextResourceLoader loader) throws IOException, FHIRException { public void loadFromFile(InputStream stream, String name, IContextResourceLoader loader) throws IOException, FHIRException {