use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToZeroWithZeroToZeroAttributeCardinality.
@Ignore("Unsupported attribute cardinality in group with cardinality")
@Test
public void groupCardinalityZeroToZeroWithZeroToZeroAttributeCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [0..0] { [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 refinementWithGroupConjunction.
@Test
public void refinementWithGroupConjunction() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: [1..1] {%s=<%s,%s=<%s}", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE, HAS_BOSS, SUBSTANCE));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(ASPIRIN_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementCardinalityZeroToZeroNotEqualsToSingleValue.
@Test
public void refinementCardinalityZeroToZeroNotEqualsToSingleValue() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("<%s: [0..0] %s != %s", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, INGREDIENT1));
final Expression expected = Expressions.builder().filter(descendantsOf(DRUG_ROOT)).mustNot(ids(Set.of(TRIPHASIL_TABLET))).build();
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementGroupDefaultCardinalityAndRelationshipOneToOneCardinality.
@Test
public void refinementGroupDefaultCardinalityAndRelationshipOneToOneCardinality() throws Exception {
generateDrugsWithGroups();
final Expression actual = eval(String.format("<%s: {[1..1] %s=<%s,[1..1] %s=<%s}", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE, HAS_BOSS, SUBSTANCE));
final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(ASPIRIN_TABLET, ALGOFLEX_TABLET)));
assertEquals(expected, actual);
}
use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.
the class SnomedEclEvaluationRequestTest method refinementAnyStringEquals.
@Test
public void refinementAnyStringEquals() throws Exception {
generateDrugHierarchy();
final Expression actual = eval(String.format("*: %s = 'PANADOL'", HAS_TRADE_NAME));
final Expression expected = ids(Set.of(PANADOL_TABLET));
assertEquals(expected, actual);
}
Aggregations