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.40.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edc_registration-0.3.40-py3-none-any.whl (51.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edc-registration-0.3.40.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for edc-registration-0.3.40.tar.gz
Algorithm Hash digest
SHA256 6509d27163e7f0ec91d93d854a02db4bc3e71f3a1042144454076ea3a5a07b5a
MD5 3088e593bb258f1cd50fccc3277a458b
BLAKE2b-256 2fccb19908e9d6e2a5d04ef98900976b04e74298339aab6b034e1e89eaca4b95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for edc_registration-0.3.40-py3-none-any.whl
Algorithm Hash digest
SHA256 6bf6d6c40344e748cedc2e6f1a554cf9cae2b9bfa5af0ca319199a9c912dc2f2
MD5 2b6c4d9b6d0a30d102049eb1276ad7a8
BLAKE2b-256 709933028d96e523a95f9341c73697814324852407584ae2cc693f9f1cd1203c

See more details on using hashes here.

Supported by

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