use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveIntegerParameter.
@Test
public void testResolveIntegerParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:integer:40"));
assertEquals(1, params.size());
IntegerParameter p = (IntegerParameter) params.get("test");
assertNotNull("Parameter with expected name not found", p);
assertEquals("Unexpected value", 40, p.getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveIntervalIntegerParameter.
@Test
public void testResolveIntervalIntegerParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:interval:integer,10,20"));
assertEquals(1, params.size());
IntervalParameter p = (IntervalParameter) params.get("test");
assertEquals(10, ((IntegerParameter) p.getStart()).getValue());
assertEquals(20, ((IntegerParameter) p.getEnd()).getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveBooleanParameter.
@Test
public void testResolveBooleanParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:boolean:true"));
assertEquals(1, params.size());
BooleanParameter p = (BooleanParameter) params.get("test");
assertNotNull("Parameter with expected name not found", p);
assertEquals("Unexpected value", true, p.getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveDateTimeParameter.
@Test
public void testResolveDateTimeParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:datetime:@2020-09-27T12:13:14"));
assertEquals(1, params.size());
DatetimeParameter p = (DatetimeParameter) params.get("test");
assertNotNull("Parameter with expected name not found", p);
assertEquals("Unexpected value", "@2020-09-27T12:13:14", p.getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class DefaultMeasurementPeriodStrategyTest method parameter_not_null_date___value_used.
@Test
public void parameter_not_null_date___value_used() {
Measure measure = new Measure();
Map<String, Parameter> parameterOverrides = Collections.singletonMap(DefaultMeasurementPeriodStrategy.DEFAULT_MEASUREMENT_PERIOD_PARAMETER, new IntervalParameter(new DateParameter("2020-03-14"), true, new DateParameter("2020-09-14"), true));
Pair<String, String> result = new DefaultMeasurementPeriodStrategy().getMeasurementPeriod(measure, parameterOverrides);
assertEquals("Unexpected start", "2020-03-14", result.getLeft());
assertEquals("Unexpected end", "2020-09-14", result.getRight());
}
Aggregations