use of org.hl7.fhir.r5.model.Measure in project quality-measure-and-cohort-service by Alvearie.
the class CDMMeasureEvaluationTest method testSetReportMeasureToMeasureId__noMetaVersion__noHistoryInMeasureOnReport.
@Test
public void testSetReportMeasureToMeasureId__noMetaVersion__noHistoryInMeasureOnReport() {
MeasureReport report = new MeasureReport();
String measureInput = "{\"resourceType\":\"Measure\",\"id\":\"id1\"}";
Measure measure = fhirParser.parseResource(Measure.class, measureInput);
CDMMeasureEvaluation.setReportMeasureToMeasureId(report, measure);
assertEquals("Measure/id1", report.getMeasure());
}
use of org.hl7.fhir.r5.model.Measure in project quality-measure-and-cohort-service by Alvearie.
the class CDMMeasureEvaluationTest method testSetReportMeasureToMeasureId__includesMetaVersion__hasHistoryInMeasureOnReport.
@Test
public void testSetReportMeasureToMeasureId__includesMetaVersion__hasHistoryInMeasureOnReport() {
MeasureReport report = new MeasureReport();
String measureInput = "{\"resourceType\":\"Measure\",\"id\":\"id1\",\"meta\":{\"versionId\":\"2\"}}";
Measure measure = fhirParser.parseResource(Measure.class, measureInput);
CDMMeasureEvaluation.setReportMeasureToMeasureId(report, measure);
assertEquals("Measure/id1/_history/2", report.getMeasure());
}
use of org.hl7.fhir.r5.model.Measure 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());
}
use of org.hl7.fhir.r5.model.Measure in project quality-measure-and-cohort-service by Alvearie.
the class DefaultMeasurementPeriodStrategyTest method parameter_null_map_null__value_is_calulated.
@Test
public void parameter_null_map_null__value_is_calulated() throws Exception {
Calendar c = Calendar.getInstance();
c.clear();
c.set(2020, Calendar.AUGUST, 15);
Measure measure = new Measure();
Map<String, Parameter> parameterOverrides = null;
Pair<String, String> result = new DefaultMeasurementPeriodStrategy().setNow(c.getTime()).getMeasurementPeriod(measure, parameterOverrides);
DateFormat sdf = new SimpleDateFormat(DefaultMeasurementPeriodStrategy.TARGET_DATE_FORMAT);
assertEquals("Unexpected end", result.getRight(), sdf.format(c.getTime()));
}
use of org.hl7.fhir.r5.model.Measure in project quality-measure-and-cohort-service by Alvearie.
the class DefaultMeasurementPeriodStrategyTest method runGetMeasurementPeriodTest.
private void runGetMeasurementPeriodTest(String parameterName, String start, String end) {
Measure measure = new Measure();
Map<String, Parameter> parameterOverrides = Collections.singletonMap(parameterName, new IntervalParameter(new DateParameter(start), true, new DateParameter(end), true));
Pair<String, String> result = new DefaultMeasurementPeriodStrategy().setMeasurementPeriodParameter(parameterName).getMeasurementPeriod(measure, parameterOverrides);
assertEquals("Unexpected start", result.getLeft(), start);
assertEquals("Unexpected end", result.getRight(), end);
}
Aggregations