edc-crf


Nameedc-crf JSON
Version 0.3.76 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-crf
SummaryBase classes for CRFs in clinicedc/edc projects
upload_time2024-11-20 22:54:17
maintainerNone
docs_urlNone
authorErik van Widenfelt
requires_python>=3.12
licenseGPL license, see LICENSE
keywords django edc case report forms crf clinicedc clinical trials
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            |pypi| |actions| |codecov| |downloads|

edc_crf
-------

In longitudinal clinical trials, CRFs (case report forms) are the most common
data collection forms required in the data collection schedule.

In addition to the logic checks that you will add for a specfic CRF, you also need
to validate a few general conditions. Most of these conditions are checked
relative to the ``report_datetime`` of the CRF data being submitted. Some examples
are:

* that a participant is consented and that their consent is still valid on the ``report_datetime``;
* that the CRF ``report_datetime`` makes sense relative to the covering visit report ``report_datetime``;
* that the participant is enrolled to the schedule (onschedule) on or after the ``report_datetime`` and has not been taken off the schedule (offschedule) on or before the ``report_datetime``;
* that the participant has not been taken off study on or before the ``report_datetime``.

CRF forms
+++++++++

The ``CrfModelFormMixin`` is used for all CRF modelforms. With this single
mixin the form:

* Checks for the consent relative to report datetime and this schedule (edc_consent);
* checks if participant is on/off schedule relative to report datetime and this schedule (edc_visit_schedule);
* validates subject_visit report datetime (edc_visit_tracking);
* checks if participant is offstudy relative to report datetime (edc_offstudy).

If any of the above conditions fail, a ``forms.ValidationError`` is raised.

The mixin imports mixins functionality from edc_consent_, edc_visit_schedule_,
edc_visit_tracking_, and edc_offstudy_.

.. code-block:: python

    from django import forms
    from edc_crf.modelform_mixins import CrfModelFormMixin
    from edc_form_validators import FormValidator

    from ..models import FollowupVitals


    class MyCrfFormValidator(FormValidator):
        pass


    class MyCrfForm(CrfModelFormMixin, forms.ModelForm):

        form_validator_cls = MyCrfFormValidator

        class Meta:
            model = MyCrf
            fields = "__all__"


CRF models
++++++++++

Similar to the ``CrfModelFormMixin``, the ``CrfModelMixin`` is used for all CRF models
and checks for the same conditions. However, if any of the conditions is met, an exception
is raised. You should render CRF models with a modelform class using the ``CRFModelFormMixin``
to catch these exceptions on the form where the user can respond.

.. code-block:: python

    class MyCrf(CrfModelMixin, BaseUuidModel):

        weight_determination = models.CharField(
            verbose_name="Is weight estimated or measured?",
            max_length=15,
            choices=WEIGHT_DETERMINATION,
        )

        class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta):
            verbose_name = "My CRF"
            verbose_name_plural = "My CRFs"






.. |pypi| image:: https://img.shields.io/pypi/v/edc_crf.svg
  :target: https://pypi.python.org/pypi/edc_crf

.. |actions| image:: https://github.com/clinicedc/edc-crf/actions/workflows/build.yml/badge.svg
  :target: https://github.com/clinicedc/edc-crf/actions/workflows/build.yml

.. |codecov| image:: https://codecov.io/gh/clinicedc/edc_crf/branch/develop/graph/badge.svg
  :target: https://codecov.io/gh/clinicedc/edc_crf

.. |downloads| image:: https://pepy.tech/badge/edc_crf
   :target: https://pepy.tech/project/edc_crf

