use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementDecimalEqualsNegative.
@Test
public void refinementDecimalEqualsNegative() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: %s = #-5.5", DRUG_ROOT, PREFERRED_STRENGTH));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(ABACAVIR_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method memberOfAny.
@Test
public void memberOfAny() throws Exception {
final Expression actual = eval("^*");
final Expression expected = Expressions.exists(ACTIVE_MEMBER_OF);
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementAttributeValueDescendantOf.
@Test
public void refinementAttributeValueDescendantOf() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: %s=<%s", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(TRIPHASIL_TABLET, PANADOL_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToZeroWithDefaultAttributeCardinality.
@Test
public void groupCardinalityZeroToZeroWithDefaultAttributeCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..0] { %s = <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = Expressions.builder().filter(descendantsOf(DRUG_ROOT)).mustNot(ids(Set.of(ALGOFLEX_TABLET, TRIPLEX_TABLET, ASPIRIN_TABLET))).build();
;
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToZeroWithZeroToOneAttributeCardinality.
@Ignore("Unsupported attribute cardinality in group with cardinality")
@Test
public void groupCardinalityZeroToZeroWithZeroToOneAttributeCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..0] { [0..1] %s = <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = Expressions.matchNone();
assertEquals(expected, actual);
}
Aggregations