private static Attributes storeTo(RejectionNote ac, BasicAttributes attrs) { attrs.put("objectclass", "dcmRejectionNote"); storeNotNull(attrs, "dcmCodeValue", ac.getCodeValue()); storeNotNull(attrs, "dcmCodingSchemeDesignator", ac.getCodingSchemeDesignator()); storeNotNull(attrs, "dcmCodingSchemeVersion", ac.getCodingSchemeVersion()); storeNotNull(attrs, "dcmCodeMeaning", ac.getCodeMeaning()); storeNotEmpty(attrs, "dcmRejectionAction", ac.getActions().toArray()); return attrs; }
private static String dnOf(RejectionNote rn, String parentDN) { StringBuilder sb = new StringBuilder(); sb.append("dcmCodeValue=").append(rn.getCodeValue()); sb.append("+dcmCodingSchemeDesignator=").append(rn.getCodingSchemeDesignator()); if (rn.getCodingSchemeVersion() != null) sb.append("+dcmCodingSchemeVersion=").append(rn.getCodingSchemeVersion()); sb.append(',').append(parentDN); return sb.toString(); }
private List<ModificationItem> storeDiffs( RejectionNote prev, RejectionNote rn, ArrayList<ModificationItem> mods) { // storeDiff(mods, "dcmCodeValue", prev.getCodeValue(), rn.getCodeValue()); // storeDiff(mods, "dcmCodingSchemeDesignator", // prev.getCodingSchemeDesignator(), // rn.getCodingSchemeDesignator()); // storeDiff(mods, "dcmCodingSchemeVersion", // prev.getCodingSchemeVersion(), // rn.getCodingSchemeVersion()); storeDiff(mods, "dcmCodeMeaning", prev.getCodeMeaning(), rn.getCodeMeaning()); storeDiff(mods, "dcmRejectionAction", prev.getActions().toArray(), rn.getActions().toArray()); return mods; }
private RejectionNote findMatching(List<RejectionNote> rns, RejectionNote rn) { for (RejectionNote other : rns) if (other.matches(rn)) return other; return null; }
private void loadRejectionActionsFrom(RejectionNote rn, Attribute attr) throws NamingException { if (attr != null) for (int i = 0, n = attr.size(); i < n; i++) rn.addAction(RejectionNote.Action.valueOf((String) attr.get(i))); }