Patient registration module.
Project description
edc-registration
The model RegisteredSubject is used by the Edc as the master subject registration table. Only one record may exist per individual. The table has space for PII so typically a RegisteredSubject instance is created or updated on completion of the informed consent. As always, PII in the Edc is encrypted at rest using django-crypto-field.
For the model and signal to be registered you need to add the AppConfig to your INSTALLED_APPS:
INSTALLED_APPS = (
....
'edc_registration.apps.AppConfig',
....
)
UpdatesOrCreatesRegistrationModelMixin
RegisteredSubject is never edited directly by the user. Instead some other model with the needed attributes is used as a proxy. To have a model perform the task of creating or updating RegisteredSubject, declare it with the UpdatesOrCreatesRegistrationModelMixin.
For example, a model, SubjectEligibility or a screening model creates or updates RegisteredSubject without a subject identifier then a model such as the SubjectConsent in tests.models, also creates or updates a subject’s RegisteredSubject instance on save. For this to happen, both models are declared with the UpdatesOrCreatesRegistrationModelMixin:
class SubjectEligibility(UniqueSubjectIdentifierModelMixin,
UpdatesOrCreatesRegistrationModelMixin, BaseUuidModel):
screening_identifier = models.CharField(
max_length=36,
null=True,
unique=True)
@property
def registration_unique_field(self):
return 'screening_identifier'
def update_subject_identifier_on_save(self):
"""Overridden to not set the subject identifier on save.
"""
if not self.subject_identifier:
self.subject_identifier = self.subject_identifier_as_pk.hex
self.subject_identifier_aka = self.subject_identifier_as_pk.hex
return self.subject_identifier
class SubjectConsent(
ConsentModelMixin, UpdatesOrCreatesRegistrationModelMixin,
CreateAppointmentsMixin, IdentityFieldsMixin, ReviewFieldsMixin,
PersonalFieldsMixin, CitizenFieldsMixin, VulnerabilityFieldsMixin,
BaseUuidModel):
@property
def registration_unique_field(self):
return 'screening_identifier'
class Meta:
app_label = 'my_app'
The property registration_unique_field returns a model attribute that is used to set a registration identifier on RegisteredSubject.
A subject’s RegisteredSubject instance is created and updated in a post_save signal. As mentioned, it is never edited directly by the user.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for edc-registration-0.2.16.macosx-10.13-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e189c6e6f9a48e957f3f814ca15ec826f87c283bd910c7588aba9c49391a00de |
|
MD5 | 1c7cc5cc3f87dd7ae3d160d05a20445f |
|
BLAKE2b-256 | ddffc531ba4b6b3dcf419fd3145e00aa281f5e4a90dbd1488954bdc19e9f6c32 |
Hashes for edc_registration-0.2.16-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0ae67821beed436c171c21ec44dbb70d52544d0ac379034768dda2008e0769 |
|
MD5 | 0bccb564a4624d8a5ba50cce3f8da729 |
|
BLAKE2b-256 | c7e652add342560e15a51c1ca4ca126d30a0a08e5c64453d8e1a46d302dc5456 |