Esempio n. 1
0
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
Esempio n. 2
0
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])()
Esempio n. 3
0
 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)
Esempio n. 4
0
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
Esempio n. 5
0
 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)
Esempio n. 6
0
def doctor_schedule_task(doctor, hospital_dict):
    epgu_dw = EPGUWorker(db_session)
    return epgu_dw.doctor_schedule_task(doctor, hospital_dict)
Esempio n. 7
0
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
Esempio n. 8
0
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
Esempio n. 9
0
def sync_locations():
    epgu_dw = EPGUWorker(db_session)
    epgu_dw.sync_locations()