private void search() { ModalityReportsVoCollection coll = null; try { coll = domain.listModalityReports(form.qmbReports().getValue(), form.cmbModality().getValue(), form.chkDFT().getValue()); } catch (DomainInterfaceException e) { engine.showMessage("Error getting modality reports: " + e.toString()); return; } populateGrid(coll); }
private void populateGrid(ModalityReportsVoCollection coll) { form.grdList().getRows().clear(); //WDEV-17781 if (coll == null || coll.size() == 0) { engine.showMessage("No records found."); return; } for(ModalityReportsVo item : coll) { grdListRow row = form.grdList().getRows().newRow(); row.setclmnModality(item.getModality().getServiceName()); row.setclmnReport(item.getTemplate().getName()); row.setclmnRecording(item.getSysInfo().getCreationUser()); row.setclmnRecordingDate(item.getSysInfo().getCreationDateTime() != null ? item.getSysInfo().getCreationDateTime().toString() : ""); row.setclmnUpdating(item.getSysInfo().getLastupdateUser()); row.setclmnUpdatingDate(item.getSysInfo().getLastupdateDateTime() != null ? item.getSysInfo().getLastupdateDateTime().toString() : ""); row.setValue(item); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) // @Override public ModalityReportsVoCollection listModalityReports(TemplateBoRefVo template, ServiceRefVo modality, Boolean dft) throws DomainInterfaceException { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; DomainFactory factory = getDomainFactory(); hql.append("select m from ModalityReports as m left join m.modality as s"); if(template != null) { cond.append(andStr + "m.template.id = (:TID)"); markers.add("TID"); values.add(template.getID_TemplateBo()); andStr = " and "; } if(modality != null) { cond.append(andStr + "m.modality.id = (:MID)"); markers.add("MID"); values.add(modality.getID_Service()); andStr = " and "; } cond.append(andStr + "m.dFTReport = (:DFT)"); markers.add("DFT"); values.add(dft); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by UPPER(s.serviceName)"); List list = factory.find(hql.toString(), markers, values); return ModalityReportsVoAssembler.createModalityReportsVoCollectionFromModalityReports(list); }
@SuppressWarnings({ "rawtypes", "unchecked" }) public ModalityReportsVoCollection listModalityReports(TemplateBoRefVo template, ServiceRefVo modality, Boolean dft) throws DomainInterfaceException { StringBuffer hql = new StringBuffer(); StringBuffer cond = new StringBuffer(); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; DomainFactory factory = getDomainFactory(); hql.append("select m from ModalityReports as m left join m.modality as s"); if(template != null) { cond.append(andStr + "m.template.id = (:TID)"); markers.add("TID"); values.add(template.getID_TemplateBo()); andStr = " and "; } if(modality != null) { cond.append(andStr + "m.modality.id = (:MID)"); markers.add("MID"); values.add(modality.getID_Service()); andStr = " and "; } cond.append(andStr + "m.dFTReport = (:DFT)"); markers.add("DFT"); values.add(dft); andStr = " and "; if (andStr.equals(" and ")) { hql.append(" where "); } hql.append(cond.toString()); hql.append(" order by s.upperName"); //WDEV-20219 UPPER(s.serviceName) List list = factory.find(hql.toString(), markers, values); return ModalityReportsVoAssembler.createModalityReportsVoCollectionFromModalityReports(list); }