public NursingClinicalNotesVoCollection listClinicalNotesForCarePlanAndDateRange(CarePlanRefVo carePlanRefVo, Date dateFrom, Date dateTo, Boolean activeOnly) { if (carePlanRefVo != null && carePlanRefVo.getID_CarePlan() == null || dateFrom == null || dateTo == null || activeOnly == null) throw new CodingRuntimeException("Mandatory arguments not supplied to listClinicalNotesForCarePlanAndDateRange method"); String hql = "from NursingClinicalNotes ncn join fetch ncn.carePlans as carePlan where carePlan.id = :idCarePlan and (ncn.recordingDateTime >= :startDate and ncn.recordingDateTime < :endDate ) "; if(activeOnly == true) { // WDEV-7771 //hql += "and ncn.currentStatus.status.id = '" + ClinicalNotesStatus.ACTIVE.getID() + "'"; //hql += "and ncn.currentStatus.correctionConfirmed != 1"; hql += "and ncn.isCorrected <> 1"; //WDEV-15049 } List notes = getDomainFactory().find(hql, new String[]{"idCarePlan", "startDate", "endDate"},new Object[]{carePlanRefVo.getID_CarePlan(), dateFrom.getDate(), dateTo.copy().addDay(1).getDate()}); return NursingClinicalNotesVoAssembler.createNursingClinicalNotesVoCollectionFromNursingClinicalNotes(notes); }
private void populateClinicalNotes(NursingClinicalNotesVoCollection clinNotesColl) { GenForm.gridNotesRow row; if (clinNotesColl != null) { for (int i = 0; i < clinNotesColl.size(); i++) { ClinicalNotesVo clinNote = clinNotesColl.get(i); row = form.gridNotes().getRows().newRow(); row.setcolNote(clinNote.getClinicalNote()); if (clinNote.getAuthoringInfo() != null && //WDEV-3852 clinNote.getAuthoringInfo().getAuthoringHcp() != null) row.setcolBy(clinNote.getAuthoringInfo().getAuthoringHcp().getName().toString()); row.setcolDateTime(clinNote.getRecordingDateTime()); row.setcolNoteType(clinNote.getNoteTypeIsNotNull() ? clinNote.getNoteType().toString() : "Clinical");//wdev-13781 row.setcolStatus(clinNote.getCurrentStatusIsNotNull() && clinNote.getCurrentStatus().getStatusIsNotNull() ? clinNote.getCurrentStatus().getStatus().toString() : "");//wdev-13781 //WDEV-14553 if (clinNote.getCurrentStatusIsNotNull() && clinNote.getCurrentStatus().getCorrectedByIsNotNull()) { StringBuffer noteToDisplay = new StringBuffer(""); noteToDisplay.append(clinNote.getClinicalNote()+"\n"); noteToDisplay.append("Corrected By: "+ clinNote.getCurrentStatus().getCorrectedBy().toString()); if (clinNote.getCurrentStatus().getDateTimeIsNotNull()) { noteToDisplay.append( " on " +clinNote.getCurrentStatus().getDateTime().getDate()+ " at " + clinNote.getCurrentStatus().getDateTime().getTime() ); } if (clinNote.getCurrentStatus().getCorrectionReasonIsNotNull()) { noteToDisplay.append(" for the following reason: "+clinNote.getCurrentStatus().getCorrectionReason()); } row.setcolNote(noteToDisplay.toString()); //WDEV-15029 row.setTooltipForcolNote(noteToDisplay.toString()); } else { row.setcolNote(clinNote.getClinicalNote()); //WDEV-15029 row.setTooltipForcolNote(clinNote.getClinicalNote()); } row.setSelectable(false); } } }