public PatientAlertEDischargeVoCollection listPatientAlerts(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 PatientAlert patAlrt "); hql.append(" where patAlrt.patient.id = :patient"); names.add("patient"); values.add(patient.getID_Patient()); if (active.equals(Boolean.TRUE)) { hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); } List list = factory.find(hql.toString(), names,values); return PatientAlertEDischargeVoAssembler.createPatientAlertEDischargeVoCollectionFromPatientAlert(list).sort(); }
public PatientAlertEDischargeVo getPatientAlert(PatientAlertRefVo patientalertRefVo) { if(patientalertRefVo == null) throw new DomainRuntimeException("PatientAlert Filter not provided for list call. "); DomainFactory factory = getDomainFactory(); ims.core.clinical.domain.objects.PatientAlert doPA = (ims.core.clinical.domain.objects.PatientAlert)factory.getDomainObject(ims.core.clinical.domain.objects.PatientAlert.class, patientalertRefVo.getID_PatientAlert()); return PatientAlertEDischargeVoAssembler.create(doPA); }
public PatientAlertEDischargeVoCollection listPatientAlerts(PatientShort patient, Boolean active, IAppRole role) { 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("select patAlrt from PatientAlert patAlrt left join patAlrt.alertType as alertType "); hql.append(" where patAlrt.patient.id = :patient"); names.add("patient"); values.add(patient.getID_Patient()); String alertCategoryIds = getAlertCategoryIds(role); if(alertCategoryIds == null || alertCategoryIds.length() == 0) return null; hql.append (" and alertType.parent is not null and alertType.parent.id in ("); hql.append(alertCategoryIds); hql.append(")"); if (active.equals(Boolean.TRUE)) { hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); } List list = factory.find(hql.toString(), names,values); return PatientAlertEDischargeVoAssembler.createPatientAlertEDischargeVoCollectionFromPatientAlert(list).sort(); }