private String fillToolTip(CarePlanStatusCollection voCarePlanStatusCollection) { StringBuffer tooltip = new StringBuffer(); tooltip.append("<p align=\"center\"><font color=\"#FF0000\"><b>CARE PLAN STATUS</b></font> </p>"); final String newLine = "<br>"; CarePlanStatus voCarePlanStatus; if(voCarePlanStatusCollection != null) { voCarePlanStatusCollection.sort(SortOrder.ASCENDING); for(int i=0; i<voCarePlanStatusCollection.size(); i++) { voCarePlanStatus = voCarePlanStatusCollection.get(i); if(voCarePlanStatus.getDateTimeIsNotNull()) { tooltip.append("<b>" + "Date/Time: " + "</b>" + voCarePlanStatus.getDateTime().toString(DateTimeFormat.STANDARD) + "</b>"); } if(voCarePlanStatus.getHCPIsNotNull()) { tooltip.append(newLine); tooltip.append("<b>" + "HCP: " + "</b>" + voCarePlanStatus.getHCP().getMos().getName().toString()); } else { tooltip.append(newLine); tooltip.append("<b>" + "HCP: " + "</b>"); } if(voCarePlanStatus.getStatusIsNotNull()) { tooltip.append(newLine); tooltip.append("<b>" + "Status: " + "</b>" + voCarePlanStatus.getStatus().toString()); } tooltip.append(newLine); tooltip.append(newLine); } } return tooltip.toString(); }
private CarePlan createDuplicateCarePlan() { CarePlan cpDuplicate = new CarePlan(); CarePlan cp = form.getLocalContext().getCarePlan(); cpDuplicate.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); cpDuplicate.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); cpDuplicate.setTitle(cp.getTitle()); cpDuplicate.setObjective(cp.getObjective()); cpDuplicate.setNextEvaluationDate(new Date()); CarePlanInterventionsCollection collCarePlanInterventions = new CarePlanInterventionsCollection(); if(cp.getInterventions()!=null) for(int i=0; i<cp.getInterventions().size(); i++){ CarePlanInterventions action = cp.getInterventions().get(i); CarePlanInterventions carePlanIntervention = new CarePlanInterventions(); carePlanIntervention.setDescription(action.getDescription()); carePlanIntervention.setActive(true); carePlanIntervention.setStartDate(action.getStartDate()); carePlanIntervention.setStartBy(action.getStartBy()); carePlanIntervention.setOrder(action.getOrder()); carePlanIntervention.setInterventionType(action.getInterventionType()); carePlanIntervention.setFrequency(action.getFrequency()); collCarePlanInterventions.add(carePlanIntervention); } cpDuplicate.setInterventions(collCarePlanInterventions); //Care Plan Status CarePlanStatus status = new CarePlanStatus(); status.setDateTime(new DateTime()); Object Object = domain.getHcpLiteUser(); HcpLiteVo hcpLiteVo = Object != null ? (HcpLiteVo) Object : null; status.setHCP(hcpLiteVo); status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE); cpDuplicate.setCurrentCarePlanStatus(status); CarePlanStatusCollection voColl = new CarePlanStatusCollection(); voColl.add(status); cpDuplicate.setCarePlanStatus(voColl); return cpDuplicate; }