예제 #1
0
def get_current_user_role():
    user_type = find_user({"_id": session.get("Username")})["Type"]
    if user_type == "0":
        return "Admin"
    if user_type == "1":
        return "Doctor"
    if user_type == "2":
        return "Patient"
def current_user():
    return session.get('user_id')
def get_report():
    user_id = session.get('user_id')
    return report_model.get_reports(user_id, 'Doctor')
def send_report():
    user_id = session.get('user_id')
    patient_id = request.form.get('patient_id')
    report = request.form.get('report')
    date = request.form.get('date')
    return report_model.send_report(user_id, patient_id, report, date)
def set_appointment():
    user_id = session.get('user_id')
    patient_id = request.form.get('patient_id')
    date = request.form.get('date')
    result = appointment_model.set_appointment(user_id, patient_id, date)
    return result
def get_appointment():
    user_id = session.get('user_id')
    return appointment_model.get_appointments(user_id, 'Doctor')
def get_report():
    user_id = session.get('user_id')
    return report_model.get_reports(user_id, 'Patient')