use of org.hl7.fhir.r5.model.TerminologyCapabilities in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponent.
protected void composeTerminologyCapabilitiesTerminologyCapabilitiesExpansionParameterComponent(Complex parent, String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesExpansionParameterComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "parameter", name, element, index);
if (element.hasNameElement())
composeCode(t, "TerminologyCapabilities", "name", element.getNameElement(), -1);
if (element.hasDocumentationElement())
composeString(t, "TerminologyCapabilities", "documentation", element.getDocumentationElement(), -1);
}
use of org.hl7.fhir.r5.model.TerminologyCapabilities in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponent.
protected void composeTerminologyCapabilitiesTerminologyCapabilitiesValidateCodeComponent(Complex parent, String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesValidateCodeComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "validateCode", name, element, index);
if (element.hasTranslationsElement())
composeBoolean(t, "TerminologyCapabilities", "translations", element.getTranslationsElement(), -1);
}
use of org.hl7.fhir.r5.model.TerminologyCapabilities in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponent.
protected void composeTerminologyCapabilitiesTerminologyCapabilitiesSoftwareComponent(Complex parent, String parentType, String name, TerminologyCapabilities.TerminologyCapabilitiesSoftwareComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "software", name, element, index);
if (element.hasNameElement())
composeString(t, "TerminologyCapabilities", "name", element.getNameElement(), -1);
if (element.hasVersionElement())
composeString(t, "TerminologyCapabilities", "version", element.getVersionElement(), -1);
}
use of org.hl7.fhir.r5.model.TerminologyCapabilities 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.has(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 {
logger.logMessage("Terminology server: Check for supported code systems for " + system);
final TerminologyCapabilities capabilityStatement = txCache.hasTerminologyCapabilities() ? txCache.getTerminologyCapabilities() : txClient.getTerminologyCapabilities();
txCache.cacheTerminologyCapabilities(capabilityStatement);
setTxCaps(capabilityStatement);
} catch (Exception e) {
if (canRunWithoutTerminology) {
noTerminologyServer = true;
logger.logMessage("==============!! Running without terminology server !! ==============");
if (txClient != null) {
logger.logMessage("txServer = " + txClient.getAddress());
logger.logMessage("Error = " + e.getMessage() + "");
}
logger.logMessage("=====================================================================");
return false;
} else {
e.printStackTrace();
throw new TerminologyServiceException(e);
}
}
if (supportedCodeSystems.contains(system)) {
return true;
}
}
}
return false;
}
}
use of org.hl7.fhir.r5.model.TerminologyCapabilities in project org.hl7.fhir.core by hapifhir.
the class TerminologyCache method loadCapabilityCache.
private void loadCapabilityCache(String fn) {
try {
String src = TextFile.fileToString(Utilities.path(folder, fn));
JsonObject o = (JsonObject) new com.google.gson.JsonParser().parse(src);
Resource resource = new JsonParser().parse(o);
if (fn.startsWith(CAPABILITY_STATEMENT_TITLE)) {
this.capabilityStatementCache = (CapabilityStatement) resource;
} else if (fn.startsWith(TERMINOLOGY_CAPABILITIES_TITLE)) {
this.terminologyCapabilitiesCache = (TerminologyCapabilities) resource;
}
} catch (Exception e) {
throw new FHIRException("Error loading " + fn + ": " + e.getMessage(), e);
}
}
Aggregations