use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementDecimalEquals.
@Test
public void refinementDecimalEquals() 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(AMOXICILLIN_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method descendantOrSelfAny.
@Test
public void descendantOrSelfAny() throws Exception {
final Expression actual = eval("<< *");
assertEquals(Expressions.matchAll(), actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementIntegerGreaterThanEquals.
@Test
public void refinementIntegerGreaterThanEquals() 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(PANADOL_TABLET, DRUG_1_MG)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementDecimalGreaterThan.
@Test
public void refinementDecimalGreaterThan() 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(AMOXICILLIN_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method dotted.
@Test
public void dotted() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("%s.%s", PANADOL_TABLET, HAS_ACTIVE_INGREDIENT));
final Expression expected = ids(Set.of(INGREDIENT1));
assertEquals(expected, actual);
}
Aggregations