Search in sources :

Example 6 with DataRow

use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.

the class DataRowModelResolverTest method testResolveTypeIsType.

@Test
public void testResolveTypeIsType() {
    DataRow row = new SimpleDataRow(Collections.emptyMap());
    assertEquals(row.getClass(), resolver.resolveType(row));
}
Also used : SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) DataRow(com.ibm.cohort.datarow.model.DataRow) Test(org.junit.Test)

Example 7 with DataRow

use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.

the class DataRowModelResolverTest method testResolvePathForMissingFieldIsNull.

@Test
public void testResolvePathForMissingFieldIsNull() {
    DataRow row = new SimpleDataRow(Collections.emptyMap());
    assertNull(resolver.resolvePath(row, String.valueOf("does-not-exist")));
}
Also used : SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) DataRow(com.ibm.cohort.datarow.model.DataRow) Test(org.junit.Test)

Example 8 with DataRow

use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.

the class DataRowModelResolverTest method testInvalidObjectAsTypeNonStrict.

@Test
public void testInvalidObjectAsTypeNonStrict() {
    DataRow row = new SimpleDataRow(Collections.emptyMap());
    assertNull(resolver.as(row, String.class, false));
}
Also used : SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) DataRow(com.ibm.cohort.datarow.model.DataRow) Test(org.junit.Test)

Example 9 with DataRow

use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.

the class DataRowModelResolverTest method testIsTypeNull.

@Test
public void testIsTypeNull() {
    DataRow row = null;
    assertNull(resolver.is(row, DataRow.class));
}
Also used : SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) DataRow(com.ibm.cohort.datarow.model.DataRow) Test(org.junit.Test)

Example 10 with DataRow

use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.

the class DataRowModelResolverTest method testObjectAsTypeStrict.

@Test
public void testObjectAsTypeStrict() {
    DataRow row = new SimpleDataRow(Collections.emptyMap());
    assertTrue(resolver.as(row, DataRow.class, true) instanceof DataRow);
}
Also used : SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) DataRow(com.ibm.cohort.datarow.model.DataRow) Test(org.junit.Test)

Aggregations

DataRow (com.ibm.cohort.datarow.model.DataRow)17 Test (org.junit.Test)13 SimpleDataRow (com.ibm.cohort.datarow.model.SimpleDataRow)9 List (java.util.List)6 HashSet (java.util.HashSet)4 HashMap (java.util.HashMap)3 PrefixStringMatcher (com.ibm.cohort.cql.util.PrefixStringMatcher)2 RegexStringMatcher (com.ibm.cohort.cql.util.RegexStringMatcher)2 StringMatcher (com.ibm.cohort.cql.util.StringMatcher)2 ArrayList (java.util.ArrayList)2 Code (org.opencds.cqf.cql.engine.runtime.Code)2 CqlDataProvider (com.ibm.cohort.cql.data.CqlDataProvider)1 CqlEvaluationRequests (com.ibm.cohort.cql.evaluation.CqlEvaluationRequests)1 CqlEvaluator (com.ibm.cohort.cql.evaluation.CqlEvaluator)1 SparkDataRow (com.ibm.cohort.cql.spark.data.SparkDataRow)1 SparkOutputColumnEncoder (com.ibm.cohort.cql.spark.data.SparkOutputColumnEncoder)1 DataRowDataProvider (com.ibm.cohort.datarow.engine.DataRowDataProvider)1 DataRowRetrieveProvider (com.ibm.cohort.datarow.engine.DataRowRetrieveProvider)1 CodeKey (com.ibm.cohort.datarow.model.CodeKey)1 Map (java.util.Map)1