/** * Lists careplans for an episode */ public ims.nursing.vo.CarePlanTitleCollection listCarePlans(ims.core.vo.CareContextShortVo careContextShortVo) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from CarePlan careplan "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = " "; if (careContextShortVo != null) { hql.append(andStr + " careplan.careContext.id = :rcc"); markers.add("rcc"); values.add(careContextShortVo.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List<?> cpTitle = factory.find(query, markers, values); return(CarePlanTitleAssembler.createCarePlanTitleCollectionFromCarePlan(cpTitle).sort()); //this is the problem }
/** * list care plans, by clinical contact id */ public CarePlanTitleCollection listCarePlans(CareContextShortVo careContextShortVo) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from CarePlan careplan "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = " "; if (careContextShortVo != null) { hql.append(andStr + " careplan.careContext.id = :rcc"); markers.add("rcc"); values.add(careContextShortVo.getID_CareContext()); andStr = " and "; hql.append(andStr + " careplan.currentCarePlanStatus.status = :status"); markers.add("status"); values.add(getDomLookup(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE)); } if (markers.size() > 0) query += " where "; query += hql.toString(); List<?> cpTitle = factory.find(query, markers, values); return(CarePlanTitleAssembler.createCarePlanTitleCollectionFromCarePlan(cpTitle).sort()); //this is the problem }