// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());


import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.OxygenFlowRateUnit.LITERS_PER_MINUTE;
import static org.openmhealth.schema.domain.omh.OxygenSaturation.MeasurementMethod.PULSE_OXIMETRY;
import static org.openmhealth.schema.domain.omh.OxygenSaturation.MeasurementSystem.PERIPHERAL_CAPILLARY;
import static org.openmhealth.schema.domain.omh.OxygenSaturation.SupplementalOxygenAdministrationMode.NASAL_CANNULA;
import static org.openmhealth.schema.domain.omh.PercentUnit.PERCENT;
import static org.openmhealth.schema.domain.omh.SchemaSupport.OMH_NAMESPACE;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
        assertThat(oxygenSaturation.getMeasurementSystem(), equalTo(PERIPHERAL_CAPILLARY));
        assertThat(oxygenSaturation.getSupplementalOxygenFlowRate(),
                equalTo(new TypedUnitValue<>(LITERS_PER_MINUTE, 3.2)));
        assertThat(oxygenSaturation.getSupplementalOxygenAdministrationMode(), equalTo(NASAL_CANNULA));
        assertThat(oxygenSaturation.getMeasurementMethod(), equalTo(PULSE_OXIMETRY));
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        OxygenSaturation oxygenSaturation = new OxygenSaturation.Builder(new TypedUnitValue<>(PERCENT, 96.5))
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)
                .setSupplementalOxygenAdministrationMode(NASAL_CANNULA)
                .setSupplementalOxygenFlowRate(new TypedUnitValue<>(LITERS_PER_MINUTE, 2.5))
                .setMeasurementMethod(PULSE_OXIMETRY)
                .setMeasurementSystem(PERIPHERAL_CAPILLARY)
                .build();

        String expectedDocument = "{\n" +
                "    \"oxygen_saturation\": {\n" +
                "        \"value\": 96.5,\n" +
                "        \"unit\": \"%\"\n" +
                "    },\n" +
                "    \"effective_time_frame\": {\n" +
                "        \"date_time\": \"2015-10-21T16:29:00-07:00\"\n" +
                "    },\n" +
                "    \"supplemental_oxygen_flow_rate\": {\n" +
                "        \"value\": 2.5,\n" +
                "        \"unit\": \"L/min\"\n" +
                "    },\n" +
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());


// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/OxygenSaturationUnitTests.java
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MAXIMUM;
import static org.openmhealth.schema.domain.omh.OxygenFlowRateUnit.LITERS_PER_MINUTE;
import static org.openmhealth.schema.domain.omh.OxygenSaturation.MeasurementMethod.PULSE_OXIMETRY;
import static org.openmhealth.schema.domain.omh.OxygenSaturation.MeasurementSystem.PERIPHERAL_CAPILLARY;
import static org.openmhealth.schema.domain.omh.OxygenSaturation.SupplementalOxygenAdministrationMode.NASAL_CANNULA;
import static org.openmhealth.schema.domain.omh.PercentUnit.PERCENT;
import static org.openmhealth.schema.domain.omh.SchemaSupport.OMH_NAMESPACE;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;

        assertThat(oxygenSaturation.getMeasurementSystem(), equalTo(PERIPHERAL_CAPILLARY));
        assertThat(oxygenSaturation.getSupplementalOxygenFlowRate(),
                equalTo(new TypedUnitValue<>(LITERS_PER_MINUTE, 3.2)));
        assertThat(oxygenSaturation.getSupplementalOxygenAdministrationMode(), equalTo(NASAL_CANNULA));
        assertThat(oxygenSaturation.getMeasurementMethod(), equalTo(PULSE_OXIMETRY));
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        OxygenSaturation oxygenSaturation = new OxygenSaturation.Builder(new TypedUnitValue<>(PERCENT, 96.5))
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)
                .setSupplementalOxygenAdministrationMode(NASAL_CANNULA)
                .setSupplementalOxygenFlowRate(new TypedUnitValue<>(LITERS_PER_MINUTE, 2.5))
                .setMeasurementMethod(PULSE_OXIMETRY)
                .setMeasurementSystem(PERIPHERAL_CAPILLARY)
                .build();

        String expectedDocument = "{\n" +
                "    \"oxygen_saturation\": {\n" +
                "        \"value\": 96.5,\n" +
                "        \"unit\": \"%\"\n" +
                "    },\n" +
                "    \"effective_time_frame\": {\n" +
                "        \"date_time\": \"2015-10-21T16:29:00-07:00\"\n" +
                "    },\n" +
                "    \"supplemental_oxygen_flow_rate\": {\n" +
                "        \"value\": 2.5,\n" +
                "        \"unit\": \"L/min\"\n" +
                "    },\n" +
                "    \"oxygen_therapy_mode_of_administration\": \"nasal cannula\",\n" +