views.py

Module containing a view for adding/editing appointments

Class definitions:

class apps.appointment.views.AppointmentEdit(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, core.views.FormView

Class based view for adding/editing appointment information by a secretary

form_class

alias of AppointmentAddEditForm

render_sms_and_template(appointment, message_template, sms_template)[source]

Renders both sms and template at once since the context is the same.

Args:
  • appointment: the appointment instance
  • message_template: the template_name to load for the message
  • sms_template: the template_name to load for the sms
Returns:
[message_template, sms_template]
get_default_urgent_message_and_sms(appointment)[source]

Renders both sms and template at once for urgent controls

Args:
  • appointment: the appointment instance
Returns:
[message_template, sms_template]
get_default_message_and_sms(appointment)[source]

Renders both sms and template at once for non-urgent controls

Args:
  • appointment: the appointment instance
Returns:
[message_template, sms_template]
form_valid(form)[source]

Save the appointment and notify the patient of the planned appointment