public ims.core.vo.PatientAlertLiteVoCollection listAlerts(ims.core.patient.vo.PatientRefVo patient) { if(patient == null) throw new CodingRuntimeException("Cannot list Patient Alerts on null Patient Id."); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); 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()); hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); hql.append(" order by patAlrt.systemInformation.creationDateTime desc"); List<?> list = factory.find(hql.toString(), names,values); return(PatientAlertLiteVoAssembler.createPatientAlertLiteVoCollectionFromPatientAlert(list)); }
public ims.core.vo.PatientAlertLiteVoCollection listAlerts(ims.core.patient.vo.PatientRefVo patient, IAppRole role) { if(patient == null) throw new CodingRuntimeException("Cannot list Patient Alerts on null Patient Id."); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); 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()); hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); 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(")"); hql.append(" order by patAlrt.systemInformation.creationDateTime desc"); List<?> list = factory.find(hql.toString(), names,values); return(PatientAlertLiteVoAssembler.createPatientAlertLiteVoCollectionFromPatientAlert(list)); }
public PatientAlertLiteVoCollection listAlerts(PatientRefVo patient, IAppRole role) { if(patient == null) throw new CodingRuntimeException("Cannot list Patient Alerts on null Patient Id."); ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); 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()); hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); 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(")"); hql.append (" and alertType.parent.id = :alertTypeH"); names.add("alertTypeH"); values.add(AlertType.ANAESTHETIC_HAZARDS.getID()); hql.append(" order by patAlrt.systemInformation.creationDateTime desc"); List<?> list = factory.find(hql.toString(), names,values); return(PatientAlertLiteVoAssembler.createPatientAlertLiteVoCollectionFromPatientAlert(list)); }