models.py

This module contains the patient model definition. The patient is coupled to a apps.account.models.User instance via the apps.healthperson.models.HealthPerson baseclass.

Inheritance-diagram:

Inheritance diagram of apps.healthperson.patient.models.Patient

Class and function definitions:

apps.healthperson.patient.models.add_weken(number)[source]

Adds ‘week’ or ‘weken’ to the provided number

Args:
  • number: the number of weeks
Returns:
the number with ‘week’ or ‘weken’ appended
class apps.healthperson.patient.models.Patient(*args, **kwargs)[source]

Bases: apps.healthperson.models.HealthPerson, core.models.AuditBaseModel

Stores patient specific information.

Parameters:
  • id (AutoField) –
  • polymorphic_ctype_id (ForeignKey to ContentType) –
  • added_on (DateField) –
  • added_by_id (ForeignKey to HealthPerson) –
  • healthperson_ptr_id (OneToOneField to HealthPerson) –
  • rc_registration_number (CharField) –
  • diagnose (CharField) – choices=[rheumatoid_arthritis, chron, colitis_ulcerosa, intestinal_transplantation]
  • excluded_questionnaires (TextField) –
  • current_practitioner_id (ForeignKey to HealthProfessional) –
  • regular_control_frequency (ChoiceOtherField) – choices=[never, 3_months, 6_months, 12_months, other]
  • blood_sample_frequency (ChoiceOtherField) – choices=[sameasregular, 3_months, 6_months, 12_months, other]
  • last_blood_sample (DateField) –
  • always_clinic_visit (CharField) – choices=[alwaysclinicvisit, onlyifwanted]
  • regular_control_start_notification (CharField) – choices=[sms_and_email, sms_only, email_only]
  • regular_control_reminder_notification (CharField) – choices=[sms_and_email, sms_only, email_only]
  • healthprofessional_handling_notification (CharField) – choices=[sms_and_email, sms_only, email_only]
  • message_notification (CharField) – choices=[sms_and_email, sms_only, email_only]
last_questionnaire_date
Returns:
The last questionnaire date or None
timedelta_since_last_questionnaire
Returns:
The timedelta since the last questionnaire date or None
days_since_last_questionnaire
Returns:
The days since the last questionnaire date or None
next_questionnaire_ready
Returns:
True if the next questionnaire is ready, which means it should be filled in. False otherwise.
next_questionnaire_date
Returns:
The next questionnaire date based on the last_questionnaire_date and the control_frequency setting or None
always_appointment
Returns:
True if there should always follow an appointment after the periodic control
display_regular_control_frequency
Returns:
The regular control frequency in readable format.
display_blood_sample_frequency
Returns:
The blood sample frequency in readable format.
include_blood_taken_questions
Returns:
True if the blood taken questions should be included, which is based on the blood sample frequency and the last last_blood_taken_date. False otherwise.
blood_taken_freq_display
Returns:
Returns the blood taken frequency in readable format
last_blood_taken_date
Returns:
The last date when blood was taken or None