public String getModalityOfSelectedMpps(String mppsIUID) { if (stickyList.isEmpty()) return null; if (mppsIUID == null) { return ((MPPSEntry) stickyList.values().iterator().next()).getModality(); } else { MPPSEntry entry = (MPPSEntry) stickyList.get(mppsIUID); return entry == null ? null : entry.getModality(); } }
public String getStartDateOfSelectedMpps(String mppsIUID) { if (stickyList.isEmpty()) return null; String startDate = null; if (mppsIUID == null) { startDate = ((MPPSEntry) stickyList.values().iterator().next()).getPpsStartDateTime(); } else { MPPSEntry entry = (MPPSEntry) stickyList.get(mppsIUID); if (entry != null) { startDate = entry.getPpsStartDateTime(); } } if (startDate != null && startDate.length() > 10) // shrink to yyyy/mm/dd startDate = startDate.substring(0, 10); return startDate; }
/** * @param stickies The stickies to set. * @param check */ public void setMppsIUIDs(String[] stickies, boolean check) { this.mppsIUIDs = stickies; stickyList = new HashMap(); if (mppsEntries.isEmpty() || mppsIUIDs == null || mppsIUIDs.length < 1) return; MPPSEntry stickyEntry = (MPPSEntry) mppsEntries.get(mppsIUIDs[0]); String patID = stickyEntry.getPatientID(); stickyList.put(mppsIUIDs[0], stickyEntry); for (int i = 1; i < mppsIUIDs.length; i++) { stickyEntry = (MPPSEntry) mppsEntries.get(mppsIUIDs[i]); if (check && !patID.equals(stickyEntry.getPatientID())) { throw new IllegalArgumentException("All selected MPPS must have the same patient!"); } stickyList.put(mppsIUIDs[i], stickyEntry); } }
/** * Update the list of MPPSEntries for the view. * * <p>The query use the search criteria values from the filter and use offset and limit for * paging. * * <p>if <code>newSearch is true</code> will reset paging (set <code>offset</code> to 0!) * * @param newSearch */ public void filterWorkList(boolean newSearch) { int total = 0; int limit = getLimit(); int offset = getOffset(); if (newSearch) { setOffset(0); total = MPPSConsoleCtrl.getMppsDelegate().countMppsEntries(this.mppsFilter); setTotal(total); } List<Dataset> l = MPPSConsoleCtrl.getMppsDelegate().findMppsEntries(this.mppsFilter, offset, limit); if (l == null) { this.setPopupMsg("mpps.err", "findMppsEntries"); return; } if (l.size() == limit) { offset += limit; } mppsEntries.clear(); if (stickyList != null) { mppsEntries.putAll(stickyList); } MPPSEntry entry; int countNull = 0; for (Dataset ds : l) { if (ds != null) { entry = new MPPSEntry(ds); mppsEntries.put(entry.getMppsIUID(), entry); } else { countNull++; } } if (countNull > 0) { log.warn("List of MPPS entries contains null entries! countNull:" + countNull); } }