Search in sources :

Example 1 with MeasureReportType

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());
}
Also used : TimeZone(java.util.TimeZone) MeasureReport(org.hl7.fhir.r4.model.MeasureReport) MeasureReportStatus(org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus) MeasureReportType(org.hl7.fhir.r4.model.MeasureReport.MeasureReportType) Date(java.util.Date) Interval(org.opencds.cqf.cql.engine.runtime.Interval) Test(org.junit.Test)

Aggregations

Date (java.util.Date)1 TimeZone (java.util.TimeZone)1 MeasureReport (org.hl7.fhir.r4.model.MeasureReport)1 MeasureReportStatus (org.hl7.fhir.r4.model.MeasureReport.MeasureReportStatus)1 MeasureReportType (org.hl7.fhir.r4.model.MeasureReport.MeasureReportType)1 Test (org.junit.Test)1 Interval (org.opencds.cqf.cql.engine.runtime.Interval)1