use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementAttributeSubExpression.
@Test
public void refinementAttributeSubExpression() throws Exception {
generateDrugHierarchy();
indexRevision(MAIN, concept(HAS_ACTIVE_INGREDIENT).build(), concept(HAS_BOSS).build());
final Expression actual = eval(String.format("<%s:(%s OR %s)=(%s OR %s)", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, HAS_BOSS, INGREDIENT1, INGREDIENT2));
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 refinementBooleanValueNotEquals.
@Test
public void refinementBooleanValueNotEquals() 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(AMOXICILLIN_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementDecimalNotEquals.
@Test
public void refinementDecimalNotEquals() 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 refinementAttributeEqualsSingleMatch.
@Test
public void refinementAttributeEqualsSingleMatch() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s:%s=%s", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, INGREDIENT2));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Collections.singleton(TRIPHASIL_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method memberOfNested.
@Test
public void memberOfNested() throws Exception {
indexRevision(MAIN, concept(Concepts.SYNONYM).parents(Long.parseLong(Concepts.REFSET_DESCRIPTION_TYPE)).statedParents(Long.parseLong(Concepts.REFSET_DESCRIPTION_TYPE)).ancestors(IComponent.ROOT_IDL).statedAncestors(IComponent.ROOT_IDL).build());
final Expression actual = eval("^(<" + Concepts.REFSET_DESCRIPTION_TYPE + ")");
final Expression expected = activeMemberOf(Collections.singleton(Concepts.SYNONYM));
assertEquals(expected, actual);
}
Aggregations