public void saveCarePlans(CarePlanForCopyCarePlansVoCollection collCarePlansToSave) throws StaleObjectException { if (collCarePlansToSave == null || collCarePlansToSave.size() == 0) { throw new CodingRuntimeException("Cannot copy Care Plans"); } DomainFactory factory = getDomainFactory(); for (int i = 0; i < collCarePlansToSave.size(); i++) { CarePlan domainCarePlan = CarePlanForCopyCarePlansVoAssembler.extractCarePlan(factory, collCarePlansToSave.get(i)); factory.save(domainCarePlan); } }
public CarePlanForCopyCarePlansVo getCarePlan(CarePlanRefVo carePlanRef) { if (carePlanRef == null || carePlanRef.getID_CarePlan() == null) { throw new CodingRuntimeException("Cannot get CarePlanVo on null Id "); } DomainFactory factory = getDomainFactory(); CarePlan domainCarePlan = (CarePlan) factory.getDomainObject(CarePlan.class, carePlanRef.getID_CarePlan()); return CarePlanForCopyCarePlansVoAssembler.create(domainCarePlan); }