models.py

This module contains the RCMessage model definition.

Class definitions:

class apps.rcmessages.models.RCMessage(*args, **kwargs)[source]

Bases: core.models.AuditBaseModel

Stores 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:
message()[source]

Shortcut to the internal_message field

Returns:
self.internal_message
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.