use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveStringParameter.
@Test
public void testResolveStringParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:string:I have the:delimiter"));
assertEquals(1, params.size());
StringParameter p = (StringParameter) params.get("test");
assertNotNull("Parameter with expected name not found", p);
assertEquals("Unexpected value", "I have the:delimiter", p.getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveQuantityParameter.
@Test
public void testResolveQuantityParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:quantity:100:mg/mL"));
assertEquals(1, params.size());
QuantityParameter p = (QuantityParameter) params.get("test");
assertNotNull("Parameter with expected name not found", p);
assertEquals("Unexpected value", "100", p.getAmount().toString());
assertEquals("Unexpected value", "mg/mL", p.getUnit().toString());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveDecimalParameter.
@Test
public void testResolveDecimalParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:decimal:40.0"));
assertEquals(1, params.size());
DecimalParameter p = (DecimalParameter) params.get("test");
assertNotNull("Parameter with expected name not found", p);
assertEquals("Unexpected value", "40.0", p.getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveIntervalTimeParameter.
@Test
public void testResolveIntervalTimeParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:interval:time,T12:13:14,T22:33:44"));
assertEquals(1, params.size());
IntervalParameter p = (IntervalParameter) params.get("test");
TimeParameter start = (TimeParameter) p.getStart();
assertEquals("T12:13:14", start.getValue());
TimeParameter end = (TimeParameter) p.getEnd();
assertEquals("T22:33:44", end.getValue());
}
use of com.ibm.cohort.cql.evaluation.parameters.Parameter in project quality-measure-and-cohort-service by Alvearie.
the class ParameterHelperTest method testResolveIntervalDatetimeParameter.
@Test
public void testResolveIntervalDatetimeParameter() {
Map<String, Parameter> params = ParameterHelper.parseParameterArguments(Arrays.asList("test:interval:datetime,@2020-01-02T12:13:14,@2021-02-03T22:33:44"));
assertEquals(1, params.size());
IntervalParameter p = (IntervalParameter) params.get("test");
DatetimeParameter start = (DatetimeParameter) p.getStart();
assertEquals("@2020-01-02T12:13:14", start.getValue());
DatetimeParameter end = (DatetimeParameter) p.getEnd();
assertEquals("@2021-02-03T22:33:44", end.getValue());
}
Aggregations