public ManchesterTriageProtocolConfigVo getTriageProtocol(ManchesterTriageProtocolConfigLiteVo selectedTriageProtocol) { if (selectedTriageProtocol == null || selectedTriageProtocol.getID_ManchesterTriageProtocolConfiguration() == null) { throw new CodingRuntimeException("Cannot get ManchesterTriageProtocolConfigVo on null Id "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append(" select protocol from ManchesterTriageProtocolConfiguration as protocol where protocol.id = :protocolID"); List<?> list = factory.find(hql.toString(), new String[] { "protocolID" }, new Object[] { selectedTriageProtocol.getID_ManchesterTriageProtocolConfiguration() }); if (list != null && list.size() > 0) return ManchesterTriageProtocolConfigVoAssembler.createManchesterTriageProtocolConfigVoCollectionFromManchesterTriageProtocolConfiguration(list).get(0); return null; }
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)); }