private List<CarePlanAndEvaluationNotes> getGroupedList(CarePlanEvaluationNoteListVoCollection voCollNotes) { if(voCollNotes == null) return null; List<CarePlanAndEvaluationNotes> listCpEval = new ArrayList<CarePlanAndEvaluationNotes>(); for (CarePlanEvaluationNoteListVo voCarePlanEvaluationNote : voCollNotes) { if(listCpEval.size() == 0) addNewItem(voCarePlanEvaluationNote, listCpEval); else { //check list for existing item matching careplan and add notes to it boolean bFound = false; for (int i = 0; i < listCpEval.size(); i++) { if(listCpEval.get(i).getCarePlan().equals(voCarePlanEvaluationNote.getCarePlan())) { listCpEval.get(i).addEvaluationNote(voCarePlanEvaluationNote); bFound = true; } } if(!bFound) addNewItem(voCarePlanEvaluationNote, listCpEval); } } return listCpEval; }
public void addEvaluationNote(CarePlanEvaluationNoteListVo value) { if(this.collEvaluationNotes == null) this.collEvaluationNotes = new CarePlanEvaluationNoteListVoCollection(); this.collEvaluationNotes.add(value); }
public CarePlanEvaluationNoteListVoCollection listEvaluationNotesForActiveCarePlansByDateRange(CareContextRefVo voCareContext, Date dateFrom, Date dateTo, Boolean activeOnly) { if(voCareContext == null || voCareContext.getID_CareContext() == null || dateFrom == null || dateTo == null) throw new CodingRuntimeException("Mandatory parameters are null in method listEvaluationNotesForActiveCarePlans"); String hql = "from CarePlanEvaluationNote note where note.carePlan.careContext.id = :idCareContext and note.carePlan.isRIE is null and note.carePlan.currentCarePlanStatus.status = :activeStatus and (note.recordedDateTime between :dateFrom and :dateTo) "; if(activeOnly == true) hql += "and note.active = true"; DomainFactory factory = getDomainFactory(); return CarePlanEvaluationNoteListVoAssembler.createCarePlanEvaluationNoteListVoCollectionFromCarePlanEvaluationNote(factory.find(hql, new String[]{"idCareContext", "activeStatus", "dateFrom", "dateTo"}, new Object[]{voCareContext.getID_CareContext(), getDomLookup(CarePlanStatus.ACTIVE), dateFrom.getDate(), dateTo.copy().addDay(1).getDate()})).sort(); }
public CarePlanEvaluationNoteListVoCollection getCollEvaluationNotes() { return collEvaluationNotes; }
public void setCollEvaluationNotes( CarePlanEvaluationNoteListVoCollection collEvaluationNotes) { this.collEvaluationNotes = collEvaluationNotes; }