Search in sources :

Example 1 with Date

use of org.opencds.cqf.cql.engine.runtime.Date in project quality-measure-and-cohort-service by Alvearie.

the class CQLToFHIRMeasureReportHelperTest method testIntervalDate_shouldReturnNull.

@Test
public void testIntervalDate_shouldReturnNull() {
    Interval interval = new Interval(new Date("2020-01-02"), true, new Date("2020-06-04"), true);
    assertNull(CQLToFHIRMeasureReportHelper.getFhirTypeValue(interval));
}
Also used : Date(org.opencds.cqf.cql.engine.runtime.Date) Interval(org.opencds.cqf.cql.engine.runtime.Interval) Test(org.junit.Test)

Example 2 with Date

use of org.opencds.cqf.cql.engine.runtime.Date in project quality-measure-and-cohort-service by Alvearie.

the class CQLToFHIRMeasureReportHelperTest method testDate.

@Test
public void testDate() {
    String dateString = "2020-01-02";
    Date expected = new Date(dateString);
    IBaseDatatype fhirTypeValue = CQLToFHIRMeasureReportHelper.getFhirTypeValue(expected);
    assertTrue(fhirTypeValue instanceof DateType);
    assertEquals(dateString, ((DateType) fhirTypeValue).getValueAsString());
}
Also used : IBaseDatatype(org.hl7.fhir.instance.model.api.IBaseDatatype) DateType(org.hl7.fhir.r4.model.DateType) Date(org.opencds.cqf.cql.engine.runtime.Date) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 Date (org.opencds.cqf.cql.engine.runtime.Date)2 IBaseDatatype (org.hl7.fhir.instance.model.api.IBaseDatatype)1 DateType (org.hl7.fhir.r4.model.DateType)1 Interval (org.opencds.cqf.cql.engine.runtime.Interval)1