/** * Get a care plan template */ public ims.nursing.vo.CarePlanTemplate getCarePlanTemplate(CarePlanTemplateTitle carePlanTemplate) { DomainFactory factory = getDomainFactory(); CarePlanTemplate domCpt = (CarePlanTemplate)factory.getDomainObject(CarePlanTemplate.class,carePlanTemplate.getID_CarePlanTemplate()); if (domCpt == null) return null; ims.nursing.vo.CarePlanTemplate voCpt = CarePlanTemplateAssembler.create(domCpt); voCpt.getInterventions().sort(); return voCpt; }
public ims.nursing.vo.CarePlanTemplate saveCarePlanTemplate(ims.nursing.vo.CarePlanTemplate cpt) throws ims.domain.exceptions.StaleObjectException { if (!cpt.isValidated()) { throw new DomainRuntimeException("CarePlanTemplate VO not validated."); } DomainFactory factory = getDomainFactory(); CarePlanTemplate domCpt = CarePlanTemplateAssembler.extractCarePlanTemplate(factory,cpt); factory.save(domCpt); return CarePlanTemplateAssembler.create(domCpt); }
/** * Returns a list of templates which match the search string */ public ims.nursing.vo.CarePlanTemplateCollection listTemplates(String templateSearchString) { DomainFactory factory = getDomainFactory(); StringBuffer filterString = new StringBuffer(); ArrayList markerNames = new ArrayList(); ArrayList markerValues = new ArrayList(); String comparator="="; if (templateSearchString != null && templateSearchString.indexOf("%") >= 0) comparator="LIKE"; filterString.append(" from ims.nursing.careplans.domain.objects.CarePlanTemplate template"); filterString.append(" where upper(template.title) " + comparator + " :title "); //28/10/2004 - Sinead request - display the active only filterString.append(" and template.active = :active "); markerNames.add("title"); markerNames.add("active"); //30/09/05 - ESTEE11 - care plan case sensitivity for search markerValues.add(templateSearchString != null?templateSearchString.toUpperCase():templateSearchString); markerValues.add(Boolean.TRUE); String[] names = new String[markerNames.size()]; markerNames.toArray(names); java.util.List templates = factory.find(filterString.toString(),names,markerValues.toArray()); return (CarePlanTemplateAssembler.createCarePlanTemplateCollectionFromCarePlanTemplate(templates)).sort(); }
public ims.nursing.vo.CarePlanTemplate getCarePlanTemplate(CarePlanTemplateTitle carePlanTemplate) { DomainFactory factory = getDomainFactory(); CarePlanTemplate tempDom = (CarePlanTemplate) factory.getDomainObject(CarePlanTemplate.class, carePlanTemplate.getID_CarePlanTemplate()); return (CarePlanTemplateAssembler.create(tempDom)); }