public DementiaEDischargeCheckVo getDementiaStatus(PASEventRefVo voPasEventRef) { if (voPasEventRef == null) throw new CodingRuntimeException("No pasEvent specified for getDementiaStatus"); DomainFactory factory = getDomainFactory(); StringBuffer hqlConditions = new StringBuffer(); String hql = "select d1_1 from Dementia as d1_1 left join d1_1.admissionDetail as a1_1 where"; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); hqlConditions.append(" (d1_1.isRIE is null OR d1_1.isRIE = 0) and a1_1.pasEvent.id = :pe"); //WDEV-17656 markers.add("pe"); values.add(voPasEventRef.getID_PASEvent()); hqlConditions.append(" and (d1_1.isExcludedFromWorklist is null or d1_1.isExcludedFromWorklist = :exc)"); markers.add("exc"); values.add(Boolean.FALSE); List<?> list = factory.find((hql + hqlConditions.toString() + " ").toString(), markers, values); if (list == null || list.size() == 0) return null; return DementiaEDischargeCheckVoAssembler.createDementiaEDischargeCheckVoCollectionFromDementia(list).get(0); }