Search in sources :

Example 1 with ValueSetValidator

use of org.hl7.fhir.validation.instance.type.ValueSetValidator in project kindling by HL7.

the class PageProcessor method setDefinitions.

public void setDefinitions(Definitions definitions) throws Exception {
    this.definitions = definitions;
    breadCrumbManager.setDefinitions(definitions);
    TerminologyClient client;
    try {
        client = new TerminologyClientR5(tsServer);
        client.setTimeout(60000);
    } catch (Exception e) {
        System.out.println("Warning @ PageProcessor client initialize: " + e.getLocalizedMessage());
        client = null;
    }
    workerContext = new BuildWorkerContext(definitions, client, definitions.getCodeSystems(), definitions.getValuesets(), conceptMaps, profiles, guides, folders.rootDir);
    workerContext.setDefinitions(definitions);
    workerContext.setLogger(this);
    workerContext.setAllowLoadingDuplicates(true);
    log("Load UTG Terminology", LogMessageType.Process);
    NpmPackage utg = new FilesystemPackageCacheManager(true, ToolsVersion.TOOLS_VERSION).loadPackage("hl7.terminology");
    workerContext.loadFromPackage(utg, new R4ToR5Loader(BuildWorkerContext.defaultTypesToLoad(), new UTGLoader(utg.version())));
    log("Load Terminology Cache from " + Utilities.path(folders.rootDir, "vscache"), LogMessageType.Process);
    workerContext.initTS(Utilities.path(folders.rootDir, "vscache"));
    log("  .. loaded", LogMessageType.Process);
    vsValidator = new ValueSetValidator(workerContext, definitions.getVsFixups(), definitions.getStyleExemptions());
    breadCrumbManager.setContext(workerContext);
}
Also used : TerminologyClientR5(org.hl7.fhir.convertors.txClient.TerminologyClientR5) FilesystemPackageCacheManager(org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager) NpmPackage(org.hl7.fhir.utilities.npm.NpmPackage) R4ToR5Loader(org.hl7.fhir.convertors.loaders.R4ToR5Loader) TerminologyClient(org.hl7.fhir.r5.terminologies.TerminologyClient) ValueSetValidator(org.hl7.fhir.definitions.validation.ValueSetValidator) UcumException(org.fhir.ucum.UcumException) TransformerException(javax.xml.transform.TransformerException) TransformerConfigurationException(javax.xml.transform.TransformerConfigurationException) IOException(java.io.IOException) FHIRException(org.hl7.fhir.exceptions.FHIRException) URISyntaxException(java.net.URISyntaxException) PathEngineException(org.hl7.fhir.exceptions.PathEngineException) DefinitionException(org.hl7.fhir.exceptions.DefinitionException) FileNotFoundException(java.io.FileNotFoundException) NotImplementedException(org.apache.commons.lang3.NotImplementedException)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)1 TransformerException (javax.xml.transform.TransformerException)1 NotImplementedException (org.apache.commons.lang3.NotImplementedException)1 UcumException (org.fhir.ucum.UcumException)1 R4ToR5Loader (org.hl7.fhir.convertors.loaders.R4ToR5Loader)1 TerminologyClientR5 (org.hl7.fhir.convertors.txClient.TerminologyClientR5)1 ValueSetValidator (org.hl7.fhir.definitions.validation.ValueSetValidator)1 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)1 FHIRException (org.hl7.fhir.exceptions.FHIRException)1 PathEngineException (org.hl7.fhir.exceptions.PathEngineException)1 TerminologyClient (org.hl7.fhir.r5.terminologies.TerminologyClient)1 FilesystemPackageCacheManager (org.hl7.fhir.utilities.npm.FilesystemPackageCacheManager)1 NpmPackage (org.hl7.fhir.utilities.npm.NpmPackage)1