/** * lists patient allergies, filtering by patient and active status */ public PatientAllergyEDischargeVoCollection listPatientAllergies(ims.core.vo.PatientShort patient, Boolean active) { if(patient == null) throw new CodingRuntimeException("Mandatory parameter - Patient not supplied"); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); 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()); if (active.equals(Boolean.TRUE)) { hql.append (" and patAlrg.isCurrentlyActiveAllergy = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); } List list = factory.find(hql.toString(), names,values); return (PatientAllergyEDischargeVoAssembler.createPatientAllergyEDischargeVoCollectionFromPatientAllergy(list).sort()); }
/** * Gets a single PatientAllerge based on a PatientAllergy ID value. */ public PatientAllergyEDischargeVo getpatientAllergy(Integer patientAllergyID) { DomainFactory factory = getDomainFactory(); return PatientAllergyEDischargeVoAssembler.create((PatientAllergy)factory.getDomainObject((PatientAllergy.class), patientAllergyID.intValue())); }