use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method any.
@Test
public void any() throws Exception {
final Expression actual = eval("*");
final Expression expected = Expressions.matchAll();
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToOneWithZeroToZeroAttributeCardinality.
@Ignore("Unsupported attribute cardinality in group with cardinality")
@Test
public void groupCardinalityZeroToOneWithZeroToZeroAttributeCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..1] { [0..0] %s = <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = Expressions.matchNone();
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method defaultGroupCardinalityWithZeroToZeroAttributeCardinalityNotEquals.
@Ignore
@Test
public void defaultGroupCardinalityWithZeroToZeroAttributeCardinalityNotEquals() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: { [0..0] %s != %s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, INGREDIENT5));
final Expression expected = ids(Set.of(ASPIRIN_TABLET, TRIPLEX_TABLET, ALGOFLEX_TABLET));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementDecimalLessThan.
@Test
public void refinementDecimalLessThan() throws Exception {
generateDrugHierarchy();
generateDrugWithDecimalStrengthOfValueOne();
final Expression actual = eval(String.format("<%s: %s < #1.0", 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 refinementGroupWithDefaultCardinality.
@Test
public void refinementGroupWithDefaultCardinality() throws Exception {
generateDrugsWithGroups();
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(ASPIRIN_TABLET, ALGOFLEX_TABLET, TRIPLEX_TABLET)));
assertEquals(expected, actual);
}
Aggregations