use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method multipleAndOperatorsWithoutBrackets.
@Test
public void multipleAndOperatorsWithoutBrackets() throws Exception {
final Expression actual = eval(String.format("%s AND %s AND %s", ROOT_ID, ROOT_ID, ROOT_ID));
assertNotNull(actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementDecimalLessThanOrEquals.
@Test
public void refinementDecimalLessThanOrEquals() 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, DRUG_1D_MG)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementBooleanValueEquals.
@Test
public void refinementBooleanValueEquals() throws Exception {
// Boolean evaluation only works with CD members; skip test in value mode
assumeFalse(isStatementsWithValue());
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: %s = true", DRUG_ROOT, MANUFACTURED));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(PANADOL_TABLET, TRIPHASIL_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementReversedAttributeEquals.
@Test
public void refinementReversedAttributeEquals() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: R %s=%s", SUBSTANCE, HAS_ACTIVE_INGREDIENT, TRIPHASIL_TABLET));
final Expression expected = and(descendantsOf(SUBSTANCE), ids(Set.of(INGREDIENT1, INGREDIENT2)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementCardinalityZeroToZeroEquals.
@Test
public void refinementCardinalityZeroToZeroEquals() throws Exception {
generateDrugHierarchy();
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(TRIPHASIL_TABLET, PANADOL_TABLET))).build();
assertEquals(expected, actual);
}
Aggregations