models.py¶
This module contains the RCMessage model definition.
Class definitions:
-
class
apps.rcmessages.models.RCMessage(*args, **kwargs)[source]¶ Bases:
core.models.AuditBaseModelStores messages which can be sent from healthprofessional/secretary to patient with AES encryption
Note
It’s named RCMessage instead of just Message to avoid confusion with the Django build in Message
Parameters: - id (AutoField) –
- patient_id (ForeignKey to
Patient) – - healthprofessional_id (ForeignKey to
HealthProfessional) – - secretary_id (ForeignKey to
Secretary) – - related_to_id (ForeignKey to
QuestionnaireRequest) – - subject (
EncryptedCharField) – - internal_message (
EncryptedTextField) – - added_on (DateField) –
- read_on (DateField) –
-
sender¶ Shortcut to get the sender of the message
- Returns:
- self.healthprofessional or, if not set, self.secretary
-
audit_encryption_key_id¶ Get the EncryptionKey id so it can be coupled to the log item in the audit.
- Returns:
- The id of the EncryptionKey that is used to encrypt the model instance.