TagD extends TagW { public static String getDicomPersonName(String name) { if (!StringUtil.hasText(name)) { return StringUtil.EMPTY_STRING; } StringBuilder buf = new StringBuilder(); String[] names = name.split("="); for (int k = 0; k < names.length; k++) { if (k > 0) { buf.append("="); } String[] vals = names[k].split("\\^"); for (int i = 0; i < vals.length; i++) { if (StringUtil.hasText(vals[i])) { if (i == 1 || i >= 3) { buf.append(", "); } else { buf.append(" "); } buf.append(vals[i]); } } } return buf.toString().trim(); } 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 testGetDicomPersonName() throws Exception { String name = TagD.getDicomPersonName(null); assertEquals("", name); name = TagD.getDicomPersonName(" "); assertEquals("", name); name = TagD.getDicomPersonName("Delaney^William^M.^Dr^MD"); assertEquals("Delaney, William M., Dr, MD", name); }