/** * listCareSpellsByPatient */ public ims.emergency.vo.EpisodeDetailsVoCollection listEmergencyEpisodeByPatient( ims.core.patient.vo.PatientRefVo patientRefVo, Integer maxRecords, AttendanceHistoryDialog type, ims.framework.utils.DateTime scheduledDate, ims.framework.utils.DateTime unscheduledDate) { AttendanceDetails impl = (AttendanceDetails) getDomainImpl(AttendanceDetailsImpl.class); return impl.listEmergencyEpisodeByPatient(patientRefVo, maxRecords, type, scheduledDate, unscheduledDate); }
@Override protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { if (form.getGlobalContext().Emergency.getAttendanceHistoryDialogIsNotNull() && form.getGlobalContext().Emergency.getAttendanceHistoryDialogParamsIsNotNull()) { AttendanceHistoryDialogParamsVo voSetting = form.getGlobalContext().Emergency.getAttendanceHistoryDialogParams(); EpisodeDetailsVoCollection voCollEpisodeDetails = null; if (form.getGlobalContext().Emergency.getAttendanceHistoryDialog().equals(AttendanceHistoryDialog.SCHEDULED)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient( voSetting.getPatientRefVo(), 0, AttendanceHistoryDialog.SCHEDULED, voSetting.getScheduledDate(), null); } if (form.getGlobalContext().Emergency.getAttendanceHistoryDialog().equals(AttendanceHistoryDialog.UNSCHEDULED)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient( voSetting.getPatientRefVo(), 0, AttendanceHistoryDialog.UNSCHEDULED, voSetting.getScheduledDate(), voSetting.getScheduledDate()); } if (form.getGlobalContext().Emergency.getAttendanceHistoryDialog().equals(AttendanceHistoryDialog.HISTORY)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient( voSetting.getPatientRefVo(), 0, null, null, null); } populateGrdDisplay(voCollEpisodeDetails); } }
public EpisodeDetailsVoCollection listEmergencyEpisodeByPatient(PatientRefVo patientRefVo, Integer maxRecords, AttendanceHistoryDialog type, DateTime scheduledDate, DateTime unscheduledDate) { if(patientRefVo == null || patientRefVo.getID_Patient() == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); String hsql = " select e1_1 from EmergencyEpisode as e1_1 "; hsql += " left join e1_1.episodeOfCare as e2_1 "; hsql += " left join e2_1.careSpell as c1_1 "; hsql += " left join c1_1.patient as p1_1 "; hsql += " where e1_1.isRIE is null and p1_1.id = :idPatient"; if (type != null) { if (type.equals(AttendanceHistoryDialog.SCHEDULED)) { hsql += " and e1_1.injuryDateTime >= :scheduledDate"; } if (type.equals(AttendanceHistoryDialog.UNSCHEDULED)) { hsql += " and (e1_1.injuryDateTime >= :unscheduledDate and e1_1.injuryDateTime < :scheduledDate)"; } } hsql += " order by e2_1.startDate desc"; //wdev-16070 List episodeDetails = null; if (maxRecords != 0) { if (type != null) { if (type.equals(AttendanceHistoryDialog.SCHEDULED)) { episodeDetails = factory.find(hsql, new String[] {"scheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), patientRefVo.getID_Patient()},maxRecords); } if (type.equals(AttendanceHistoryDialog.UNSCHEDULED)) { episodeDetails = factory.find(hsql, new String[] {"scheduledDate","unscheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), unscheduledDate.getJavaDate(), patientRefVo.getID_Patient()},maxRecords); } } else { episodeDetails = factory.find(hsql, new String[] {"idPatient"}, new Object[] {patientRefVo.getID_Patient()},maxRecords); } } else { if (type != null) { if (type.equals(AttendanceHistoryDialog.SCHEDULED)) { episodeDetails = factory.find(hsql, new String[] {"scheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), patientRefVo.getID_Patient()}); } if (type.equals(AttendanceHistoryDialog.UNSCHEDULED)) { episodeDetails = factory.find(hsql, new String[] {"scheduledDate","unscheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), unscheduledDate.getJavaDate(), patientRefVo.getID_Patient()}); } } else { episodeDetails = factory.find(hsql, new String[] {"idPatient"}, new Object[] {patientRefVo.getID_Patient()}); } } if ( episodeDetails != null && episodeDetails.size() > 0) return EpisodeDetailsVoAssembler.createEpisodeDetailsVoCollectionFromEmergencyEpisode(episodeDetails).sort(SortOrder.DESCENDING); return null; }
@Override protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { if (form.getGlobalContext().Emergency.getAttendanceHistoryDialogIsNotNull() && form.getGlobalContext().Emergency.getAttendanceHistoryDialogParamsIsNotNull()) { AttendanceHistoryDialogParamsVo voSetting = form.getGlobalContext().Emergency.getAttendanceHistoryDialogParams(); EmergencyEpisodeShortVoCollection voCollEpisodeDetails = null; if (form.getGlobalContext().Emergency.getAttendanceHistoryDialog().equals(AttendanceHistoryDialog.SCHEDULED)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient( voSetting.getPatientRefVo(), 0, AttendanceHistoryDialog.SCHEDULED, voSetting.getScheduledDate(), null); } if (form.getGlobalContext().Emergency.getAttendanceHistoryDialog().equals(AttendanceHistoryDialog.UNSCHEDULED)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient( voSetting.getPatientRefVo(), 0, AttendanceHistoryDialog.UNSCHEDULED, voSetting.getScheduledDate(), voSetting.getScheduledDate()); } if (form.getGlobalContext().Emergency.getAttendanceHistoryDialog().equals(AttendanceHistoryDialog.HISTORY)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient( voSetting.getPatientRefVo(), 0, null, null, null); } populateGrdDisplay(voCollEpisodeDetails); } }
public EmergencyEpisodeShortVoCollection listEmergencyEpisodes(PatientRefVo patientRefVo, Integer maxRecords, AttendanceHistoryDialog type, DateTime scheduledDate, DateTime unscheduledDate) { if(patientRefVo == null || patientRefVo.getID_Patient() == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); StringBuilder hsql = new StringBuilder(" SELECT e1_1 FROM EmergencyEpisode AS e1_1 "); hsql.append(" LEFT JOIN e1_1.patient AS p1_1 "); hsql.append(" LEFT JOIN e1_1.episodeOfCare AS e2_1 "); hsql.append(" WHERE e1_1.isRIE is null and p1_1.id = :idPatient"); if (type != null) { if (type.equals(AttendanceHistoryDialog.SCHEDULED)) { hsql.append(" and e1_1.injuryDateTime >= :scheduledDate"); } if (type.equals(AttendanceHistoryDialog.UNSCHEDULED)) { hsql.append(" and (e1_1.injuryDateTime >= :unscheduledDate and e1_1.injuryDateTime < :scheduledDate)"); } } hsql.append(" order by e2_1.startDate desc"); //wdev-16070 List<?> episodeDetails = null; if (maxRecords != 0) { if (type != null) { if (type.equals(AttendanceHistoryDialog.SCHEDULED)) { episodeDetails = factory.find(hsql.toString(), new String[] {"scheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), patientRefVo.getID_Patient()},maxRecords); } if (type.equals(AttendanceHistoryDialog.UNSCHEDULED)) { episodeDetails = factory.find(hsql.toString(), new String[] {"scheduledDate","unscheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), unscheduledDate.getJavaDate(), patientRefVo.getID_Patient()},maxRecords); } } else { episodeDetails = factory.find(hsql.toString(), new String[] {"idPatient"}, new Object[] {patientRefVo.getID_Patient()},maxRecords); } } else { if (type != null) { if (type.equals(AttendanceHistoryDialog.SCHEDULED)) { episodeDetails = factory.find(hsql.toString(), new String[] {"scheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), patientRefVo.getID_Patient()}); } if (type.equals(AttendanceHistoryDialog.UNSCHEDULED)) { episodeDetails = factory.find(hsql.toString(), new String[] {"scheduledDate","unscheduledDate","idPatient"}, new Object[] {scheduledDate.getJavaDate(), unscheduledDate.getJavaDate(), patientRefVo.getID_Patient()}); } } else { episodeDetails = factory.find(hsql.toString(), new String[] {"idPatient"}, new Object[] {patientRefVo.getID_Patient()}); } } if ( episodeDetails != null && episodeDetails.size() > 0) return EmergencyEpisodeShortVoAssembler.createEmergencyEpisodeShortVoCollectionFromEmergencyEpisode(episodeDetails).sort(SortOrder.DESCENDING); return null; }
/** * listCareSpellsByPatient */ public EmergencyEpisodeShortVoCollection listEmergencyEpisodeByPatient(ims.core.patient.vo.PatientRefVo patientRefVo, Integer maxRecords, AttendanceHistoryDialog type, ims.framework.utils.DateTime scheduledDate, ims.framework.utils.DateTime unscheduledDate) { AttendanceDetails impl = (AttendanceDetails) getDomainImpl(AttendanceDetailsImpl.class); return impl.listEmergencyEpisodes(patientRefVo, maxRecords, type, scheduledDate, unscheduledDate); }