private AttendanceRequiringContracting attendanceFoundInAttendanceReqContracting(EmergencyAttendanceOutcomeVo attendance) { if(attendance == null || attendance.getID_EmergencyAttendance() == null) throw new CodingRuntimeException("Cannot list Attendance Requiring Contracting for a null attendance Id."); String query = "select attReqContr from AttendanceRequiringContracting as attReqContr where attReqContr.attendance.id = :attId "; List list=getDomainFactory().find(query, new String[] {"attId"}, new Object[] {attendance.getID_EmergencyAttendance()}); if (list!=null && list.size()>0) { //return true; return (AttendanceRequiringContracting)list.get(0); } //return false; return null; }
private void saveEmergencyAttendance(DomainFactory factory, EmergencyAttendanceOutcomeVo emergAttendance, Sch_BookingVo voBooking) throws StaleObjectException { if (emergAttendance==null || emergAttendance.getEDClinicDetails()==null) return; Booking_AppointmentVoCollection collAppts = voBooking.getAppointments(); if (collAppts!=null && collAppts.size()>0) { collAppts=collAppts.sort(new ApptDateTimeComparator(SortOrder.ASCENDING)); emergAttendance.getEDClinicDetails().setEDClinicAppt(collAppts.get(0)); EmergencyAttendance doEmergAtt = EmergencyAttendanceOutcomeVoAssembler.extractEmergencyAttendance(factory, emergAttendance); factory.save(doEmergAtt); } }
public EmergencyAttendanceOutcomeVo getLatestEmergencyAttendance(PatientRefVo patientRef) { if(patientRef == null || patientRef.getID_Patient() == null) throw new CodingRuntimeException("Cannot list Emergency Episodes for a null Patient Id."); String query = "select ea from EmergencyAttendance as ea left join ea.careContext as cc left join cc.episodeOfCare as ec left join ec.careSpell as cs left join cs.patient as p where p.id = :PatientId order by ec.startDate desc, ea.arrivalDateTime desc "; //wdev-16070 List list=getDomainFactory().find(query, new String[] {"PatientId"}, new Object[] {patientRef.getID_Patient()}); if (list!=null && list.size()>0) { return EmergencyAttendanceOutcomeVoAssembler.create(((EmergencyAttendance)list.get(0))); } return null; }
protected void onFormOpen(Object[] args) throws PresentationLogicException { if (args != null && args.length > 0 && args[0] instanceof Boolean) { form.getLocalContext().setTransportRequired((Boolean) args[0]); } //WDEV-19060 if (args != null && args.length > 0 && args[0] instanceof EmergencyAttendanceOutcomeVo) { form.getLocalContext().setCurrentEmergencyAttendance((EmergencyAttendanceOutcomeVo) args[0]); } form.btnClose().setVisible(false); form.bookingCalendar1().setEnabled(false); form.bookingCalendar1().setChecksReadOnly(true); form.getLocalContext().setEnableFirstAvailableApp(false); //wdev-14867 form.getLocalContext().setPatient(form.getGlobalContext().Core.getPatientShort()); // WDEV-5193 form.customControlHcp().initialize(MosType.HCP); if (form.getGlobalContext().Core.getPatientShort() == null) { engine.showMessage("No Patient Selected"); clearBookingCalendar(); return; } form.bookingCalendar1().setCurrentMonth(new Date()); //WDEV-8717 if(!engine.hasRight(AppRight.CAN_OVERBOOK_FLEXIBLE_APPT)) form.chkOverBook().setVisible(false); loadServices(); loadActivities(); loadLocations(); open(); form.chkFirst().setValue(true); if(engine.isDialog()) { form.setMode(FormMode.VIEW); } updateControlsState(); //WDEV-9613 }