.. _edc_consent: https://github.com/clinicedc/edc-consent
.. _edc_visit_schedule: https://github.com/clinicedc/edc-visit-schedule
.. _edc_visit_tracking: https://github.com/clinicedc/edc-visit-tracking
.. _edc_offstudy: https://github.com/clinicedc/edc-offstudy

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clinicedc/edc-crf",
    "name": "edc-crf",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "django Edc case report forms, CRF, clinicedc, clinical trials",
    "author": "Erik van Widenfelt",
    "author_email": "ew2789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c9/08/8bbe085b34978f5f2d751034d0e3dd8d33e62301313cf925c45c49a848d9/edc_crf-0.3.76.tar.gz",
    "platform": null,
    "description": "|pypi| |actions| |codecov| |downloads|\n\nedc_crf\n-------\n\nIn longitudinal clinical trials, CRFs (case report forms) are the most common\ndata collection forms required in the data collection schedule.\n\nIn addition to the logic checks that you will add for a specfic CRF, you also need\nto validate a few general conditions. Most of these conditions are checked\nrelative to the ``report_datetime`` of the CRF data being submitted. Some examples\nare:\n\n* that a participant is consented and that their consent is still valid on the ``report_datetime``;\n* that the CRF ``report_datetime`` makes sense relative to the covering visit report ``report_datetime``;\n* that the participant is enrolled to the schedule (onschedule) on or after the ``report_datetime`` and has not been taken off the schedule (offschedule) on or before the ``report_datetime``;\n* that the participant has not been taken off study on or before the ``report_datetime``.\n\nCRF forms\n+++++++++\n\nThe ``CrfModelFormMixin`` is used for all CRF modelforms. With this single\nmixin the form:\n\n* Checks for the consent relative to report datetime and this schedule (edc_consent);\n* checks if participant is on/off schedule relative to report datetime and this schedule (edc_visit_schedule);\n* validates subject_visit report datetime (edc_visit_tracking);\n* checks if participant is offstudy relative to report datetime (edc_offstudy).\n\nIf any of the above conditions fail, a ``forms.ValidationError`` is raised.\n\nThe mixin imports mixins functionality from edc_consent_, edc_visit_schedule_,\nedc_visit_tracking_, and edc_offstudy_.\n\n.. code-block:: python\n\n    from django import forms\n    from edc_crf.modelform_mixins import CrfModelFormMixin\n    from edc_form_validators import FormValidator\n\n    from ..models import FollowupVitals\n\n\n    class MyCrfFormValidator(FormValidator):\n        pass\n\n\n    class MyCrfForm(CrfModelFormMixin, forms.ModelForm):\n\n        form_validator_cls = MyCrfFormValidator\n\n        class Meta:\n            model = MyCrf\n            fields = \"__all__\"\n\n\nCRF models\n++++++++++\n\nSimilar to the ``CrfModelFormMixin``, the ``CrfModelMixin`` is used for all CRF models\nand checks for the same conditions. However, if any of the conditions is met, an exception\nis raised. You should render CRF models with a modelform class using the ``CRFModelFormMixin``\nto catch these exceptions on the form where the user can respond.\n\n.. code-block:: python\n\n    class MyCrf(CrfModelMixin, BaseUuidModel):\n\n        weight_determination = models.CharField(\n            verbose_name=\"Is weight estimated or measured?\",\n            max_length=15,\n            choices=WEIGHT_DETERMINATION,\n        )\n\n        class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta):\n            verbose_name = \"My CRF\"\n            verbose_name_plural = \"My CRFs\"\n\n\n\n\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc_crf.svg\n  :target: https://pypi.python.org/pypi/edc_crf\n\n.. |actions| image:: https://github.com/clinicedc/edc-crf/actions/workflows/build.yml/badge.svg\n  :target: https://github.com/clinicedc/edc-crf/actions/workflows/build.yml\n\n.. |codecov| image:: https://codecov.io/gh/clinicedc/edc_crf/branch/develop/graph/badge.svg\n  :target: https://codecov.io/gh/clinicedc/edc_crf\n\n.. |downloads| image:: https://pepy.tech/badge/edc_crf\n   :target: https://pepy.tech/project/edc_crf\n\n.. _edc_consent: https://github.com/clinicedc/edc-consent\n.. _edc_visit_schedule: https://github.com/clinicedc/edc-visit-schedule\n.. _edc_visit_tracking: https://github.com/clinicedc/edc-visit-tracking\n.. _edc_offstudy: https://github.com/clinicedc/edc-offstudy\n",
    "bugtrack_url": null,
    "license": "GPL license, see LICENSE",
    "summary": "Base classes for CRFs in clinicedc/edc projects",
    "version": "0.3.76",
    "project_urls": {
        "Homepage": "https://github.com/clinicedc/edc-crf"
    },
    "split_keywords": [
        "django edc case report forms",
        " crf",
        " clinicedc",
        " clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08448d5b656bc570416fdb8489b2a68aaae3f390d4c139604eb6e5129c25113f",
                "md5": "a92b47408decf60533d1f9123c543e33",
                "sha256": "90dd4714b30d379be46c7c2df995c5cee27ab0967d69b7d85e2984ab5d87818e"
            },
            "downloads": -1,
            "filename": "edc_crf-0.3.76-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a92b47408decf60533d1f9123c543e33",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 51465,
            "upload_time": "2024-11-20T22:54:15",
            "upload_time_iso_8601": "2024-11-20T22:54:15.693544Z",
            "url": "https://files.pythonhosted.org/packages/08/44/8d5b656bc570416fdb8489b2a68aaae3f390d4c139604eb6e5129c25113f/edc_crf-0.3.76-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9088bbe085b34978f5f2d751034d0e3dd8d33e62301313cf925c45c49a848d9",
                "md5": "be2392afde7f7df6151d425c1cf47a6d",
                "sha256": "cccb21e8f0ad531aa0b308480958c8e9538f41a194ef0de103f7623610f49312"
            },
            "downloads": -1,
            "filename": "edc_crf-0.3.76.tar.gz",
            "has_sig": false,
            "md5_digest": "be2392afde7f7df6151d425c1cf47a6d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 42833,
            "upload_time": "2024-11-20T22:54:17",
            "upload_time_iso_8601": "2024-11-20T22:54:17.471267Z",
            "url": "https://files.pythonhosted.org/packages/c9/08/8bbe085b34978f5f2d751034d0e3dd8d33e62301313cf925c45c49a848d9/edc_crf-0.3.76.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 22:54:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clinicedc",
    "github_project": "edc-crf",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-crf"
}
        
Elapsed time: 0.58402s