Search in sources :

Example 1 with SnomedQueryValidationRuleEvaluator

use of com.b2international.snowowl.snomed.validation.SnomedQueryValidationRuleEvaluator in project snow-owl by b2ihealthcare.

the class SnomedPlugin method init.

@Override
public void init(SnowOwlConfiguration configuration, Environment env) throws Exception {
    final SnomedCoreConfiguration coreConfig = configuration.getModuleConfig(SnomedCoreConfiguration.class);
    env.services().registerService(SnomedCoreConfiguration.class, coreConfig);
    final Injector injector = new EclStandaloneSetup().createInjectorAndDoEMFRegistration();
    env.services().registerService(EclParser.class, new DefaultEclParser(injector.getInstance(IParser.class), injector.getInstance(IResourceValidator.class)));
    env.services().registerService(EclSerializer.class, new DefaultEclSerializer(injector.getInstance(ISerializer.class)));
    // register SNOMED CT Query based validation rule evaluator
    ValidationRuleEvaluator.Registry.register(new SnomedQueryValidationRuleEvaluator());
}
Also used : DefaultEclParser(com.b2international.snowowl.snomed.core.ecl.DefaultEclParser) SnomedQueryValidationRuleEvaluator(com.b2international.snowowl.snomed.validation.SnomedQueryValidationRuleEvaluator) Injector(com.google.inject.Injector) EclStandaloneSetup(com.b2international.snomed.ecl.EclStandaloneSetup) DefaultEclSerializer(com.b2international.snowowl.snomed.core.ecl.DefaultEclSerializer) SnomedCoreConfiguration(com.b2international.snowowl.snomed.datastore.config.SnomedCoreConfiguration)

Example 2 with SnomedQueryValidationRuleEvaluator

use of com.b2international.snowowl.snomed.validation.SnomedQueryValidationRuleEvaluator in project snow-owl by b2ihealthcare.

the class AllGenericValidationTests method init.

@BeforeClass
public static void init() {
    ValidationRuleEvaluator.Registry.register(new SnomedQueryValidationRuleEvaluator());
    final Path resourcesDir = PlatformUtil.toAbsoluteBundlePath(BaseGenericValidationRuleTest.class.getClassLoader().getResource("src/main/resources"));
    ValidationRuleEvaluator.Registry.register(new GroovyScriptValidationRuleEvaluator(resourcesDir));
    TerminologyRegistry.INSTANCE.register(new SnomedPlugin());
}
Also used : Path(java.nio.file.Path) GroovyScriptValidationRuleEvaluator(com.b2international.snowowl.core.validation.eval.GroovyScriptValidationRuleEvaluator) SnomedPlugin(com.b2international.snowowl.snomed.core.SnomedPlugin) SnomedQueryValidationRuleEvaluator(com.b2international.snowowl.snomed.validation.SnomedQueryValidationRuleEvaluator) BeforeClass(org.junit.BeforeClass)

Aggregations

SnomedQueryValidationRuleEvaluator (com.b2international.snowowl.snomed.validation.SnomedQueryValidationRuleEvaluator)2 EclStandaloneSetup (com.b2international.snomed.ecl.EclStandaloneSetup)1 GroovyScriptValidationRuleEvaluator (com.b2international.snowowl.core.validation.eval.GroovyScriptValidationRuleEvaluator)1 SnomedPlugin (com.b2international.snowowl.snomed.core.SnomedPlugin)1 DefaultEclParser (com.b2international.snowowl.snomed.core.ecl.DefaultEclParser)1 DefaultEclSerializer (com.b2international.snowowl.snomed.core.ecl.DefaultEclSerializer)1 SnomedCoreConfiguration (com.b2international.snowowl.snomed.datastore.config.SnomedCoreConfiguration)1 Injector (com.google.inject.Injector)1 Path (java.nio.file.Path)1 BeforeClass (org.junit.BeforeClass)1