views.py

This module contains a class for generating report templates and views for adding/editing and exporting reports.

Class definitions:

class apps.report.views.ReportTemplateGenerator[source]

Class for generating a template of a report to be edited by an healthprofessional resulting in the final report.

get_questionnaires(questionnaire_request)[source]

Get the questionnaires for a questionnaire_request

Args:
  • questionnaire_request: the questionnaire_request to get the questionnaires for.
Returns:
A list of questionnaires for the given questionnaire_request
get_context(patient, healthprofessional, questionnaire_request)[source]

Generate the default context used to render all report templates

Args:
  • patient: the patient instance to include
  • healthprofessional: the healthprofessional instance to include
  • questionnaire_request: the questionnaire_request instance to include
Returns:
the context dict
render_template(request, patient, healthprofessional, questionnaire_request, template_name)[source]

Render the template based on the given arguments

Args:
  • request: the current request
  • patient: the patient coupled to the report
  • healthprofessional: the healthprofessional of the patient
  • questionnaire_request: the questionnaire_request coupled to this report
  • template_name: the (relative) path & name of the template
Returns:
The rendered template
class apps.report.views.ReportBaseView(**kwargs)[source]

Bases: apps.healthperson.patient.views.PatientBaseView

Base class based view for all report generating views. Conditionally adds report, message to the view if present.

class apps.report.views.QuestionnaireView(**kwargs)[source]

Bases: apps.report.views.ReportBaseView, django.views.generic.base.TemplateView

Class based view for showing all filled in data of a questionnaire. Uses the same templates as used for the patient questionnaire views.

class apps.report.views.ReportView(**kwargs)[source]

Bases: apps.report.views.ReportBaseView, django.views.generic.base.TemplateView

Shows the (decrypted) report

class apps.report.views.ReportExportBase(**kwargs)[source]

Bases: apps.report.views.ReportBaseView

Class based view which is the base for all export views (currently DocX and PDF)

get_body()[source]
Returns:
The body in HTML to export.
class apps.report.views.ReportDocX(**kwargs)[source]

Bases: apps.report.views.ReportExportBase

Returns the report in DocX format

class apps.report.views.ReportPDF(**kwargs)[source]

Bases: apps.report.views.ReportExportBase

Returns the report in PDF format

class apps.report.views.PrintReport(**kwargs)[source]

Bases: apps.report.views.ReportExportBase

Returns the report in HTML for easy printing (Not used on the moment)

class apps.report.views.ReportEditbase(**kwargs)[source]

Bases: apps.report.views.ReportBaseView, core.views.FormView

Class based view which is the base for the editing/adding reports views

class apps.report.views.UrgentReportEdit(**kwargs)[source]

Bases: apps.report.views.ReportEditbase

Edit reports for urgent controls

form_class

alias of UrgentReportAddEditForm

class apps.report.views.ReportEdit(**kwargs)[source]

Bases: apps.report.views.ReportEditbase

Edit reports for normal controls

form_class

alias of ReportAddEditForm

class apps.report.views.MessageView(**kwargs)[source]

Bases: apps.report.views.ReportView

Show the (decrypted) message

class apps.report.views.MessageEdit(**kwargs)[source]

Bases: apps.report.views.ReportBaseView, core.views.FormView

Edit an existing message

form_class

alias of MessageAddEditForm

get_form_kwargs()[source]

Include the healthprofessional instance

class apps.report.views.HandlingFinish(**kwargs)[source]

Bases: apps.report.views.ReportView

When a report and message has been added the questionnaire handling can be ‘finished’ by the healthprofessional. During this step the message is sent to the patient and the report becomes read-only.