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; }
private void doRIE() { grdPreviousHistoryRow selectedRow = form.grdPreviousHistory().getSelectedRow(); if( selectedRow != null && selectedRow.getValue() != null) { if( selectedRow.getValue() instanceof EmergencyAttendanceShortVo) { try { TrackingSendToAreaVo tempTracking = domain.getTrackingSendToAreaVoByAttendanceDetails((EmergencyAttendanceShortVo) selectedRow.getValue()); if( form.getGlobalContext().Emergency.getSelectedEmergencyEpisodeIsNotNull() && form.getGlobalContext().Emergency.getSelectedEmergencyEpisode().getEmergencyAttendancesIsNotNull() && form.getGlobalContext().Emergency.getSelectedEmergencyEpisode().getEmergencyAttendances().size() > 1 ) { domain.rieAttendanceDetails((EmergencyAttendanceShortVo) selectedRow.getValue(), form.getForms().Emergency.AttendanceDetails, form.getGlobalContext().Core.getPatientShort() != null ? form.getGlobalContext().Core.getPatientShort().getID_Patient() : null, null, form.getGlobalContext().Core.getCurrentCareContextIsNotNull()?form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext():null, form.getGlobalContext().Core.getRieMessage(),form.getGlobalContext().Core.getCurrentCareContext(),null,null,null,tempTracking); } else if(form.getGlobalContext().Emergency.getSelectedEmergencyEpisodeIsNotNull() && form.getGlobalContext().Emergency.getSelectedEmergencyEpisode().getEmergencyAttendancesIsNotNull() && form.getGlobalContext().Emergency.getSelectedEmergencyEpisode().getEmergencyAttendances().size() == 1 ) { CareSpellVo tempCareSpellVo = new CareSpellVo(form.getGlobalContext().Core.getCurrentCareContext().getEpisodeOfCare().getCareSpell().getID_CareSpell(), form.getGlobalContext().Core.getCurrentCareContext().getEpisodeOfCare().getCareSpell().getVersion_CareSpell()); domain.rieAttendanceDetails((EmergencyAttendanceShortVo) selectedRow.getValue(), form.getForms().Emergency.AttendanceDetails, form.getGlobalContext().Core.getPatientShort() != null ? form.getGlobalContext().Core.getPatientShort().getID_Patient() : null, null, form.getGlobalContext().Core.getCurrentCareContextIsNotNull()?form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext():null, form.getGlobalContext().Core.getRieMessage(),form.getGlobalContext().Core.getCurrentCareContext(),form.getGlobalContext().Core.getCurrentCareContext().getEpisodeOfCare(),tempCareSpellVo,form.getGlobalContext().Emergency.getSelectedEmergencyEpisode(),tempTracking); } } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return; } } } }
private TrackingSendToAreaVo isPatientCurrentlyInEmergencyDepartment() { return domain.isPatientCurrentlyinED(form.getGlobalContext().Core.getPatientShort()); }
public TrackingSendToAreaVo isPatientCurrentlyinED(PatientRefVo patient) { IEmergencyHelper impl = (IEmergencyHelper)getDomainImpl(EmergencyHelper.class); return impl.isPatientCurrentlyinED(patient); }
public TrackingSendToAreaVo isPatientCurrentlyinED(PatientRefVo patient) { //WDEV-16673 IEmergencyHelper impl = (IEmergencyHelper)getDomainImpl(EmergencyHelper.class); return impl.isPatientCurrentlyinED(patient); }
private boolean save() //WDEV-22956 { EpisodeDetailsVo record = populateDataFromScreen(); //WDEV-19060 BookingAppointmentForEDAttendanceDetailsVo bookApptToSave=null; if (form.getGlobalContext().Emergency.getBookedApptForLatestEmergencyAttendance()!=null && GroupCategoryEnumeration.rdoScheduledReturn.equals(form.GroupCategory().getValue())) { bookApptToSave=markApptAsSeen(form.getGlobalContext().Emergency.getBookedApptForLatestEmergencyAttendance()); } String[] errors = record.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } TrackingSendToAreaVo patientArea = domain.isPatientCurrentlyinED(form.getGlobalContext().Core.getPatientShort()); if (record.getID_EmergencyEpisode()==null && patientArea!=null) { engine.showMessage("This patient is curently in "+ (patientArea.getCurrentAreaIsNotNull() ? patientArea.getCurrentArea().getAreaDisplayName():"")); //WDEV-17468 form.getLocalContext().setSelectedEvent(EmergencyAttendanceEvent.SAVE); form.fireCustomControlValueChanged(); return false; } //wdev-17949 AttendanceDetailsVo emergattendanceVo = form.getLocalContext().getSelectedRecord(); //take the selected emergency attendance // wdev-14420 TrackingSendToAreaVo trackingVo = null; if (record.getID_EmergencyEpisode() == null || form.getLocalContext().getSelectedRecord() == null) { emergattendanceVo = null; //wdev-17949 - it will be created a new emergency attendance MemberOfStaffShortVo memberVo = null; if (domain.getMosUser() instanceof MemberOfStaffShortVo) { memberVo = (MemberOfStaffShortVo) domain.getMosUser(); } if (memberVo == null) { engine.showMessage("User must be Member Of Staff."); return false; } trackingVo = populateTracking(); errors = null; errors = trackingVo.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } } try { record = domain.save(record, form.getLocalContext().getCurrentCareSpell(), form.getLocalContext().getCurrentEpisodeOfCare(), form.getLocalContext().getCurrentCareContext(), trackingVo, form.getLocalContext().getTIIG(), form.getLocalContext().getRTA(),emergattendanceVo, bookApptToSave, form.getLocalContext().getInvoiceBillingToSave(), form.getLocalContext().getChartRequestToSave(), form.getLocalContext().getInsuranceDetailsToSave()); // wdev-14420 , wdev-14582, wdev-17949 //WDEV-19060 //WDEV-22956 } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getLocalContext().setTIIG(null); form.getLocalContext().setRTA(null); return true; } form.getLocalContext().setCurrentCareSpell(null); form.getLocalContext().setTIIG(null); form.getLocalContext().setRTA(null); form.getLocalContext().setSelectedEmergencyEpisode(record); form.getGlobalContext().Emergency.setSelectedEmergencyEpisode(record); return true; }
public void rieAttendanceDetails(EmergencyAttendanceShortVo attendanceDetails, FormName formName, Integer patId, Integer contactId, Integer careContextId, String comment, CareContextShortVo carecontext, EpisodeofCareLiteVo episode, CareSpellVo carespell, EpisodeDetailsVo emergencyepisode, TrackingSendToAreaVo tracking) throws StaleObjectException { if( episode == null && carespell == null && emergencyepisode == null) { if( attendanceDetails != null) markAsRie(attendanceDetails, formName, patId, contactId, careContextId, comment); if( carecontext != null) markAsRie(carecontext, formName, patId, contactId, careContextId, comment); if( tracking != null) markAsRie(tracking, formName, patId, contactId, careContextId, comment); } else { if( emergencyepisode != null) markAsRie(emergencyepisode, formName, patId, contactId, careContextId, comment); if( attendanceDetails != null) markAsRie(attendanceDetails, formName, patId, contactId, careContextId, comment); if( carecontext != null ) markAsRie(carecontext, formName, patId, contactId, careContextId, comment); if( episode != null ) { if( countCareContextByEpisodeOfcare(episode) == 0) //wdev-19363 markAsRie(episode, formName, patId, contactId, careContextId, comment); } if( carespell != null) { if( countEpisodeOfCareByCareSpell(carespell) == 0) //wdev-19363 markAsRie(carespell, formName, patId, contactId, careContextId, comment); } if( tracking != null) markAsRie(tracking, formName, patId, contactId, careContextId, comment); } if( attendanceDetails != null ) //wdev-17949 { EmergencyAttendanceDetailsCc tempImpl = (EmergencyAttendanceDetailsCc)getDomainImpl(EmergencyAttendanceDetailsCcImpl.class); tempImpl.triggerAttendanceCancelRegistrationEvent(attendanceDetails); } }
public TrackingSendToAreaVo isPatientCurrentlyinED(PatientRefVo patientRef) { IEmergencyHelper impl = (IEmergencyHelper)getDomainImpl(EmergencyHelper.class); return impl.isPatientCurrentlyinED(patientRef); }
private boolean save() { EpisodeDetailsVo record = populateDataFromScreen(); String[] errors = record.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } TrackingSendToAreaVo patientArea = domain.isPatientCurrentlyinED(form.getGlobalContext().Core.getPatientShort()); if (record.getID_EmergencyEpisode()==null && patientArea!=null) { engine.showMessage("This patient is curently in "+ (patientArea.getCurrentAreaIsNotNull() ? patientArea.getCurrentArea().getAreaDisplayName():"")); //WDEV-17468 form.getLocalContext().setSelectedEvent(EmergencyAttendanceEvent.SAVE); form.fireCustomControlValueChanged(); return false; } //wdev-17949 AttendanceDetailsVo emergattendanceVo = form.getLocalContext().getSelectedRecord(); //take the selected emergency attendance // wdev-14420 TrackingSendToAreaVo trackingVo = null; if (record.getID_EmergencyEpisode() == null || form.getLocalContext().getSelectedRecord() == null) { emergattendanceVo = null; //wdev-17949 - it will be created a new emergency attendance MemberOfStaffShortVo memberVo = null; if (domain.getMosUser() instanceof MemberOfStaffShortVo) { memberVo = (MemberOfStaffShortVo) domain.getMosUser(); } if (memberVo == null) { engine.showMessage("User must be Member Of Staff."); return false; } trackingVo = populateTracking(); errors = null; errors = trackingVo.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } } try { record = domain.save(record, form.getLocalContext().getCurrentCareSpell(), form.getLocalContext().getCurrentEpisodeOfCare(), form.getLocalContext().getCurrentCareContext(), trackingVo, form.getLocalContext().getTIIG(), form.getLocalContext().getRTA(),emergattendanceVo); // wdev-14420 , wdev-14582, wdev-17949 } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getLocalContext().setTIIG(null); form.getLocalContext().setRTA(null); return true; } form.getLocalContext().setCurrentCareSpell(null); form.getLocalContext().setTIIG(null); form.getLocalContext().setRTA(null); form.getLocalContext().setSelectedEmergencyEpisode(record); form.getGlobalContext().Emergency.setSelectedEmergencyEpisode(record); return true; }
public TrackingSendToAreaVo isPatientCurrentlyinED(PatientRefVo patient);