protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException { String[] errors = getUiErrors(null); if (errors != null) { engine.showErrors(errors); return; } ReferralsRecordingListVoCollection voColl = search(createFilter(new ReferralsRecordingListVo())); if (voColl == null || (voColl != null && voColl.size() == 0)) { String[] err = getUiErrors("No record(s) found!"); engine.showErrors(err); return; } else { populateGridDetails(voColl); } form.grdDetails().setFooterValue(form.grdDetails().getRows() != null ? "Total : " + form.grdDetails().getRows().size() : "Total : 0" ); }
private ReferralsRecordingListVo createFilter(ReferralsRecordingListVo filter) { filter.setSpecialtyFunctionCode(form.cmbSpecialty().getValue()); filter.setDiscipline(form.cmbDiscipline().getValue()); filter.setReferralStatus(form.cmbStatus().getValue()); filter.setReferralSource(form.cmbReferal().getValue()); filter.setReferralHCP(form.qmbReferredTo().getValue()); return filter; }
public ReferralsRecordingListVoCollection listByCriteria(ReferralsRecordingListVo filter, Date dateFrom, Date dateTo) { DomainFactory factory = getDomainFactory(); IMSCriteria criteria = new IMSCriteria(ReferralsRecording.class, factory); /*if (filter.getSpecialtyFunctionCodeIsNotNull()) { criteria.equal("specialtyFunctionCode.id", filter.getSpecialtyFunctionCode().getID()); }*/ if (filter.getDisciplineIsNotNull()) { criteria.equal("discipline.id", filter.getDiscipline().getID()); } if (filter.getReferralStatusIsNotNull()) { criteria.equal("referralStatus.id", filter.getReferralStatus().getID()); } if (filter.getReferralSourceIsNotNull()) { criteria.equal("referralSource.id", filter.getReferralSource().getID()); } if (filter.getReferralHCPIsNotNull()) { criteria.equal("referralHCP.id", filter.getReferralHCP().getID_MemberOfStaff()); } /*if (dateFrom != null && dateTo != null) { criteria.between("dateSent", dateFrom.getDate(), dateTo.getDate()); }*/ List lst = criteria.find(); return (ReferralsRecordingListVoAssembler.createReferralsRecordingListVoCollectionFromReferralsRecording(lst)).sort(); }
private ReferralsRecordingListVoCollection search(ReferralsRecordingListVo filter) { Date dateFrom = form.dteFrom().getValue(); Date dateTo = form.dteTo().getValue(); return domain.listByCriteria(filter, dateFrom, dateTo); }