private void populateGrdDisplay(EpisodeDetailsVoCollection voCollEpisodeDetails) { if (voCollEpisodeDetails == null) return; grdDisplayRow episodeDetailsRow; for (int i = 0; i < voCollEpisodeDetails.size(); i++) { EpisodeDetailsVo voEpisodeDetails = voCollEpisodeDetails.get(i); episodeDetailsRow = form.grdDisplay().getRows().newRow(); episodeDetailsRow.setcolDateTime(voEpisodeDetails.getInjuryDateTime()); episodeDetailsRow.setcolPatCategory(voEpisodeDetails.getCategory().getText()); episodeDetailsRow.setcolEpisodeNo(voEpisodeDetails.getID_EmergencyEpisode().toString()); episodeDetailsRow.setCollapsedImage(form.getImages().Core.CareSpell); episodeDetailsRow.setExpandedImage(form.getImages().Core.CareSpell); episodeDetailsRow.setBackColor(Color.Bisque); episodeDetailsRow.setBold(true); episodeDetailsRow.setValue(voEpisodeDetails); } }
private EpisodeDetailsVoCollection patientIsRegisteredOnTheTrackingSystem() { EpisodeDetailsVoCollection voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient (form.getGlobalContext().Core.getPatientShort(), new Integer(200),null,null,null);//wdev-18015 - changed value from 20 to 200 if (voCollEpisodeDetails == null & (voCollEpisodeDetails != null && voCollEpisodeDetails.size() == 0)) { form.getLocalContext().setEmergencyEpisodes(null); return null; } form.getLocalContext().setEmergencyEpisodes(voCollEpisodeDetails); return voCollEpisodeDetails; }
public EpisodeDetailsVo getEmergencyEpisode(EmergencyEpisodeRefVo episodeId) { if( episodeId == null) throw new CodingRuntimeException("EmergencyEpisodeRefVo not provided"); DomainFactory factory = getDomainFactory(); String hsql = "select e1_1 from EmergencyEpisode as e1_1 where (e1_1.id = :id)"; List emergency = factory.find(hsql, new String[] {"id"}, new Object[] {episodeId.getID_EmergencyEpisode()}); if(emergency != null && emergency.size() > 0) { EpisodeDetailsVoCollection EpisodeColl = EpisodeDetailsVoAssembler.createEpisodeDetailsVoCollectionFromEmergencyEpisode(emergency); if(EpisodeColl != null && EpisodeColl.size() > 0) return EpisodeColl.get(0); } return null; }
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { form.btnOK().setEnabled(false); EpisodeDetailsVoCollection voCollEpisodeDetails = null; if(args != null ) { if((args.length == 1 && args[0] != null && args[0] instanceof Date)) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient(form.getGlobalContext().Core.getPatientShort(), (Date)args[0] ,null); } else if(args.length == 2 && args[0] == null && args[1] != null && args[1] instanceof Date) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient(form.getGlobalContext().Core.getPatientShort(),null, (Date)args[1] ); } else if(args.length == 2 && args[0] != null && args[0] instanceof Date && args[1] != null && args[1] instanceof Date) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient(form.getGlobalContext().Core.getPatientShort(),(Date)args[0], (Date)args[1] ); } else if(args.length == 0) { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient(form.getGlobalContext().Core.getPatientShort(),null, null ); } } else { voCollEpisodeDetails = domain.listEmergencyEpisodeByPatient(form.getGlobalContext().Core.getPatientShort(),null, null ); } populatePreviousHistoryGrid(voCollEpisodeDetails); updateControlsState(); }
@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); } }
private void populatePreviousHistoryGrid(EpisodeDetailsVoCollection emergencyEpisodes) { if (emergencyEpisodes == null) return; form.grdPrevious().getRows().clear(); grdPreviousRow episodeDetailsRow = null, emergencyAttendancesRow = null; emergencyEpisodes.sort(new InjuryDateComparator(SortOrder.DESCENDING)); for (int i = 0; i < emergencyEpisodes.size(); i++) { EpisodeDetailsVo voEpisodeDetails = emergencyEpisodes.get(i); episodeDetailsRow = form.grdPrevious().getRows().newRow(); EpisodeOfcareLiteVo tempVo = domain.getEpisodeOfCareLite(voEpisodeDetails.getEpisodeOfCare()); //wdev-16070 episodeDetailsRow.setColumnDateTime(tempVo != null ? tempVo.getStartDate():null); //wdev-16070 episodeDetailsRow.setColumnPatCategory((voEpisodeDetails.getCategoryIsNotNull() ? voEpisodeDetails.getCategory().getText() + " - ":"") + (voEpisodeDetails.getPresentingComplaintIsNotNull()? voEpisodeDetails.getPresentingComplaint().toString():"")); episodeDetailsRow.setColumnEmergencyNo(voEpisodeDetails.getID_EmergencyEpisode().toString()); //episodeDetailsRow.setCollapsedImage(form.getImages().Core.CareSpell); //episodeDetailsRow.setExpandedImage(form.getImages().Core.CareSpell); //episodeDetailsRow.setBackColor(Color.Bisque); episodeDetailsRow.setBold(true); episodeDetailsRow.setValue(voEpisodeDetails); episodeDetailsRow.setTooltip("DateTime : <b>" + (voEpisodeDetails.getInjuryDateTime()!=null ? voEpisodeDetails.getInjuryDateTime():"") + (voEpisodeDetails.getCategoryIsNotNull() ? "</b><br>Category : <b>" + voEpisodeDetails.getCategory().getText() : "") + (voEpisodeDetails.getID_EmergencyEpisodeIsNotNull() ? "</b><br>Emergency Number: <b>" + voEpisodeDetails.getID_EmergencyEpisode().toString() + "</b>" : ""));//WDEV-17178 if (voEpisodeDetails.getEmergencyAttendancesIsNotNull()) { episodeDetailsRow.setExpanded(true); voEpisodeDetails.getEmergencyAttendances().sort(new ArrivalDateComparator(SortOrder.DESCENDING)); //wdev-14420 for (int j = 0; j < voEpisodeDetails.getEmergencyAttendances().size(); j++) { AttendanceDetailsVo voEmergencyAttendances = voEpisodeDetails.getEmergencyAttendances().get(j); emergencyAttendancesRow = episodeDetailsRow.getRows().newRow(); if (voEmergencyAttendances.getDischargeDateTimeIsNotNull()) { emergencyAttendancesRow.setColumnDateTime(voEmergencyAttendances.getRegistrationDateTime() + " - " + voEmergencyAttendances.getDischargeDateTime()); emergencyAttendancesRow.setColumnPatCategory(voEmergencyAttendances.getOutcome() != null ? voEmergencyAttendances.getOutcome().getText() : null); emergencyAttendancesRow.setColumnEmergencyNo(voEmergencyAttendances.getID_EmergencyAttendance().toString()); emergencyAttendancesRow.setColumnContextType((voEmergencyAttendances.getCareContextIsNotNull() && voEmergencyAttendances.getCareContext().getContextIsNotNull())? voEmergencyAttendances.getCareContext().getContext():null); //emergencyAttendancesRow.setCollapsedImage(form.getImages().Core.BookOpenEnabled); //emergencyAttendancesRow.setBackColor(Color.LightBlue); emergencyAttendancesRow.setValue(voEmergencyAttendances); emergencyAttendancesRow.setTooltip("DateTime : <b>" + (voEmergencyAttendances.getRegistrationDateTime()!=null ? voEmergencyAttendances.getRegistrationDateTime() : "") + " - " + (voEmergencyAttendances.getDischargeDateTime()!=null ? voEmergencyAttendances.getDischargeDateTime() : "") + (voEmergencyAttendances.getOutcomeIsNotNull() ? "</b><br>Outcome : <b>" + voEmergencyAttendances.getOutcome() : "") + (voEmergencyAttendances.getID_EmergencyAttendanceIsNotNull() ? "</b><br>Emergency Number: <b>" + voEmergencyAttendances.getID_EmergencyAttendance().toString() + "</b><br>Context Type : <b>" + voEmergencyAttendances.getCareContext().getContext().toString() : ""));//WDEV-17178 } else { emergencyAttendancesRow.setColumnDateTime(voEmergencyAttendances.getArrivalDateTime()); emergencyAttendancesRow.setColumnPatCategory(voEmergencyAttendances.getOutcome() != null ? voEmergencyAttendances.getOutcome().getText() : null); emergencyAttendancesRow.setColumnEmergencyNo(voEmergencyAttendances.getID_EmergencyAttendance().toString()); emergencyAttendancesRow.setColumnContextType((voEmergencyAttendances.getCareContextIsNotNull() && voEmergencyAttendances.getCareContext().getContextIsNotNull()) ? voEmergencyAttendances.getCareContext().getContext():null); //emergencyAttendancesRow.setCollapsedImage(form.getImages().Core.Alert_RedTriangle2); //emergencyAttendancesRow.setBackColor(Color.Pink); emergencyAttendancesRow.setValue(voEmergencyAttendances); emergencyAttendancesRow.setTooltip("DateTime : <b>" + (voEmergencyAttendances.getRegistrationDateTime()!=null ? voEmergencyAttendances.getRegistrationDateTime():"") + (voEmergencyAttendances.getOutcomeIsNotNull() ? "</b><br>Outcome : <b>" + voEmergencyAttendances.getOutcome() : "") + (voEmergencyAttendances.getID_EmergencyAttendanceIsNotNull() ? "</b><br>Emergency Number: <b>" + voEmergencyAttendances.getID_EmergencyAttendance().toString() + "</b><br>Context Type : <b>" + voEmergencyAttendances.getCareContext().getContext().toString() : "")); } } } } }
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; }