public ims.nursing.vo.CarePlanCollection listCarePlans(ims.nursing.vo.CarePlanTitleCollection collCps) { String carePlanIDs = ""; for (int i = 0 ; collCps != null && i < collCps.size() ; i++) { if (carePlanIDs != "") carePlanIDs += " , "; carePlanIDs += collCps.get(i).getID_CarePlan(); } List domainObjectList = null; DomainFactory factory = getDomainFactory(); domainObjectList = factory.find("select cp from CarePlan as cp where cp.id in ( " + carePlanIDs + " )"); return CarePlanAssembler.createCarePlanCollectionFromCarePlan(domainObjectList); }
public Boolean saveCarePlans(CarePlanCollection collCps) throws StaleObjectException { if (collCps == null) throw new DomainRuntimeException("Cannot save null value for CarePlanCollection"); if (!collCps.isValidated()) throw new DomainRuntimeException("CarePlanCollection has not been validated"); DomainFactory factory = getDomainFactory(); for ( int i = 0 ; i < collCps.size() ; i++) { CarePlan doCP = CarePlanAssembler.extractCarePlan(factory, collCps.get(i)); factory.save(doCP); } return true; }
public CarePlanCollection getCareplans(CareContextRefVo careContextrefVo) { if(careContextrefVo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if(careContextrefVo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select c1_1 from CarePlan as c1_1 left join c1_1.careContext as c2_1 where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " c2_1.id = :careContextId"); markers.add("careContextId"); values.add(careContextrefVo.getID_CareContext()); andStr = " and "; List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { CarePlanCollection voColl = CarePlanAssembler.createCarePlanCollectionFromCarePlan(list); if(voColl != null && voColl.size() > 0) return voColl; } } return null; }
/** * saves the interventions and the evaluation note */ public ims.nursing.vo.CarePlan saveCarePlan(ims.nursing.vo.CarePlan carePlan) throws StaleObjectException { // Ensure the value object has been validated if (!carePlan.isValidated()) throw new DomainRuntimeException("CarePlan has not been validated"); DomainFactory factory = getDomainFactory(); CarePlan cp = CarePlanAssembler.extractCarePlan(factory, carePlan); factory.save(cp); return (CarePlanAssembler.create(cp)); }
/** * Retrieves the selected care plan */ public ims.nursing.vo.CarePlan getCarePlan(ims.nursing.vo.CarePlan voCarePlan) { DomainFactory factory = getDomainFactory(); CarePlan cp = (CarePlan) factory.getDomainObject(CarePlan.class, voCarePlan.getID_CarePlan()); ims.nursing.vo.CarePlan voCp = CarePlanAssembler.create(cp); return voCp; }
public CarePlanCollection listCarePlans(ims.nursing.vo.CarePlan voCarePlan) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); CarePlan cp = (CarePlan) factory.getDomainObject(CarePlan.class, voCarePlan.getID_CarePlan()); ims.nursing.vo.CarePlan voCp = CarePlanAssembler.create(cp); CarePlanCollection temVoColl = new CarePlanCollection(); temVoColl.add(voCp); return temVoColl; }