/** * WDEV-13136 * Function used to sort discharge records */ private void sortDischargeRecords(int column) { // Get discharge records from grid InpatientEpisodeForPendingDischargesVoCollection records = form.grdDischarges().getValues(); // Toggle sort order for column sortOrderToggle(column); // Determine column - sort records after it if (COL_AGE == column) { records.sort(InpatientEpisodeForPendingDischargesVo.getAgeComparator(form.getLocalContext().getSortOrderAge())); } else if (COL_ESTIMATED_DISCHAGE_DATETIME == column) { records.sort(InpatientEpisodeForPendingDischargesVo.getDateTimeComparator(form.getLocalContext().getSortOrder())); } // Get selection InpatientEpisodeForPendingDischargesVo selectedValue = form.grdDischarges().getValue(); // Re-populate grid form.grdDischarges().getRows().clear();//wdev-14522 populateGrid(records, null); // Update selection form.grdDischarges().setValue(selectedValue); }
/** * WDEV-13136 * Function used to sort discharge records */ private void sortDischargeRecords(int column) { // Get discharge records from grid InpatientEpisodeForPendingDischargesVoCollection records = form.grdDischarges().getValues(); //no need to sort less than 2 records if (records.size() < 2) //WDEV-20835 return; // Toggle sort order for column sortOrderToggle(column); // Determine column - sort records after it if (COL_AGE == column) { //records.sort(InpatientEpisodeForPendingDischargesVo.getAgeComparator(form.getLocalContext().getSortOrderAge())); records.sort(new AgeDOBComparator(form.getLocalContext().getSortOrderAge())); //wdev-21464 } else if (COL_ESTIMATED_DISCHAGE_DATETIME == column) { records.sort(InpatientEpisodeForPendingDischargesVo.getDateTimeComparator(form.getLocalContext().getSortOrder())); } // Get selection InpatientEpisodeForPendingDischargesVo selectedValue = form.grdDischarges().getValue(); // Re-populate grid form.grdDischarges().getRows().clear();//wdev-14522 populateGrid(records, null); // Update selection form.grdDischarges().setValue(selectedValue); }
private void populateGrid(InpatientEpisodeForPendingDischargesVoCollection discharges, InpatientEpisodeForPendingDischargesVo voToFind) { for (InpatientEpisodeForPendingDischargesVo item : discharges) { grdDischargesRow row = form.grdDischarges().getRows().newRow(); row.setValue(item); if(item.getPasEventIsNotNull()) if (item.getPasEvent().getPatientIsNotNull()) { item.getPasEvent().getPatient().calculateAge(); row.setColHOSNUM(item.getPasEvent().getPatient().getHospnum().getValue()); if (item.getPasEvent().getPatient().getAgeIsNotNull()) row.setcolAge(item.getPasEvent().getPatient().getAge().toString()); if (item.getPasEvent().getPatient().getSexIsNotNull()) row.setColPatSex(item.getPasEvent().getPatient().getSex().getText()); if (item.getPasEvent().getPatient().getNameIsNotNull()) if (item.getPasEvent().getPatient().getName().getSurnameIsNotNull()) row.setColSurname(item.getPasEvent().getPatient().getName().getSurname()); if (item.getPasEvent().getPatient().getName().getForenameIsNotNull()) row.setColForename(item.getPasEvent().getPatient().getName().getForename()); } if (item.getPasEvent().getConsultantIsNotNull()) if (item.getPasEvent().getConsultant().getMosIsNotNull()) if (item.getPasEvent().getConsultant().getMos().getNameIsNotNull()) row.setColConsultant(item.getPasEvent().getConsultant().getMos().getName().toString()); if (item.getPasEvent().getLocationIsNotNull()) if (item.getPasEvent().getLocation().getNameIsNotNull()) row.setColWard(item.getPasEvent().getLocation().getName()); if (item.getBedIsNotNull()) if (item.getBed().getBedSpaceIsNotNull()) if (item.getBed().getBedSpace().getBedSpaceTypeIsNotNull()) row.setColLocation(item.getBed().getBedSpace().getBedSpaceType().getText()); if (item.getEstDischargeDateIsNotNull()) row.setColDateTime(item.getEstDischargeDate().toString()); if(item.isDischargeDueWithin24Hrs()) { if(item.getIsConfirmedDischarge() == null || item.getIsConfirmedDischarge().equals(false)) row.setBackColor(Color.Orange); else if(item.getIsConfirmedDischargeIsNotNull() && item.getIsConfirmedDischarge().equals(true)) row.setBackColor(Color.Red); } if (voToFind != null && voToFind.equals(item)) form.grdDischarges().setValue(voToFind); } }