public EmergencyEpisodeForTriageVoCollection listAttendanceHistory(PatientRefVo patient) { if(patient == null || patient.getID_Patient() == null) throw new CodingRuntimeException("Cannot list Emergency Episodes for a null Patient Id."); //String query = "select ee from EmergencyEpisode as ee left join ee.episodeOfCare as ec left join ec.careSpell as cs left join cs.patient as p where p.id = :PatientId order by ee.injuryDateTime desc, ee.emergencyAttendances.arrivalDateTime desc "; String query = "select ee from EmergencyEpisode as ee left join ee.episodeOfCare as ec left join ec.careSpell as cs left join cs.patient as p where p.id = :PatientId order by ec.startDate desc, ee.emergencyAttendances.arrivalDateTime desc "; //wdev-16070 return EmergencyEpisodeForTriageVoAssembler.createEmergencyEpisodeForTriageVoCollectionFromEmergencyEpisode(getDomainFactory().find(query, new String[] {"PatientId"}, new Object[] {patient.getID_Patient()})); }
public EmergencyEpisodeForTriageVoCollection listAttendanceHistory(PatientRefVo patient) { if(patient == null || patient.getID_Patient() == null) throw new CodingRuntimeException("Cannot list Emergency Episodes for a null Patient Id."); //String query = "select ee from EmergencyEpisode as ee left join ee.episodeOfCare as ec left join ec.careSpell as cs left join cs.patient as p where p.id = :PatientId order by ee.injuryDateTime desc, ee.emergencyAttendances.arrivalDateTime desc "; String query = "select ee from EmergencyEpisode as ee left join ee.episodeOfCare as ec left join ec.careSpell as cs left join cs.patient as p where( p.id = :PatientId and (ee.isRIE is null or ee.isRIE <> 1 )) order by ec.startDate desc, ee.emergencyAttendances.arrivalDateTime desc "; //wdev-16070,wdev-19040 return EmergencyEpisodeForTriageVoAssembler.createEmergencyEpisodeForTriageVoCollectionFromEmergencyEpisode(getDomainFactory().find(query, new String[] {"PatientId"}, new Object[] {patient.getID_Patient()})); }