private void addAttributes(int tag, VR vr, String privateCreator) { if (privateCreator != null) tag &= 0xffff00ff; if (includeKeyword) { String keyword = ElementDictionary.keywordOf(tag, privateCreator); if (keyword != null && !keyword.isEmpty()) addAttribute("keyword", keyword); } addAttribute("tag", TagUtils.toHexString(tag)); if (privateCreator != null) addAttribute("privateCreator", privateCreator); addAttribute("vr", vr.name()); }
private void startElement(String name, String attrName, String attrValue) throws SAXException { addAttribute(attrName, attrValue); startElement(name); }
private void writeBulkData(BulkData bulkData) throws SAXException { if (bulkData.getUUID() != null) addAttribute("uuid", bulkData.getUUID()); if (bulkData.getURI() != null) addAttribute("uri", bulkData.getURI()); startElement("BulkData"); endElement("BulkData"); }
private void writeValues(VR vr, Object val, boolean bigEndian, SpecificCharacterSet cs) throws SAXException { if (vr.isStringType()) val = vr.toStrings(val, bigEndian, cs); int vm = vr.vmOf(val); for (int i = 0; i < vm; i++) { String s = vr.toString(val, bigEndian, i, null); addAttribute("number", Integer.toString(i + 1)); if (vr == VR.PN) { PersonName pn = new PersonName(s, true); startElement("PersonName"); writePNGroup("Alphabetic", pn, PersonName.Group.Alphabetic); writePNGroup("Ideographic", pn, PersonName.Group.Ideographic); writePNGroup("Phonetic", pn, PersonName.Group.Phonetic); endElement("PersonName"); } else { writeElement("Value", s); } } }