use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method childOrSelfOfAny.
@Test
public void childOrSelfOfAny() 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 groupCardinalityZeroToOneWithDefaultAttributeCardinalityNotEquals.
@Test
public void groupCardinalityZeroToOneWithDefaultAttributeCardinalityNotEquals() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..1] { %s != <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
final Expression expected = descendantsOf(DRUG_ROOT);
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementAttributeEquals.
@Test
public void refinementAttributeEquals() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s:%s=%s", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, INGREDIENT1));
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 refinementAnyAttributeValue.
@Test
public void refinementAnyAttributeValue() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: R %s=*", SUBSTANCE, HAS_ACTIVE_INGREDIENT));
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 descendantsOfAllMembersOfReferenceSet.
@Test
public void descendantsOfAllMembersOfReferenceSet() throws Exception {
final String refSetId = Concepts.REFSET_DESCRIPTION_TYPE;
final String member1 = RandomSnomedIdentiferGenerator.generateConceptId();
final String member2 = RandomSnomedIdentiferGenerator.generateConceptId();
indexRevision(MAIN, concept(member1).activeMemberOf(Set.of(refSetId)).build(), concept(member2).activeMemberOf(Set.of(refSetId)).build());
final Expression actual = eval(String.format("<^%s", refSetId));
final Expression expected = descendantsOf(member1, member2);
assertEquals(expected, actual);
}
Aggregations