public ManchesterTriageProtocolConfigLiteVoCollection checkAlreadyActive(ManchesterTriageProtocolConfigLiteVo triageProtocol) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (triageProtocol == null) { throw new CodingRuntimeException("Cannot get ManchesterTriageProtocolConfigVo on null Id "); } StringBuffer hql = new StringBuffer(); hql.append(" select triageProtocol from ManchesterTriageProtocolConfiguration as triageProtocol left join triageProtocol.problem as problem left join triageProtocol.activeStatus as active where problem.id = :problemID and active.id = :idActive "); markers.add("problemID"); values.add(triageProtocol.getProblem().getID_ClinicalProblem()); markers.add("idActive"); values.add(PreActiveActiveInactiveStatus.ACTIVE.getID()); return ManchesterTriageProtocolConfigLiteVoAssembler.createManchesterTriageProtocolConfigLiteVoCollectionFromManchesterTriageProtocolConfiguration(factory.find(hql.toString(), markers, values)); }
public ManchesterTriageProtocolConfigLiteVoCollection listTriageProtocols(String triageName, ClinicalProblemShortVo clinicalProblem, LookupInstVo triageStatus) { DomainFactory factory = getDomainFactory(); String hql = " select triage from ManchesterTriageProtocolConfiguration as triage "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (triageName != null) { triageName.trim(); triageName = triageName.toUpperCase(); triageName = "%" + triageName + "%"; condStr.append(andStr + " where upper(triage.protocolName) like :protocolName"); markers.add("protocolName"); values.add(triageName); andStr = " and "; } else andStr = " where "; if (clinicalProblem != null) { condStr.append(andStr + " triage.problem.id = :pName"); markers.add("pName"); values.add(clinicalProblem.getID_ClinicalProblem()); andStr = " and "; } if (triageStatus != null) { condStr.append(andStr + " triage.activeStatus.id = :tStatus"); markers.add("tStatus"); values.add(triageStatus.getID()); } hql += condStr.toString(); return ManchesterTriageProtocolConfigLiteVoAssembler.createManchesterTriageProtocolConfigLiteVoCollectionFromManchesterTriageProtocolConfiguration(factory.find(hql, markers, values)).sort(); }