use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementGroupCardinalityTwoToTwo.
@Test
public void refinementGroupCardinalityTwoToTwo() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [2..2] {%s=<%s}", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(ALGOFLEX_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToOneWithZeroToOneAttributeCardinality.
@Ignore("Unsupported attribute cardinality in group with cardinality")
@Test
public void groupCardinalityZeroToOneWithZeroToOneAttributeCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..1] { [0..1] %s = <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = ids(Set.of(ASPIRIN_TABLET, TRIPLEX_TABLET, EPOX_TABLET));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method dottedWithComplexLeftSide.
@Test
public void dottedWithComplexLeftSide() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("(<%s MINUS %s).%s", DRUG_ROOT, TRIPHASIL_TABLET, HAS_ACTIVE_INGREDIENT));
final Expression expected = ids(Set.of(INGREDIENT1));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementIntegerLessThan.
@Test
public void refinementIntegerLessThan() throws Exception {
generateDrugHierarchy();
generateDrugWithIntegerStrengthOfValueOne();
final Expression actual = eval(String.format("<%s: %s < #1", 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 ancestorOrSelfOfAny.
@Test
public void ancestorOrSelfOfAny() throws Exception {
final Expression actual = eval(">> *");
assertEquals(Expressions.matchAll(), actual);
}
Aggregations