def list_acts(patient_id, appointment_id=0): """ Sends to template a list of tuples : ( gesture, tooth, act_info, act_specialty ) """ # Everybody but admin should enter this function ; however, # what is displayed should depends on whom is looking. # This will be taken care of in the html_template, by jinja. if session['role'] == constants.ROLE_ADMIN: return redirect(url_for('index')) patient, appointment = checks.get_patient_appointment(patient_id, appointment_id) acts = checks.get_patient_acts(patient.id, None, [ act.AppointmentCotationReference.appointment_id, ] ) payments = ( meta.session.query(compta.Payment) .filter(compta.Payment.patient_id == patient_id) .all() ) return render_template("list_patient_acts.html", patient=patient, appointment=appointment, acts=acts, payments=payments)
def patient_appointment(appointment_id): """ """ authorized_roles = [ constants.ROLE_DENTIST ] if session['role'] not in authorized_roles: return redirect(url_for('index')) patient, appointment = checks.get_patient_appointment( appointment_id=appointment_id) acts = checks.get_patient_acts(patient.id, appointment.id, [ act.AppointmentCotationReference.anatomic_location ] ) return render_template("patient_appointment.html", patient=patient, appointment=appointment, acts=acts)