def edit_notes(notes): """ Edit notes for patient :param notes: notes :return: None """ global is_arrived global appointment ds = DoctorService() if is_arrived == '1': ds.editNotes(appointment['id'], notes) aiy.audio.say('Successfully added!') elif is_arrived == '2': aiy.audio.say('Please wait for patient to arrive first!')
def editNotes(appointment_id): """ edit notes :param appointment_id: app id :return: render page """ ds = DoctorService() form = NoteForm(request.form) res, data = ds.getAppointmentById(appointment_id) if request.method == 'POST' and form.validate(): res = ds.editNotes(appointment_id, form.description.data) else: form.description.data = data['data']['notes'] return render_template( 'doctor/edit_notes.html', **doctorSetting(), form=form, address='/doctor/edit_notes/{}'.format(appointment_id))