public TrackingForADTWardAndSpecialtyDialogVo getTracking(PendingEmergencyAdmissionRefVo pendingemergencyadmissionRef) { if (pendingemergencyadmissionRef == null || pendingemergencyadmissionRef.getID_PendingEmergencyAdmission() == null) throw new CodingRuntimeException("pendingemergencyadmissionRef is null or id not provided "); String hql = "select t1_1 from Tracking as t1_1 left join t1_1.associatedPendingEmergencyAdmission as p1_1 where p1_1.id = " + pendingemergencyadmissionRef.getID_PendingEmergencyAdmission() + "order by t1_1.systemInformation.creationDateTime desc "; List lstTracking = getDomainFactory().find(hql); if( lstTracking != null && lstTracking.size() > 0) { TrackingForADTWardAndSpecialtyDialogVoCollection tempColl = TrackingForADTWardAndSpecialtyDialogVoAssembler.createTrackingForADTWardAndSpecialtyDialogVoCollectionFromTracking(lstTracking); if( tempColl != null && tempColl.size() > 0) return tempColl.get(0); } return null; }