/** * List Transfer Notes */ public TransferNoteCollection listTransferNotes(CareContextShortVo careContextShortVo) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from TransferNote t "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (careContextShortVo != null) { hql.append(andStr + " t.careContext.id = :rcc"); markers.add("rcc"); values.add(careContextShortVo.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List procs = factory.find(query, markers, values); return TransferNoteAssembler.createTransferNoteCollectionFromTransferNote(procs).sort(SortOrder.DESCENDING); }
private void load() { form.setMode(FormMode.VIEW); form.grdTransfer().getRows().clear(); form.btnPrint().setEnabled(false); form.btnUpdate().setEnabled(false); clearScreen(); // cm TransferNoteCollection voColl = // domain.listTransferNotes(form.getGlobalContext().Core.getClinicalEpisode());.getRootContactDetails() TransferNoteCollection voColl = domain.listTransferNotes(form.getGlobalContext().Core.getCurrentCareContext()); GenForm.grdTransferRow row = null; if (voColl != null) { for (int i = 0; i < voColl.size(); i++) { row = form.grdTransfer().getRows().newRow(); if (voColl.get(i).getSysInfoIsNotNull() && voColl.get(i).getSysInfo().getCreationUser() != null) { MemberOfStaffShortVo mosUser = (MemberOfStaffShortVo) domain.getMosUser(voColl.get(i).getSysInfo().getCreationUser().toString()); if (mosUser != null) row.setColHCP(mosUser.getName().toString()); } row.setColNote(voColl.get(i).getTransferNote()); if (voColl.get(i).getTransferDate() != null) row.setColDateTime(voColl.get(i).getTransferDate().toString()); // row.setCollapsedImage() row.setValue(voColl.get(i)); } } }