@Test public void testParsePointInTime() { PointInTime t = HL7DateTimeFormat.toPointInTime("1975"); Assert.assertEquals(Precision.YEAR, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); t = HL7DateTimeFormat.toPointInTime("197507"); Assert.assertEquals(Precision.MONTH, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); Assert.assertEquals(7, t.getMonth()); t = HL7DateTimeFormat.toPointInTime("19750723"); Assert.assertEquals(Precision.DATE, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); Assert.assertEquals(7, t.getMonth()); Assert.assertEquals(23, t.getDate()); t = HL7DateTimeFormat.toPointInTime("1975072315"); Assert.assertEquals(Precision.HOUR, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); Assert.assertEquals(7, t.getMonth()); Assert.assertEquals(23, t.getDate()); Assert.assertEquals(15, t.getHour()); t = HL7DateTimeFormat.toPointInTime("197507231057"); Assert.assertEquals(Precision.MINUTE, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); Assert.assertEquals(7, t.getMonth()); Assert.assertEquals(23, t.getDate()); Assert.assertEquals(10, t.getHour()); Assert.assertEquals(57, t.getMinute()); t = HL7DateTimeFormat.toPointInTime("19750723105713"); Assert.assertEquals(Precision.SECOND, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); Assert.assertEquals(7, t.getMonth()); Assert.assertEquals(23, t.getDate()); Assert.assertEquals(10, t.getHour()); Assert.assertEquals(57, t.getMinute()); Assert.assertEquals(13, t.getSecond()); t = HL7DateTimeFormat.toPointInTime("19981118071"); Assert.assertEquals(Precision.MINUTE, t.getPrecision()); Assert.assertEquals(1998, t.getYear()); Assert.assertEquals(11, t.getMonth()); Assert.assertEquals(18, t.getDate()); Assert.assertEquals(7, t.getHour()); Assert.assertEquals(10, t.getMinute()); t = HL7DateTimeFormat.toPointInTime("1997071107171"); Assert.assertEquals(Precision.SECOND, t.getPrecision()); Assert.assertEquals(1997, t.getYear()); Assert.assertEquals(7, t.getMonth()); Assert.assertEquals(11, t.getDate()); Assert.assertEquals(7, t.getHour()); Assert.assertEquals(17, t.getMinute()); Assert.assertEquals(10, t.getSecond()); t = HL7DateTimeFormat.toPointInTime("199901211"); Assert.assertEquals(Precision.HOUR, t.getPrecision()); Assert.assertEquals(1999, t.getYear()); Assert.assertEquals(1, t.getMonth()); Assert.assertEquals(21, t.getDate()); Assert.assertEquals(10, t.getHour()); t = HL7DateTimeFormat.toPointInTime("1999012110"); Assert.assertEquals(Precision.HOUR, t.getPrecision()); Assert.assertEquals(1999, t.getYear()); Assert.assertEquals(1, t.getMonth()); Assert.assertEquals(21, t.getDate()); Assert.assertEquals(10, t.getHour()); t = HL7DateTimeFormat.toPointInTime("19990121100"); Assert.assertEquals(Precision.MINUTE, t.getPrecision()); Assert.assertEquals(1999, t.getYear()); Assert.assertEquals(1, t.getMonth()); Assert.assertEquals(21, t.getDate()); Assert.assertEquals(10, t.getHour()); Assert.assertEquals(0, t.getMinute()); t = HL7DateTimeFormat.toPointInTime("197500000"); Assert.assertEquals(Precision.YEAR, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); t = HL7DateTimeFormat.toPointInTime("19750000000"); Assert.assertEquals(Precision.YEAR, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); t = HL7DateTimeFormat.toPointInTime("19981118070"); Assert.assertEquals(Precision.MINUTE, t.getPrecision()); Assert.assertEquals(1998, t.getYear()); Assert.assertEquals(11, t.getMonth()); Assert.assertEquals(18, t.getDate()); Assert.assertEquals(7, t.getHour()); Assert.assertEquals(0, t.getMinute()); t = HL7DateTimeFormat.toPointInTime("1997071107170"); Assert.assertEquals(Precision.SECOND, t.getPrecision()); Assert.assertEquals(1997, t.getYear()); Assert.assertEquals(7, t.getMonth()); Assert.assertEquals(11, t.getDate()); Assert.assertEquals(7, t.getHour()); Assert.assertEquals(17, t.getMinute()); Assert.assertEquals(0, t.getSecond()); t = HL7DateTimeFormat.toPointInTime("1975000000000"); Assert.assertEquals(Precision.YEAR, t.getPrecision()); Assert.assertEquals(1975, t.getYear()); t = HL7DateTimeFormat.toPointInTime("200704111432-0700"); Assert.assertEquals(Precision.MINUTE, t.getPrecision()); Assert.assertEquals(2007, t.getYear()); Assert.assertEquals(4, t.getMonth()); Assert.assertEquals(11, t.getDate()); Assert.assertEquals(14, t.getHour()); Assert.assertEquals(32, t.getMinute()); }
public static PointInTime toPointInTime(String text) { return parse(text); }
HL7DateTimeFormat { public static PointInTime toPointInTime(String text) { return parse(text); } }
HL7DateTimeFormat { public static PointInTime toPointInTime(String text) { return parse(text); } protected  HL7DateTimeFormat(); }
HL7DateTimeFormat { public static PointInTime toPointInTime(String text) { return parse(text); } protected  HL7DateTimeFormat(); static DateTimeFormatter dateTime(); static DateTimeFormatter forPointInTime(PointInTime t); static DateTimeFormatter forPrecision(Precision p); static PointInTimeFormatter pointInTimeParser(); static PointInTime parse(String text); static PointInTime toPointInTime(String text); static LocalDateTime toLocalDateTime(String text); }
HL7DateTimeFormat { public static PointInTime toPointInTime(String text) { return parse(text); } protected  HL7DateTimeFormat(); static DateTimeFormatter dateTime(); static DateTimeFormatter forPointInTime(PointInTime t); static DateTimeFormatter forPrecision(Precision p); static PointInTimeFormatter pointInTimeParser(); static PointInTime parse(String text); static PointInTime toPointInTime(String text); static LocalDateTime toLocalDateTime(String text);  }