Skip to main content

Patient registration module for clinicedc/edc projects

Project description

pypi actions codecov downloads

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

edc-registration-0.3.21.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

edc_registration-0.3.21-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file edc-registration-0.3.21.tar.gz.

File metadata

  • Download URL: edc-registration-0.3.21.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.9

File hashes

Hashes for edc-registration-0.3.21.tar.gz
Algorithm Hash digest
SHA256 b388ed76a8119cbf44d74df9073f162f4ffc064e09a6871ee5b5b3ddd130c1a4
MD5 d81ae1845a798ba8650165772f589d2f
BLAKE2b-256 90ba82f353df9fd2ecc5ac43313623c95c5da8a518d43c7a0fac78cdef1b89a3

See more details on using hashes here.

File details

Details for the file edc_registration-0.3.21-py3-none-any.whl.

File metadata

File hashes

Hashes for edc_registration-0.3.21-py3-none-any.whl
Algorithm Hash digest
SHA256 49be48a22909cc931986d44cd5891fa367e121c5446067a3b51869d62c0df41d
MD5 f5c7b54cca8692a4612aa2eecc55acd4
BLAKE2b-256 acf227f32e5c4ffd3f2c62e898b7f88e1e213f7a2da375d08e54dcc64878c9d8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page