def link_schedule(parent_task_returns, hospital, location_id): rules, busy_by_patients = parent_task_returns if not rules: return None epgu_dw = EPGUWorker(db_session) epgu_dw.link_schedule(rules, hospital, location_id) return parent_task_returns
def lpu_tickets_task(hospital_id, hospital_dict): epgu_doctors = db_session.query(Personal).filter(Personal.lpuId == hospital_id).filter( Personal.key_epgu.has(Personal_KeyEPGU.keyEPGU != None) ).all() if epgu_doctors: epgu_dw = EPGUWorker(db_session) group([appoint_patients.s((None, epgu_dw.get_doctor_tickets(doctor)), hospital_dict, doctor) for doctor in epgu_doctors])()
def activate_locations(self): if request.form['do_update']: data_worker = EPGUWorker(db_session) data_worker.activate_locations() msg = data_worker.msg del data_worker else: msg = [u'Ошибка обновления БД'] return self.render('update_process.html', result_msg=msg)
def appoint_patients(parent_task_returns, hospital, doctor): if not parent_task_returns: return None rules, patient_slots = parent_task_returns if not patient_slots: return None epgu_dw = EPGUWorker(db_session) epgu_dw.appoint_patients(patient_slots, hospital, doctor) return epgu_dw.msg
def sync_common_data(self): if request.form['do_update']: data_worker = EPGUWorker(db_session) data_worker.sync_hospitals() data_worker.sync_reservation_types() data_worker.sync_payment_methods() msg = data_worker.msg del data_worker else: msg = [u'Ошибка обновления БД'] return self.render('update_process.html', result_msg=msg)
def doctor_schedule_task(doctor, hospital_dict): epgu_dw = EPGUWorker(db_session) return epgu_dw.doctor_schedule_task(doctor, hospital_dict)
def activate_location(parent_task_returns, hospital, location_id): if not parent_task_returns: return None epgu_dw = EPGUWorker(db_session) epgu_dw.activate_location(hospital, location_id) return parent_task_returns
def epgu_send_lpu_tickets(hospital_id, hospital): epgu_dw = EPGUWorker(Task_Session()) try: epgu_dw.send_new_tickets(hospital_id, hospital) except exceptions.Exception, e: print e
def sync_locations(): epgu_dw = EPGUWorker(db_session) epgu_dw.sync_locations()