use of org.hl7.fhir.r4.model.MeasureReport.MeasureReportType in project quality-measure-and-cohort-service by Alvearie.
the class MeasureReportBuilderTest method testBuilder.
@Test
public void testBuilder() {
String measureRef = "MEASURE REF";
String patientRef = "PATIENT REF";
MeasureReportStatus status = MeasureReportStatus.ERROR;
MeasureReportType type = MeasureReportType.INDIVIDUAL;
Date startDate = new Date();
Date endDate = new Date();
Interval interval = new Interval(DateTime.fromJavaDate(startDate), true, DateTime.fromJavaDate(endDate), true);
MeasureReport report = new MeasureReportBuilder().buildMeasureReference(measureRef).buildPatientReference(patientRef).buildPeriod(interval).buildStatus(status.toCode()).buildType(type).build();
assertEquals(measureRef, report.getMeasure());
assertEquals(patientRef, report.getSubject().getReference());
assertEquals(startDate, report.getPeriod().getStart());
assertEquals(endDate, report.getPeriod().getEnd());
assertEquals(status, report.getStatus());
assertEquals(type, report.getType());
TimeZone timeZoneUTC = TimeZone.getTimeZone("UTC");
assertEquals(timeZoneUTC, report.getPeriod().getStartElement().getTimeZone());
assertEquals(timeZoneUTC, report.getPeriod().getEndElement().getTimeZone());
}
Aggregations