use of org.opencds.cqf.cql.engine.runtime.Time in project quality-measure-and-cohort-service by Alvearie.
the class CQLToFHIRMeasureReportHelperTest method testTime.
@Test
public void testTime() {
String timeString = "00:10:00.000";
Time expected = new Time(timeString);
IBaseDatatype fhirTypeValue = CQLToFHIRMeasureReportHelper.getFhirTypeValue(expected);
assertTrue(fhirTypeValue instanceof TimeType);
assertEquals(timeString, ((TimeType) fhirTypeValue).getValueAsString());
}
use of org.opencds.cqf.cql.engine.runtime.Time in project quality-measure-and-cohort-service by Alvearie.
the class CQLToFHIRMeasureReportHelperTest method testIntervalTime_shouldReturnNull.
/*
* Currently only supporting CQL intervals of type DateTime or Quantity.
* Support for intervals of other types may be added in the future.
*/
@Test
public void testIntervalTime_shouldReturnNull() {
String startTimeString = "00:10:00.000";
String endTimeString = "00:15:00.000";
Time startTime = new Time(startTimeString);
Time endTime = new Time(endTimeString);
Interval interval = new Interval(startTime, true, endTime, true);
assertNull(CQLToFHIRMeasureReportHelper.getFhirTypeValue(interval));
}
use of org.opencds.cqf.cql.engine.runtime.Time in project quality-measure-and-cohort-service by Alvearie.
the class SparkTypeConverter method toSparkTime.
public Object toSparkTime(Object obj) {
Object result = null;
if (obj != null) {
if (obj instanceof Time) {
Time time = (Time) obj;
Map<String, Object> map = new HashMap<>();
map.put(SYSTEM_TYPE_PROPERTY, "Time");
map.put("value", toSparkType(time.getTime().toString()));
result = JavaConverters.mapAsScalaMap(map);
}
}
return result;
}
Aggregations