Search in sources :

Example 11 with DvTime

use of com.nedap.archie.rm.datavalues.quantity.datetime.DvTime in project openEHR_SDK by ehrbase.

the class DvTimeValidatorTest method testValidate_Range.

@Test
void testValidate_Range() throws Exception {
    var node = parseNode("/webtemplate_nodes/dv_time_range.json");
    OffsetDateTime value;
    var result = validator.validate(new DvTime(LocalTime.of(11, 30)), node);
    assertTrue(result.isEmpty());
    result = validator.validate(new DvTime(LocalTime.of(8, 30)), node);
    assertEquals(1, result.size());
    result = validator.validate(new DvTime(LocalTime.of(20, 30)), node);
    assertEquals(1, result.size());
}
Also used : OffsetDateTime(java.time.OffsetDateTime) DvTime(com.nedap.archie.rm.datavalues.quantity.datetime.DvTime) Test(org.junit.jupiter.api.Test)

Aggregations

DvTime (com.nedap.archie.rm.datavalues.quantity.datetime.DvTime)11 DvTimeAttributes (org.ehrbase.serialisation.attributes.datavalues.datetime.time.DvTimeAttributes)3 Test (org.junit.Test)3 Test (org.junit.jupiter.api.Test)3 Format (java.text.Format)2 ZoneOffset (java.time.ZoneOffset)2 StatusesTest (care.better.platform.web.template.StatusesTest)1 Composition (com.nedap.archie.rm.composition.Composition)1 DvDate (com.nedap.archie.rm.datavalues.quantity.datetime.DvDate)1 DvDuration (com.nedap.archie.rm.datavalues.quantity.datetime.DvDuration)1 OffsetDateTime (java.time.OffsetDateTime)1 RMDataFormat (org.ehrbase.serialisation.RMDataFormat)1