Search in sources :

Example 6 with SimpleDataRow

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

the class DataRowModelResolverTest method testIsTypeType.

@Test
public void testIsTypeType() {
    DataRow row = new SimpleDataRow(Collections.emptyMap());
    assertTrue(resolver.is(row, DataRow.class));
}
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 SimpleDataRow

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

the class DataRowModelResolverTest method testRowEqualsRow.

@Test
public void testRowEqualsRow() {
    Map<String, Object> expectations = new HashMap<>();
    expectations.put("field1", "Hello");
    DataRow left = new SimpleDataRow(expectations);
    DataRow right = new SimpleDataRow(expectations);
    assertTrue(resolver.objectEqual(left, right));
    assertTrue(resolver.objectEquivalent(left, right));
}
Also used : SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) HashMap(java.util.HashMap) SimpleDataRow(com.ibm.cohort.datarow.model.SimpleDataRow) DataRow(com.ibm.cohort.datarow.model.DataRow) Test(org.junit.Test)

Example 8 with SimpleDataRow

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

the class DataRowModelResolverTest method testInvalidObjectAsTypeStrict.

@Test
public void testInvalidObjectAsTypeStrict() {
    DataRow row = new SimpleDataRow(Collections.emptyMap());
    assertThrows(InvalidCast.class, () -> resolver.as(row, String.class, true));
}
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

SimpleDataRow (com.ibm.cohort.datarow.model.SimpleDataRow)8 Test (org.junit.Test)8 DataRow (com.ibm.cohort.datarow.model.DataRow)7 HashMap (java.util.HashMap)2 CompositeCqlDataProvider (com.ibm.cohort.cql.data.CompositeCqlDataProvider)1 CqlDataProvider (com.ibm.cohort.cql.data.CqlDataProvider)1 CqlEvaluationResult (com.ibm.cohort.cql.evaluation.CqlEvaluationResult)1 CqlEvaluator (com.ibm.cohort.cql.evaluation.CqlEvaluator)1 ClasspathCqlLibraryProvider (com.ibm.cohort.cql.library.ClasspathCqlLibraryProvider)1 CqlLibraryProvider (com.ibm.cohort.cql.library.CqlLibraryProvider)1 CqlVersionedIdentifier (com.ibm.cohort.cql.library.CqlVersionedIdentifier)1 CqlTerminologyProvider (com.ibm.cohort.cql.terminology.CqlTerminologyProvider)1 UnsupportedTerminologyProvider (com.ibm.cohort.cql.terminology.UnsupportedTerminologyProvider)1 CqlToElmTranslator (com.ibm.cohort.cql.translation.CqlToElmTranslator)1 TranslatingCqlLibraryProvider (com.ibm.cohort.cql.translation.TranslatingCqlLibraryProvider)1 File (java.io.File)1 FileReader (java.io.FileReader)1 Reader (java.io.Reader)1 OffsetDateTime (java.time.OffsetDateTime)1 DateTime (org.opencds.cqf.cql.engine.runtime.DateTime)1