public int compare(EmergencyAttendanceListVo o1, EmergencyAttendanceListVo o2) { if (o1.getAttendanceDateIsNotNull() && o2.getAttendanceDateIsNotNull()) { return o1.getAttendanceDate().compareTo(o2.getAttendanceDate()) * direction; } if (o1.getAttendanceDateIsNotNull() && !o2.getAttendanceDateIsNotNull()) { return direction; } if (o2.getAttendanceDateIsNotNull() && !o1.getAttendanceDateIsNotNull()) { return -1 * direction; } return 0; }
public int compare(EmergencyAttendanceListVo o1, EmergencyAttendanceListVo o2) { if (o1.getInjuryDateIsNotNull() && o2.getInjuryDateIsNotNull()) { return o1.getInjuryDate().compareTo(o2.getInjuryDate()) * direction; } if (o1.getInjuryDateIsNotNull() && !o2.getInjuryDateIsNotNull()) { return direction; } if (o2.getInjuryDateIsNotNull() && !o1.getInjuryDateIsNotNull()) { return -1 * direction; } return 0; }
private void displayData(EmergencyAttendanceListVoCollection list) { form.grdDetails().getRows().clear(); if(list == null) return; for (int i = 0; i < list.size(); i++) { grdDetailsRow row = form.grdDetails().getRows().newRow(); EmergencyAttendanceListVo item = list.get(i); row.setColAttDateTime(item.getAttendanceDateIsNotNull() ? item.getAttendanceDate().toString() : null); row.setColHospNo(item.getHospitalNo()); row.setColPatient((item.getSurname() == null ? "" : item.getSurname()) + " " + (item.getForename() == null ? "" : item.getForename())); row.setColCategory(item.getPatientCategory()); row.setColComplaint(item.getPresentingComplaint()); row.setColInjury(item.getInjuryDateIsNotNull() ? item.getInjuryDate().toString() : null); EmergencyAttendanceRefVo ref = new EmergencyAttendanceRefVo(); ref.setID_EmergencyAttendance(item.getId()); row.setValue(ref); if(item.getDischargeDateIsNotNull()) row.setBackColor(Color.LightGreen); } }
private void displayData(EmergencyAttendanceListVoCollection list) { form.grdDetails().getRows().clear(); if(list == null || list.size() == 0) { engine.showMessage("No records found."); return; } for (int i = 0; i < list.size(); i++) { grdDetailsRow row = form.grdDetails().getRows().newRow(); EmergencyAttendanceListVo item = list.get(i); row.setColAttDateTime(item.getAttendanceDateIsNotNull() ? item.getAttendanceDate().toString() : null); row.setColHospNo(item.getHospitalNo()); row.setColPatient((item.getSurname() == null ? "" : item.getSurname()) + " " + (item.getForename() == null ? "" : item.getForename())); row.setColCategory(item.getPatientCategory()); row.setColComplaint(item.getPresentingComplaint()); row.setColRequiresDischargeDocumentationReview(Boolean.TRUE.equals(item.getRequiresDischargeDocumentationReview()) ? form.getImages().Core.Attachment16 : null); row.setTooltipForColRequiresDischargeDocumentationReview(Boolean.TRUE.equals(item.getRequiresDischargeDocumentationReview()) ? "Requires Discharge Documentation Review" : null); row.setColIncidentTime(item.getInjuryDateIsNotNull() ? item.getInjuryDate().toString() : null); //WDEV-19396 EmergencyAttendanceRefVo ref = new EmergencyAttendanceRefVo(); ref.setID_EmergencyAttendance(item.getId()); row.setValue(ref); if(item.getDischargeDateIsNotNull()) row.setBackColor(Color.LightGreen); } }
public int compare(Object ob1, Object ob2) { Integer isReqDischDoc1 = 0; Integer isReqDischDoc2 = 0; if (ob1 instanceof EmergencyAttendanceListVo) { EmergencyAttendanceListVo o1 = (EmergencyAttendanceListVo) ob1; isReqDischDoc1 = (Boolean.TRUE.equals(o1.getRequiresDischargeDocumentationReview()) ? 1 : 0); } if (ob2 instanceof EmergencyAttendanceListVo) { EmergencyAttendanceListVo o2 = (EmergencyAttendanceListVo) ob2; isReqDischDoc2 = (Boolean.TRUE.equals(o2.getRequiresDischargeDocumentationReview()) ? 1 : 0); } if (isReqDischDoc1 != 0 && isReqDischDoc2 != 0) { return isReqDischDoc1.compareTo(isReqDischDoc2) * direction; } if (isReqDischDoc1 != 0 && isReqDischDoc2 == 0) { return direction; } if (isReqDischDoc2 != 0 && isReqDischDoc1 == 0) { return -1 * direction; } return 0; }