edc-crf


Nameedc-crf JSON
Version 0.3.74 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-crf
SummaryBase classes for CRFs in clinicedc/edc projects
upload_time2024-04-10 15:19:32
maintainerNone
docs_urlNone
authorErik van Widenfelt
requires_python>=3.11
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.11",
    "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/cc/ea/4710f72601efda9d3a53bc6f0997bf5fb68644cfd2020adb7b69518c46bf/edc-crf-0.3.74.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\n",
    "bugtrack_url": null,
    "license": "GPL license, see LICENSE",
    "summary": "Base classes for CRFs in clinicedc/edc projects",
    "version": "0.3.74",
    "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": "44f96b8460fd8b36c21bb373141bed4eeec183fa1e83c93219949e102c4bff75",
                "md5": "c24042584c5731f0816ba810ab1fc7df",
                "sha256": "a21d78451ab54bb7d0a00ef8ff42aa3af6ac1cca8a0e819e862b205d8f25526b"
            },
            "downloads": -1,
            "filename": "edc_crf-0.3.74-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c24042584c5731f0816ba810ab1fc7df",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 51441,
            "upload_time": "2024-04-10T15:19:30",
            "upload_time_iso_8601": "2024-04-10T15:19:30.868650Z",
            "url": "https://files.pythonhosted.org/packages/44/f9/6b8460fd8b36c21bb373141bed4eeec183fa1e83c93219949e102c4bff75/edc_crf-0.3.74-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ccea4710f72601efda9d3a53bc6f0997bf5fb68644cfd2020adb7b69518c46bf",
                "md5": "14ff03353e6487ab24bc9c47a8e23758",
                "sha256": "3b3e42bc429528983e9354ddc4df8628ef937f307cfbdaaa58035766e8e2e6b9"
            },
            "downloads": -1,
            "filename": "edc-crf-0.3.74.tar.gz",
            "has_sig": false,
            "md5_digest": "14ff03353e6487ab24bc9c47a8e23758",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 42941,
            "upload_time": "2024-04-10T15:19:32",
            "upload_time_iso_8601": "2024-04-10T15:19:32.574248Z",
            "url": "https://files.pythonhosted.org/packages/cc/ea/4710f72601efda9d3a53bc6f0997bf5fb68644cfd2020adb7b69518c46bf/edc-crf-0.3.74.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 15:19:32",
    "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.23433s