use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method dialectIdAcceptableId.
@Test
public void dialectIdAcceptableId() throws Exception {
generateAcceptableDescription(Concepts.ROOT_CONCEPT);
// extra preferred description on another concept to demonstrate that it won't match
generatePreferredDescription(Concepts.MODULE_ROOT);
Expression actual = eval("* {{ dialectId != " + Concepts.REFSET_LANGUAGE_TYPE_UK + " (" + Concepts.REFSET_DESCRIPTION_ACCEPTABILITY_ACCEPTABLE + ") }}");
Expression expected = SnomedDocument.Expressions.ids(Set.of(Concepts.MODULE_ROOT));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestPropertyFilterTest method acceptableIn.
@Test
public void acceptableIn() 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("* {{ acceptableIn = " + Concepts.REFSET_LANGUAGE_TYPE_UK + " }}");
final Expression expected = SnomedDocument.Expressions.ids(List.of(Concepts.SUBSTANCE));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToOneWithDefaultAttributeCardinality.
@Test
public void groupCardinalityZeroToOneWithDefaultAttributeCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..1] { %s = <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = Expressions.builder().filter(descendantsOf(DRUG_ROOT)).mustNot(ids(Set.of(ALGOFLEX_TABLET))).build();
;
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementIntegerEqualsNegative.
@Test
public void refinementIntegerEqualsNegative() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: %s = #-500", DRUG_ROOT, PREFERRED_STRENGTH));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(TRIPHASIL_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementStringNotEquals.
@Test
public void refinementStringNotEquals() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: %s != 'PANADOL'", DRUG_ROOT, HAS_TRADE_NAME));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(TRIPHASIL_TABLET, AMOXICILLIN_TABLET)));
assertEquals(expected, actual);
}
Aggregations