use of org.hl7.fhir.r4.model.TerminologyCapabilities.TerminologyCapabilitiesCodeSystemComponent in project org.hl7.fhir.core by hapifhir.
the class BaseWorkerContext method supportsSystem.
@Override
public boolean supportsSystem(String system) throws TerminologyServiceException {
synchronized (lock) {
if (codeSystems.containsKey(system) && codeSystems.get(system).getContent() != CodeSystemContentMode.NOTPRESENT)
return true;
else if (supportedCodeSystems.contains(system))
return true;
else if (system.startsWith("http://example.org") || system.startsWith("http://acme.com") || system.startsWith("http://hl7.org/fhir/valueset-") || system.startsWith("urn:oid:"))
return false;
else {
if (noTerminologyServer)
return false;
if (txcaps == null) {
try {
log("Terminology server: Check for supported code systems for " + system);
txcaps = txClient.getTerminologyCapabilities();
} catch (Exception e) {
if (canRunWithoutTerminology) {
noTerminologyServer = true;
log("==============!! Running without terminology server !! ==============");
if (txClient != null) {
log("txServer = " + txClient.getAddress());
log("Error = " + e.getMessage() + "");
}
log("=====================================================================");
return false;
} else
throw new TerminologyServiceException(e);
}
if (txcaps != null) {
for (TerminologyCapabilitiesCodeSystemComponent tccs : txcaps.getCodeSystem()) {
supportedCodeSystems.add(tccs.getUri());
}
}
if (supportedCodeSystems.contains(system))
return true;
}
}
return false;
}
}
Aggregations