public CarePlanEvaluationNoteCollection listEvaluationNotesforCarePlanAndByDateRange(CarePlanRefVo carePlanRefVo, Date dateFrom, Date dateTo, Boolean activeOnly) { if (carePlanRefVo != null && carePlanRefVo.getID_CarePlan() == null || dateFrom == null || dateTo == null) throw new CodingRuntimeException("Mandatory arguments not supplied to listClinicalNotesForCarePlanAndDateRange method"); String hql = "from ims.nursing.careplans.domain.objects.CarePlanEvaluationNote cpen where cpen.carePlan.id = :idCarePlan and (cpen.recordedDateTime >= :startDate and cpen.recordedDateTime < :endDate ) "; if(activeOnly == true) hql += "and cpen.active = true"; List notes = getDomainFactory().find(hql, new String[]{"idCarePlan", "startDate", "endDate"},new Object[]{carePlanRefVo.getID_CarePlan(), dateFrom.getDate(), dateTo.copy().addDay(1).getDate()}); return CarePlanEvaluationNoteAssembler.createCarePlanEvaluationNoteCollectionFromCarePlanEvaluationNote(notes); }
private void populateEvaluationNotes(CarePlanEvaluationNoteCollection coll) { if (coll != null && coll.size() != 0) { GenForm.gridNotesRow row; for (int i = 0; i < coll.size(); i++) { CarePlanEvaluationNote note = coll.get(i); if (! ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO") && form.chkActive().getValue() == Boolean.TRUE.booleanValue()) { if (note.getActive().booleanValue() == false) continue; } row = form.gridNotes().getRows().newRow(); row.setValue(note); if (note.getRecordedBy() != null) row.setcolBy(note.getRecordedBy().getName().toString()); row.setcolDateTime(note.getRecordedDateTime()); row.setcolNoteType("Evaluation"); if (!note.getNoteIsNotNull()) //WDEV-14474 { note.setNote(""); } if (note.getActive().booleanValue() == false) // Correction // has been // added { String strCorrectedBy = ""; if (note.getCorrectedBy() != null) strCorrectedBy = note.getCorrectedBy().toString(); row.setcolNote(note.getNote() + "\nCorrected By:" + strCorrectedBy + " on " + note.getCorrectionDateTime().getDate() + " at " + note.getCorrectionDateTime().getTime() + " for the following reason: " + (note.getCorrectionReason()!=null? note.getCorrectionReason():""));//WDEV-14487 //WDEV-15029 row.setTooltipForcolNote(note.getNote() + "\nCorrected By:" + strCorrectedBy + " on " + note.getCorrectionDateTime().getDate() + " at " + note.getCorrectionDateTime().getTime() + " for the following reason: " + (note.getCorrectionReason()!=null? note.getCorrectionReason():"")); row.setSelectable(false); } else { row.setcolNote(note.getNote()); //WDEV-15029 row.setTooltipForcolNote(note.getNote()); } } } }