views.py

This module contains all views used by the patient self or by other healhtpersons that administrate patients.

Class definitions:

apps.healthperson.patient.views.get_patient(request, patient_session_id)[source]

Helper function for getting the patient from a patient_session_id

Args:
  • request: the request instance
  • patient_session_id: the patient_session_id coupled to the patient
Returns:
the patient instance
class apps.healthperson.patient.views.PatientBaseView(**kwargs)[source]

Bases: django.views.generic.base.View

Base view which adds the patient by using the patient_session_id or logged in user

dispatch(*args, **kwargs)[source]

Add patient to the view class

get_context_data(**kwargs)[source]

Base context, include the patient by default

class apps.healthperson.patient.views.PatientIndexView(**kwargs)[source]

Bases: apps.base.views.BaseIndexTemplateView

View which shows the homepage of the patient

get_all_messages_for_patient_index(patient)[source]

Get all messages for a patient

Args:
  • patient: the patient for with the messages should be returned
Returns:
A list with all messages for a patient
class apps.healthperson.patient.views.PatientGenericView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Generic view based on the patient baseview and TemplateView

class apps.healthperson.patient.views.PatientNotificationView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientGenericView

Show the notification settings used by a different roles

class apps.healthperson.patient.views.PatientNotificationEditView(**kwargs)[source]

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

Edit the notification settings used by a patient

form_class

alias of PatientNotificationEditForm

class apps.healthperson.patient.views.PatientProfileView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientGenericView

Shows the profile information of a patient used by a multiple roles

class apps.healthperson.patient.views.PatientProfileEditView(**kwargs)[source]

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

Edit the profile information of a patient used by a patient

form_class

alias of PatientProfileEditForm

class apps.healthperson.patient.views.PatientAppointmentsView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Show the appointments information of a patient used by a healthprofessional

class apps.healthperson.patient.views.PatientPersonaliaView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Show the profile information of a patient used by a patient admins

class apps.healthperson.patient.views.PatientMessagesView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Show the messages sent to a patient used by healthprofessionals

class apps.healthperson.patient.views.PatientReportsView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Show the report for a patient used by healthprofessionals

class apps.healthperson.patient.views.PatientControlesView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Show the finished controls for a patient used by healthprofessionals

class apps.healthperson.patient.views.PatientFreqControlView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Show the control and blood taken frequencies for a patient used by patient admins

class apps.healthperson.patient.views.PatientPersonaliaEditView(**kwargs)[source]

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

Edit the personalia of a patient used by patient admins.

..Note::
Managers use a different form for editing, including options for resetting the password.
form_class

alias of PatientPersonaliaEditForm

class apps.healthperson.patient.views.QuestionnaireForDiagnose(**kwargs)[source]

Bases: django.views.generic.base.View

Returns a JSON list of questionnaires available for a diagnose

get_questionnaires_for_diagnose_helper(selected_questionnaire)[source]

Helper function for getting the questionnaires

Returns:
The list of questionnaires for the selected_questionnaire
class apps.healthperson.patient.views.PatientFreqControlEditView(**kwargs)[source]

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

Edit the patient control and blood take frequency used by patient admins

form_class

alias of PatientDiagnoseControleEditForm

class apps.healthperson.patient.views.PatientSearchView(**kwargs)[source]

Bases: core.views.FormView

Search for patients view used by patient admins

form_class

alias of PatientSearchForm

get_initial()[source]

Get initial data, used for showing the old results and form data when the user uses the back button to return to the form

get(request, *args, **kwargs)[source]

Re-execute the search if the user has used the back button

form_valid(form)[source]

Perform the search action, search for a healthprofessional

class apps.healthperson.patient.views.SearchView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Search view for in the homepage of the patient allows searching for answers on questionnaires and messages

get_inner_context(request, patient, model_display_name)[source]

Gets the questionnaires to be included into the results.

Args:
  • request: the current request
  • patient: the patient who is searching
  • model_display_name: the model_display_name of the questionnaire to search for.
Returns:
a list of questionnaires
post(request, *args, **kwargs)[source]

Execute the search for questionnaires and messages based on ‘searchterm’

class apps.healthperson.patient.views.HealthPatientAddView(**kwargs)[source]

Bases: apps.healthperson.views.BaseAddView

Class based view for adding a new patient used by patient admins

form_class

alias of PatientAddForm

dispatch(*args, **kwargs)[source]

Check permissions

class apps.healthperson.patient.views.PatientRemoveView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView, django.views.generic.base.TemplateView

Class based view for removing a patient used by patient admins

post(request, *args, **kwargs)[source]

Remove the patient by setting the user to inactive