public TrackingSendToAreaVo isPatientCurrentlyinED(PatientRefVo patient) { if(patient == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); String hsql = "select t1_1 from Tracking as t1_1 left join t1_1.patient as p1_1 left join t1_1.currentArea as t2_1 where (t1_1.currentArea is not null and p1_1.id = :id and (t1_1.isDischarged is null or t1_1.isDischarged <> 1 )and t1_1.isRIE is null)"; List <?> trakings = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()}); if( trakings != null && trakings.size() > 0) { TrackingSendToAreaVoCollection tempColl = TrackingSendToAreaVoAssembler.createTrackingSendToAreaVoCollectionFromTracking(trakings); if( tempColl != null && tempColl.size() > 0) return tempColl.get(0); } return null; }
public TrackingSendToAreaVo getTrackingSendToAreaVoByAttendanceDetails(EmergencyAttendanceRefVo attendanceDetailsRef) { if( attendanceDetailsRef == null) return null; DomainFactory factory = getDomainFactory(); String hsql = "select t1_1 from Tracking as t1_1 left join t1_1.attendance as e1_1 where (e1_1.id = :attendanceId and t1_1.isRIE is null ) "; List tracking = factory.find(hsql, new String[] {"attendanceId"}, new Object[] {attendanceDetailsRef.getID_EmergencyAttendance()}); if( tracking != null && tracking.size() > 0) { TrackingSendToAreaVoCollection trackingColl = TrackingSendToAreaVoAssembler.createTrackingSendToAreaVoCollectionFromTracking(tracking); if( trackingColl != null && trackingColl.size() > 0) return trackingColl.get(0); } return null; }