use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method dialectPreferred.
@Test
public void dialectPreferred() throws Exception {
generatePreferredDescription(Concepts.ROOT_CONCEPT);
// extra acceptable description on another concept to demonstrate that it won't match
generateAcceptableDescription(Concepts.MODULE_ROOT);
Expression actual = eval("* {{ dialect = en-gb (prefer) }}");
Expression expected = SnomedDocument.Expressions.ids(Set.of(Concepts.ROOT_CONCEPT));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method inactiveOnly.
@Test
public void inactiveOnly() throws Exception {
final Expression actual = eval("* {{ c active=false }}");
final Expression expected = SnomedDocument.Expressions.inactive();
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method multiDomainQueryOr.
@Test
public void multiDomainQueryOr() throws Exception {
Expression actual = eval("* {{ c active=false }} OR * {{ d term=\"clin find\" }}");
Expression expected = Expressions.builder().should(SnomedDocument.Expressions.inactive()).should(SnomedDocument.Expressions.ids(Collections.emptySet())).build();
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method languageRefSet.
@Test
public void languageRefSet() throws Exception {
indexRevision(MAIN, SnomedDescriptionIndexEntry.builder().id(generateDescriptionId()).active(true).moduleId(Concepts.MODULE_SCT_CORE).term("Clinical finding").conceptId(Concepts.ROOT_CONCEPT).typeId(Concepts.TEXT_DEFINITION).preferredIn(Set.of(Concepts.REFSET_LANGUAGE_TYPE_UK)).acceptableIn(Set.of(Concepts.REFSET_LANGUAGE_TYPE_US)).build());
indexRevision(MAIN, SnomedDescriptionIndexEntry.builder().id(generateDescriptionId()).active(true).moduleId(Concepts.MODULE_SCT_CORE).term("Clinical finding").conceptId(Concepts.SUBSTANCE).typeId(Concepts.TEXT_DEFINITION).preferredIn(Set.of(Concepts.REFSET_LANGUAGE_TYPE_US)).acceptableIn(Set.of(Concepts.REFSET_LANGUAGE_TYPE_UK)).build());
final Expression actual = eval("* {{ languageRefSetId = " + Concepts.REFSET_LANGUAGE_TYPE_UK + " }}");
final Expression expected = SnomedDocument.Expressions.ids(Set.of(Concepts.ROOT_CONCEPT, Concepts.SUBSTANCE));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method activeOnly.
@Test
public void activeOnly() throws Exception {
final Expression actual = eval("* {{ c active=true }}");
final Expression expected = SnomedDocument.Expressions.active();
assertEquals(expected, actual);
}
Aggregations