public int compare(Object obj1, Object obj2) { NursingClinicalNotesListVo voObject1 = (NursingClinicalNotesListVo) obj1; NursingClinicalNotesListVo voObject2 = (NursingClinicalNotesListVo) obj2; if (order == 0) { return -1 * (voObject1.getRecordingDateTime().getJavaDate().compareTo(voObject2.getRecordingDateTime().getJavaDate())); } else if (order == 1) { return (voObject1.getRecordingDateTime().getJavaDate().compareTo(voObject2.getRecordingDateTime().getJavaDate())); } return 1; }
private void listNotes() { form.getLocalContext().setsortOrder(0); form.btnPrintReport().setEnabled(false); form.gridNotes().getRows().clear(); CareContextShortVo careContextVo = form.getGlobalContext().Core.getCurrentCareContext(); NursingClinicalNotesListVoCollection notesColl = domain.listClinicNotes(form.dateFrom().getValue(), form.dateTo().getValue(), new Boolean(form.chkActiveOnly().getValue()), careContextVo); form.getLocalContext().setClinicalNotesColl(notesColl); if (notesColl != null) { GenForm.gridNotesRow row; NursingClinicalNotesListVo notes; for (int i = 0; i < notesColl.size(); i++) { notes = notesColl.get(i); row = form.gridNotes().getRows().newRow(); if (notes.getAuthoringInformationIsNotNull()) { if (notes.getAuthoringInformation().getAuthoringHcpIsNotNull()) row.setcolBy(notes.getAuthoringInformation().getAuthoringHcp().toString()); } if (notes.getRecordingDateTime() != null) { row.setcolDate(notes.getRecordingDateTime().toString()); } if (notes.getIsCorrected() != null && notes.getIsCorrected().booleanValue() == true && notes.getCurrentStatus().getCorrectionReasonIsNotNull() && notes.getCurrentStatus().getCorrectedByIsNotNull() && notes.getCurrentStatus().getDateTimeIsNotNull()) // Correction has been added { String strHCPCorrection = ""; if (notes.getCurrentStatusIsNotNull()) { if (notes.getCurrentStatus().getCorrectedByIsNotNull()) strHCPCorrection = notes.getCurrentStatus().getCorrectedBy().getName().toString(); } row.setcolNote(notes.getClinicalNote() + "\nCorrected By: " + strHCPCorrection + " on " + notes.getCurrentStatus().getDateTime().getDate() + " at " + notes.getCurrentStatus().getDateTime().getTime() + " for the following reason:\n" + notes.getCurrentStatus().getCorrectionReason()); } else { row.setcolNote(notes.getClinicalNote()); } row.setValue(notes); refreshSearchCriteriaFilter(); //wdev-10788 } form.btnPrintReport().setEnabled(! engine.isRIEMode()); //WDEV-15079 form.gridNotes().setSelectable(! engine.isRIEMode()); //WDEV-15114 } if(form.gridNotes().getRows().size() < 1) form.getGlobalContext().Nursing.setClinicalNotesViewFilter(null); //wdev-10788 }
private void populateGrid(NursingClinicalNotesListVoCollection gridContents) { form.gridNotes().getRows().clear(); if (gridContents != null) { GenForm.gridNotesRow row; NursingClinicalNotesListVo notes; for (int i = 0; i < gridContents.size(); i++) { notes = gridContents.get(i); row = form.gridNotes().getRows().newRow(); if (notes.getAuthoringInformationIsNotNull()) { if (notes.getAuthoringInformation().getAuthoringHcpIsNotNull()) row.setcolBy(notes.getAuthoringInformation().getAuthoringHcp().toString()); } if (notes.getRecordingDateTime() != null) { row.setcolDate(notes.getRecordingDateTime().toString()); } if (notes.getIsCorrected() != null && notes.getIsCorrected().booleanValue() == true && notes.getCurrentStatus().getCorrectionReasonIsNotNull() && notes.getCurrentStatus().getCorrectedByIsNotNull() && notes.getCurrentStatus().getDateTimeIsNotNull()) // Correction has been added { String strHCPCorrection = ""; if (notes.getCurrentStatusIsNotNull()) { if (notes.getCurrentStatus().getCorrectedByIsNotNull()) strHCPCorrection = notes.getCurrentStatus().getCorrectedBy().getName().toString(); } row.setcolNote(notes.getClinicalNote() + "\nCorrected By: " + strHCPCorrection + " on " + notes.getCurrentStatus().getDateTime().getDate() + " at " + notes.getCurrentStatus().getDateTime().getTime() + " for the following reason:\n" + notes.getCurrentStatus().getCorrectionReason()); } else { row.setcolNote(notes.getClinicalNote()); } row.setValue(notes); } } }