Skip to main content

Patient registration module.

Project description

pypi travis coverage

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

edc_registration-0.2.19-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file edc-registration-0.2.19.macosx-10.13-x86_64.tar.gz.

File metadata

  • Download URL: edc-registration-0.2.19.macosx-10.13-x86_64.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for edc-registration-0.2.19.macosx-10.13-x86_64.tar.gz
Algorithm Hash digest
SHA256 4d9b5abd33effc5bc4b1126c1239d6f07c83c7af5820fcacb737895b15e7263a
MD5 92f6172bf8723984bb354854b297fa40
BLAKE2b-256 5029dd95410255155541a7b03329c6274f72e6764de1c4f2cf37aa403f5e153d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edc_registration-0.2.19-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for edc_registration-0.2.19-py3-none-any.whl
Algorithm Hash digest
SHA256 6a770cb3a3c5c82742f17e90154d14559c9c5ebeb3112fd4ec8069e2c54db622
MD5 8de8fd8b6859afb9efe3b1f214eb3075
BLAKE2b-256 ce8df49a10b393c8851cebc3fb69638a53be2fbd2d9ebbeeef088fd6b5dc1592

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