public PlanOfCareListVoCollection listPlansofCareByStatus(CareContextRefVo voCareContextRef, PlanOfCareStatus status) { if(voCareContextRef == null) throw new CodingRuntimeException("The 'careContext' parameter cannot be null !"); DomainFactory factory = getDomainFactory(); String hql = new String(); StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1"; if(status != null) { if (status.equals(PlanOfCareStatus.CURRENT)) { condStr.append(andStr + " (p1_1.status.id ='-1089' or p1_1.status.id='-1091') "); andStr = " and "; } else { condStr.append(andStr + " p1_1.status.id = :STATUS "); markers.add("STATUS"); values.add(new Integer(status.getId())); andStr = " and "; } } condStr.append(andStr + " p1_1.careContext.id = :CONTEXT "); markers.add("CONTEXT"); values.add(voCareContextRef.getID_CareContext()); hql += " where "; hql += condStr.toString(); hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc"; return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values))); }
public PlanOfCareListVoCollection listPlanOfCare(CareContextRefVo voCareContextRef) { return PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare( getDomainFactory().find("from PlanOfCare as poc where poc.status.id <> -1090 and poc.careContext.id = :CARE_CONTEXT", new String[] {"CARE_CONTEXT"}, new Object[] {voCareContextRef.getID_CareContext()})); }
public PlanOfCareListVoCollection listPlansofCare(CareContextRefVo voCareContextRef, PlanOfCareStatus status, ims.framework.utils.DateTime date1, ims.framework.utils.DateTime date2) { if(voCareContextRef == null) throw new CodingRuntimeException("The 'careContext' parameter cannot be null !"); DomainFactory factory = getDomainFactory(); String hql = new String(); StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Comparable> values = new ArrayList<Comparable>(); hql = "select p1_1 from PlanOfCare as p1_1 left join p1_1.actions as p2_1 left join p1_1.group as l1_1"; if(status != null) { if (status.equals(PlanOfCareStatus.CURRENT)) { condStr.append(andStr + " (p1_1.status.id ='-1089' or p1_1.status.id='-1091') "); andStr = " and "; } else { condStr.append(andStr + " p1_1.status.id = :STATUS "); markers.add("STATUS"); values.add(new Integer(status.getId())); andStr = " and "; } } if(date1 != null && date2 != null) { condStr.append(andStr + " p1_1.authoringInformation.authoringDateTime between :DATE1 and :DATE2 "); markers.add("DATE1"); values.add(date1.getJavaDate()); markers.add("DATE2"); values.add(date2.getJavaDate()); andStr = " and "; } condStr.append(andStr + " p1_1.careContext.id = :CONTEXT "); markers.add("CONTEXT"); values.add(voCareContextRef.getID_CareContext()); hql += " where "; hql += condStr.toString(); hql += " order by l1_1.text asc, p1_1.title asc, p2_1.authoringInformation.authoringDateTime desc"; return (PlanOfCareListVoAssembler.createPlanOfCareListVoCollectionFromPlanOfCare(factory.find(hql,markers,values))); }