Search in sources :

Example 26 with IntervalParameter

use of com.ibm.cohort.cql.evaluation.parameters.IntervalParameter in project quality-measure-and-cohort-service by Alvearie.

the class SparkCqlEvaluatorTest method testReadCqlJobsSuccess.

@Test
public void testReadCqlJobsSuccess() throws Exception {
    IntervalParameter measurementPeriod = new IntervalParameter();
    measurementPeriod.setStart(new DateParameter("2020-01-01")).setEnd(new DateParameter("2021-01-01"));
    IntegerParameter minimumAge = new IntegerParameter(17);
    evaluator.hadoopConfiguration = new SerializableConfiguration(SparkHadoopUtil.get().conf());
    CqlEvaluationRequests requests = evaluator.readJobSpecification("src/test/resources/simple-job/cql-jobs.json");
    assertNotNull(requests);
    assertEquals(measurementPeriod, requests.getGlobalParameters().get("Measurement Period"));
    assertEquals(1, requests.getEvaluations().size());
    assertEquals(minimumAge, requests.getEvaluations().get(0).getParameters().get("MinimumAge"));
}
Also used : IntegerParameter(com.ibm.cohort.cql.evaluation.parameters.IntegerParameter) DateParameter(com.ibm.cohort.cql.evaluation.parameters.DateParameter) SerializableConfiguration(org.apache.spark.util.SerializableConfiguration) CqlEvaluationRequests(com.ibm.cohort.cql.evaluation.CqlEvaluationRequests) IntervalParameter(com.ibm.cohort.cql.evaluation.parameters.IntervalParameter) Test(org.junit.Test)

Aggregations

IntervalParameter (com.ibm.cohort.cql.evaluation.parameters.IntervalParameter)26 Test (org.junit.Test)24 Parameter (com.ibm.cohort.cql.evaluation.parameters.Parameter)23 DateParameter (com.ibm.cohort.cql.evaluation.parameters.DateParameter)17 HashMap (java.util.HashMap)14 DatetimeParameter (com.ibm.cohort.cql.evaluation.parameters.DatetimeParameter)12 Measure (org.hl7.fhir.r4.model.Measure)12 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)11 MeasureContext (com.ibm.cohort.engine.measure.MeasureContext)10 IntegerParameter (com.ibm.cohort.cql.evaluation.parameters.IntegerParameter)9 FhirServerConfig (com.ibm.cohort.fhir.client.config.FhirServerConfig)9 Library (org.hl7.fhir.r4.model.Library)9 FhirContext (ca.uhn.fhir.context.FhirContext)8 IParser (ca.uhn.fhir.parser.IParser)8 QuantityParameter (com.ibm.cohort.cql.evaluation.parameters.QuantityParameter)8 PatientListMeasureEvaluation (com.ibm.cohort.engine.api.service.model.PatientListMeasureEvaluation)8 ByteArrayInputStream (java.io.ByteArrayInputStream)8 ByteArrayOutputStream (java.io.ByteArrayOutputStream)8 BooleanParameter (com.ibm.cohort.cql.evaluation.parameters.BooleanParameter)7 CodeParameter (com.ibm.cohort.cql.evaluation.parameters.CodeParameter)7