Search in sources :

Example 91 with Expression

use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.

the class SnomedEclEvaluationRequestTest method any.

@Test
public void any() throws Exception {
    final Expression actual = eval("*");
    final Expression expected = Expressions.matchAll();
    assertEquals(expected, actual);
}
Also used : Expression(com.b2international.index.query.Expression) Test(org.junit.Test)

Example 92 with Expression

use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.

the class SnomedEclEvaluationRequestTest method groupCardinalityZeroToOneWithZeroToZeroAttributeCardinality.

@Ignore("Unsupported attribute cardinality in group with cardinality")
@Test
public void groupCardinalityZeroToOneWithZeroToZeroAttributeCardinality() throws Exception {
    generateDrugsWithGroups();
    final Expression actual = eval(String.format("<%s: [0..1] { [0..0] %s = <%s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
    final Expression expected = Expressions.matchNone();
    assertEquals(expected, actual);
}
Also used : Expression(com.b2international.index.query.Expression) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 93 with Expression

use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.

the class SnomedEclEvaluationRequestTest method defaultGroupCardinalityWithZeroToZeroAttributeCardinalityNotEquals.

@Ignore
@Test
public void defaultGroupCardinalityWithZeroToZeroAttributeCardinalityNotEquals() throws Exception {
    generateDrugsWithGroups();
    final Expression actual = eval(String.format("<%s: { [0..0] %s != %s }", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, INGREDIENT5));
    final Expression expected = ids(Set.of(ASPIRIN_TABLET, TRIPLEX_TABLET, ALGOFLEX_TABLET));
    assertEquals(expected, actual);
}
Also used : Expression(com.b2international.index.query.Expression) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 94 with Expression

use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.

the class SnomedEclEvaluationRequestTest method refinementDecimalLessThan.

@Test
public void refinementDecimalLessThan() 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)));
    assertEquals(expected, actual);
}
Also used : Expression(com.b2international.index.query.Expression) Test(org.junit.Test)

Example 95 with Expression

use of com.b2international.index.query.Expression in project snow-owl by b2ihealthcare.

the class SnomedEclEvaluationRequestTest method refinementGroupWithDefaultCardinality.

@Test
public void refinementGroupWithDefaultCardinality() throws Exception {
    generateDrugsWithGroups();
    final Expression actual = eval(String.format("<%s: {%s=<%s}", DRUG_ROOT, HAS_ACTIVE_INGREDIENT, SUBSTANCE));
    final Expression expected = and(descendantsOf(DRUG_ROOT), ids(Set.of(ASPIRIN_TABLET, ALGOFLEX_TABLET, TRIPLEX_TABLET)));
    assertEquals(expected, actual);
}
Also used : Expression(com.b2international.index.query.Expression) Test(org.junit.Test)

Aggregations

Expression (com.b2international.index.query.Expression)151 Test (org.junit.Test)142 BaseRevisionIndexTest (com.b2international.index.revision.BaseRevisionIndexTest)8 Ignore (org.junit.Ignore)5 Expressions (com.b2international.index.query.Expressions)2 ExpressionBuilder (com.b2international.index.query.Expressions.ExpressionBuilder)2 RevisionData (com.b2international.index.revision.RevisionFixtures.RevisionData)2 RevisionSearcher (com.b2international.index.revision.RevisionSearcher)2 BranchContext (com.b2international.snowowl.core.domain.BranchContext)2 Options (com.b2international.commons.options.Options)1 BulkUpdate (com.b2international.index.BulkUpdate)1 Searcher (com.b2international.index.Searcher)1 Query (com.b2international.index.query.Query)1 RangeData (com.b2international.index.revision.RevisionFixtures.RangeData)1 Ecl (com.b2international.snomed.ecl.Ecl)1 Any (com.b2international.snomed.ecl.ecl.Any)1 EclConceptReference (com.b2international.snomed.ecl.ecl.EclConceptReference)1 ExpressionConstraint (com.b2international.snomed.ecl.ecl.ExpressionConstraint)1 NestedExpression (com.b2international.snomed.ecl.ecl.NestedExpression)1 ResourceURI (com.b2international.snowowl.core.ResourceURI)1