Patient registration module for clinicedc/edc projects
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
File details
Details for the file edc_registration-0.3.42.tar.gz
.
File metadata
- Download URL: edc_registration-0.3.42.tar.gz
- Upload date:
- Size: 37.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0b8e9619db0254c132d4c83c153479d09b7aae519405e7923ed9ae6fe55550 |
|
MD5 | 5e3519039f24d35eee7fb2624a325233 |
|
BLAKE2b-256 | f4dc4cfebb7e523bd14ab591bb8e9956a55191bf808179e940f7f4572f93c85b |
File details
Details for the file edc_registration-0.3.42-py3-none-any.whl
.
File metadata
- Download URL: edc_registration-0.3.42-py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87ba99a1d1ed36b9d5ebd59606ea2ade0b011f5e494e7ceb0dcfb9c5f1749643 |
|
MD5 | 0992e80c7cf8ef6c6ca1f32dc095d964 |
|
BLAKE2b-256 | 2b9afd72b89afc1acf8d8b297ea4611fedafeb54442e8212e220cbb3562588e7 |