public ims.clinical.vo.ClinicalProblemVoCollection listClinicalProblems(String filter) throws DomainInterfaceException { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from ClinicalProblem x"); String ret = ""; if(filter!=null) ret = filter.replaceAll("%", ""); if(ret.length()!=0) hql.append(" join x.keywords as kw"); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); hql.append(" where x.isActive = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); List clinProblems = Keywords.searchByKeywords(factory, filter, hql.toString(), names, values); if(clinProblems != null && clinProblems.size() > 0) { ClinicalProblemVoCollection tempColl = ClinicalProblemVoAssembler.createClinicalProblemVoCollectionFromClinicalProblem(clinProblems); return tempColl; } return null; }
public ClinicalProblemVoCollection listProblems(String problemName) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (problemName == null || (problemName != null && problemName.length() == 0)) throw new DomainRuntimeException("String for search is null."); String probNameLite = problemName != null ? problemName.toUpperCase() + "%" : "%%"; StringBuffer hql = new StringBuffer(); hql.append(" select probl from ClinicalProblem as probl left join probl.keywords as k where (probl.pCName like :ClinicalProblemSearchText or k.keyword like :ClinicalProblemSearchText) and probl.isActive = 1"); hql.append(" order by UPPER(probl.pCName) asc"); markers.add("ClinicalProblemSearchText"); values.add(probNameLite); return ClinicalProblemVoAssembler.createClinicalProblemVoCollectionFromClinicalProblem(factory.find(hql.toString(), markers, values)); }