@Override //WDEV-15819 protected void onDyngrdTrackColumnHeaderClicked(DynamicGridColumn column) { TrackingVoCollection patients = form.getLocalContext().getTrackingPatients(); if(patients == null || patients.size() == 0)//WDEV-17310 return; alternateSortOrder(column); patients.sort(new TrackingPatientsComparator((TrackingAreaColumn) column.getIdentifier(), form.getLocalContext().getSortOrder().getSortOrder())); populateRecordsToGrid(form.getLocalContext().getTrackingPatients()); }
private void populateRecordsToGrid(TrackingVoCollection trackingPatients) { form.dyngrdTrack().getRows().clear(); for(TrackingVo trackingPatient : trackingPatients) { addTrackingPatientRow(trackingPatient); } form.dyngrdTrack().setValue(form.getLocalContext().getSelectedTrackingPatient()); trackingSelectionChanged(); }
private void populateTrackingGrid() { initializeTrackingGrid(); clearContext(); //WDEV-15971 clearPriorityLocalContexts(); if(!(form.grdTrackingCount().getValue() instanceof TrackingAreaForTrackingVo)) return; boolean isViewMyAllocated = false; if(GroupViewEnumeration.rdoViewMyAllocated.equals(form.GroupView().getValue()))//WDEV-16987 { isViewMyAllocated = true; if(form.getLocalContext().getLoggedHcpRef() == null) return; } TrackingAreaForTrackingVo trackingArea = (TrackingAreaForTrackingVo) form.grdTrackingCount().getValue(); //WDEV-17259 Boolean wasPatientStatusColumnAdded = Boolean.FALSE; for (int x = 0; x < trackingArea.getColumns().size(); x++) { if (TrackingAreaColumn.PATIENT_CURRENT_STATUS.equals(trackingArea.getColumns().get(x).getColumn())) wasPatientStatusColumnAdded = Boolean.TRUE; } //create a dummy column so the the domain will return values for the CurrentStatus.Status field if (Boolean.FALSE.equals(wasPatientStatusColumnAdded)) { ColumnDetailVo dummyColumn = new ColumnDetailVo(); dummyColumn.setColumn(TrackingAreaColumn.PATIENT_CURRENT_STATUS); trackingArea.getColumns().add(dummyColumn); } TrackingVoCollection trackingPatients = domain.listTrackingPatients(trackingArea, Boolean.TRUE.equals(isViewMyAllocated) ? form.getLocalContext().getLoggedHcpRef() : null, null, GroupViewEnumeration.rdoViewUnallocated.equals(form.GroupView().getValue()), GroupDisplayEnumeration.rdoCurrentlyInDept.equals(form.GroupDisplay().getValue()),GroupDisplayEnumeration.rdoDeparted.equals(form.GroupDisplay().getValue()),GroupDisplayEnumeration.rdoCurrentAndDeparted.equals(form.GroupDisplay().getValue()));//WDEV-16987 form.getLocalContext().setTrackingPatients(trackingPatients); if(trackingPatients == null) return; //WDEV-16534 if (form.getLocalContext().getSortOrder() != null) { trackingPatients.sort(new TrackingPatientsComparator((TrackingAreaColumn) form.getLocalContext().getSortOrder().getColumnType(), form.getLocalContext().getSortOrder().getSortOrder())); } else trackingPatients.sort(new TrackingComparator()); for(TrackingVo trackingPatient : trackingPatients) { addTrackingPatientRow(trackingPatient); } form.dyngrdTrack().setValue(form.getLocalContext().getSelectedTrackingPatient()); trackingSelectionChanged(); populatePriorityLabels();//WDEV-15971 }