TagD extends TagW { public static LocalDate getDicomDate(String date) { if (StringUtil.hasText(date)) { try { if (date.length() > 8) { StringBuilder buf = new StringBuilder(8); date.chars().filter(Character::isDigit).forEachOrdered(i -> buf.append((char) i)); return LocalDate.parse(buf.toString().trim(), DICOM_DATE); } return LocalDate.parse(date, DICOM_DATE); } catch (Exception e) { LOGGER.error("Parse DICOM date", e); } } return null; } TagD(int tagID);  TagD(int tagID, int vmMax);  TagD(int tagID, int vmMin, int vmMax);  TagD(int tagID, int vmMin, int vmMax, Object defaultValue);  TagD(int tagID, String privateCreatorID);  TagD(int tagID, String privateCreatorID, int vmMin, int vmMax, Object defaultValue);  TagD(int tagID, String displayedName, String privateCreatorID, int vmMin, int vmMax, Object defaultValue);  TagD(int tagID, String keyword, String displayedName, String privateCreatorID, VR vr, int vmMin, int vmMax,
        Object defaultValue, boolean retired); private  TagD(int tagID, String displayedName, String privateCreatorID, VR vr, int vmMin, int vmMax,
        Object defaultValue); VR getValueRerpesentation(); int getDicomValueMultiplicity(Object value); @Override int hashCode(); @Override boolean equals(Object obj); @Override Object getValue(Object data); @Override boolean isStringFamilyType(); @Override String getFormattedTagValue(Object value, String format); static TagW get(String keyword); static String getKeywordFromTag(int tagID, String privateCreatorID); static TagW get(int tagID); static TagW get(int tagID, String privateCreatorID); static TagW getNullable(int tagID); static TagW getNullable(int tagID, String privateCreatorID); static Object getTagValue(TagReadable tagable, int tagID); static T getTagValue(TagReadable tagable, int tagID, Class<T> type); static TagW[] getTagFromIDs(int... tagID); static TagW getUID(Level level); static LocalDate getDicomDate(String date); static LocalTime getDicomTime(String time); static LocalDateTime getDicomDateTime(TimeZone tz, String value); static LocalDateTime getDicomDateTime(TimeZone tz, String value, boolean ceil); static LocalDateTime dateTime(long dateTimeID, Attributes attributes); static LocalDateTime dateTime(int dateID, int timeID, TagReadable tagable); static String formatDicomDate(LocalDate date); static String formatDicomTime(LocalTime time); static TemporalAccessor getDateFromElement(XMLStreamReader xmler, String attribute, TagType type,
        TemporalAccessor defaultValue); static TemporalAccessor[] getDatesFromElement(XMLStreamReader xmler, String attribute, TagType type,
        TemporalAccessor[] defaultValue); static TemporalAccessor[] getDatesFromElement(XMLStreamReader xmler, String attribute, TagType type,
        TemporalAccessor[] defaultValue, String separator); static String getDicomPeriod(String value); static String getDicomPersonName(String name); static String getDicomPatientSex(String val);  }
@Test public void testGetDicomDate() throws Exception { LocalDate date1 = TagD.getDicomDate("19930822"); assertEquals(LocalDate.of(1993, 8, 22), date1); date1 = TagD.getDicomDate("1993:08:22"); assertEquals(LocalDate.of(1993, 8, 22), date1); }