use of com.ibm.cohort.cql.evaluation.parameters.DatetimeParameter in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testInstant__shouldReturnDateTimeParameter.
@Test
public void testInstant__shouldReturnDateTimeParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("instant");
String instantString = "2020-01-01T12:30:00.0Z";
InstantType fhirValue = new InstantType(instantString);
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
assertEquals(new DatetimeParameter(instantString), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
use of com.ibm.cohort.cql.evaluation.parameters.DatetimeParameter in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testDateTimeWithTimezone__shouldReturnDatetimeParameter.
@Test
public void testDateTimeWithTimezone__shouldReturnDatetimeParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("dateTime");
String dateString = "2020-01-01T00:00:00.0+04:00";
DateTimeType fhirValue = new DateTimeType(dateString);
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
assertEquals(new DatetimeParameter(dateString), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
use of com.ibm.cohort.cql.evaluation.parameters.DatetimeParameter in project quality-measure-and-cohort-service by Alvearie.
the class R4ParameterDefinitionWithDefaultToCohortParameterConverterTest method testDateTimeNoTimezone__shouldReturnDatetimeParameter.
@Test
public void testDateTimeNoTimezone__shouldReturnDatetimeParameter() {
ParameterDefinition parameterDefinition = getBaseParameterDefinition("dateTime");
String dateString = "2020-01-01T00:00:00.0";
DateTimeType fhirValue = new DateTimeType(dateString);
parameterDefinition.addExtension(CDMConstants.PARAMETER_DEFAULT_URL, fhirValue);
assertEquals(new DatetimeParameter("2020-01-01T00:00:00.0"), R4ParameterDefinitionWithDefaultToCohortParameterConverter.toCohortParameter(parameterDefinition));
}
Aggregations