|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:
.. code-block:: python
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``:
.. code-block:: python
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.
.. |pypi| image:: https://img.shields.io/pypi/v/edc-registration.svg
:target: https://pypi.python.org/pypi/edc-registration
.. |actions| image:: https://github.com/clinicedc/edc-registration/actions/workflows/build.yml/badge.svg
:target: https://github.com/clinicedc/edc-registration/actions/workflows/build.yml
.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-registration/branch/develop/graph/badge.svg
:target: https://codecov.io/gh/clinicedc/edc-registration
.. |downloads| image:: https://pepy.tech/badge/edc-registration
:target: https://pepy.tech/project/edc-registration
Raw data
{
"_id": null,
"home_page": "https://github.com/clinicedc/edc-registration",
"name": "edc-registration",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "django edc registration, clinicedc, clinical trials",
"author": "Erik van Widenfelt",
"author_email": "ew2789@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f4/dc/4cfebb7e523bd14ab591bb8e9956a55191bf808179e940f7f4572f93c85b/edc_registration-0.3.42.tar.gz",
"platform": null,
"description": "|pypi| |actions| |codecov| |downloads|\n\nedc-registration\n----------------\n\nThe 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``.\n\n\nFor the model and signal to be registered you need to add the AppConfig to your INSTALLED_APPS:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ....\n 'edc_registration.apps.AppConfig',\n ....\n )\n\n\n**UpdatesOrCreatesRegistrationModelMixin**\n\n``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``.\n\nFor 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``:\n\n.. code-block:: python\n\n class SubjectEligibility(UniqueSubjectIdentifierModelMixin,\n UpdatesOrCreatesRegistrationModelMixin, BaseUuidModel):\n\n screening_identifier = models.CharField(\n max_length=36,\n null=True,\n unique=True)\n\n \t@property\n def registration_unique_field(self):\n return 'screening_identifier'\n\n def update_subject_identifier_on_save(self):\n \"\"\"Overridden to not set the subject identifier on save.\n \"\"\"\n if not self.subject_identifier:\n self.subject_identifier = self.subject_identifier_as_pk.hex\n self.subject_identifier_aka = self.subject_identifier_as_pk.hex\n return self.subject_identifier\n\n class SubjectConsent(\n ConsentModelMixin, UpdatesOrCreatesRegistrationModelMixin,\n CreateAppointmentsMixin, IdentityFieldsMixin, ReviewFieldsMixin,\n PersonalFieldsMixin, CitizenFieldsMixin, VulnerabilityFieldsMixin,\n BaseUuidModel):\n\n\t\t@property\n\t def registration_unique_field(self):\n\t return 'screening_identifier'\n\n\t class Meta:\n\t app_label = 'my_app'\n\n\nThe property ``registration_unique_field`` returns a model attribute that is used to set a registration identifier on ``RegisteredSubject``.\n\nA subject's ``RegisteredSubject`` instance is created and updated in a ``post_save`` signal. As mentioned, it is never edited directly by the user.\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc-registration.svg\n :target: https://pypi.python.org/pypi/edc-registration\n\n.. |actions| image:: https://github.com/clinicedc/edc-registration/actions/workflows/build.yml/badge.svg\n :target: https://github.com/clinicedc/edc-registration/actions/workflows/build.yml\n\n.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-registration/branch/develop/graph/badge.svg\n :target: https://codecov.io/gh/clinicedc/edc-registration\n\n.. |downloads| image:: https://pepy.tech/badge/edc-registration\n :target: https://pepy.tech/project/edc-registration\n",
"bugtrack_url": null,
"license": "GPL license, see LICENSE",
"summary": "Patient registration module for clinicedc/edc projects",
"version": "0.3.42",
"project_urls": {
"Homepage": "https://github.com/clinicedc/edc-registration"
},
"split_keywords": [
"django edc registration",
" clinicedc",
" clinical trials"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2b9afd72b89afc1acf8d8b297ea4611fedafeb54442e8212e220cbb3562588e7",
"md5": "0992e80c7cf8ef6c6ca1f32dc095d964",
"sha256": "87ba99a1d1ed36b9d5ebd59606ea2ade0b011f5e494e7ceb0dcfb9c5f1749643"
},
"downloads": -1,
"filename": "edc_registration-0.3.42-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0992e80c7cf8ef6c6ca1f32dc095d964",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 52357,
"upload_time": "2024-11-20T22:05:31",
"upload_time_iso_8601": "2024-11-20T22:05:31.082401Z",
"url": "https://files.pythonhosted.org/packages/2b/9a/fd72b89afc1acf8d8b297ea4611fedafeb54442e8212e220cbb3562588e7/edc_registration-0.3.42-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f4dc4cfebb7e523bd14ab591bb8e9956a55191bf808179e940f7f4572f93c85b",
"md5": "5e3519039f24d35eee7fb2624a325233",
"sha256": "ee0b8e9619db0254c132d4c83c153479d09b7aae519405e7923ed9ae6fe55550"
},
"downloads": -1,
"filename": "edc_registration-0.3.42.tar.gz",
"has_sig": false,
"md5_digest": "5e3519039f24d35eee7fb2624a325233",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 37072,
"upload_time": "2024-11-20T22:05:32",
"upload_time_iso_8601": "2024-11-20T22:05:32.287646Z",
"url": "https://files.pythonhosted.org/packages/f4/dc/4cfebb7e523bd14ab591bb8e9956a55191bf808179e940f7f4572f93c85b/edc_registration-0.3.42.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-20 22:05:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "clinicedc",
"github_project": "edc-registration",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "edc-registration"
}