public ims.core.vo.PatientAllergyForTriageVoCollection listAllergies(ims.core.patient.vo.PatientRefVo patient) { if(patient == null) throw new CodingRuntimeException("Cannot list Patient Allergies on null Patient Id."); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientAllergy patAlrg "); hql.append(" where patAlrg.patient.id = :patient"); names.add("patient"); values.add(patient.getID_Patient()); hql.append (" and patAlrg.isCurrentlyActiveAllergy = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); hql.append(" order by patAlrg.systemInformation.creationDateTime desc"); List<?> list = factory.find(hql.toString(), names,values); return(PatientAllergyForTriageVoAssembler.createPatientAllergyForTriageVoCollectionFromPatientAllergy(list)); }