edc-crf


Nameedc-crf JSON
Version 0.3.75 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-crf
SummaryBase classes for CRFs in clinicedc/edc projects
upload_time2024-05-20 16:26:43
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/e5/bb/806ba3acedc59cd3f1231d44578d621ddc139c26f0612f3def1fd3d4871e/edc_crf-0.3.75.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.75",
    "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": "7ca06a21bdfcc1a6aaef873a284c6c7007a730a78559ee76d04125a27899f113",
                "md5": "21a1263de030834b5a5440350336eecb",
                "sha256": "cec69756473887eec77b1c29b39c2348db37e95c13d8c72a7e54c6674fae09c3"
            },
            "downloads": -1,
            "filename": "edc_crf-0.3.75-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "21a1263de030834b5a5440350336eecb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 51427,
            "upload_time": "2024-05-20T16:26:41",
            "upload_time_iso_8601": "2024-05-20T16:26:41.628045Z",
            "url": "https://files.pythonhosted.org/packages/7c/a0/6a21bdfcc1a6aaef873a284c6c7007a730a78559ee76d04125a27899f113/edc_crf-0.3.75-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e5bb806ba3acedc59cd3f1231d44578d621ddc139c26f0612f3def1fd3d4871e",
                "md5": "248cb349224b419ca86704a0443c5e2b",
                "sha256": "71ad8cefabdb2ab6ddb6eadcac1ba5760d90b1fa97301937f46320c08c5c2005"
            },
            "downloads": -1,
            "filename": "edc_crf-0.3.75.tar.gz",
            "has_sig": false,
            "md5_digest": "248cb349224b419ca86704a0443c5e2b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 42969,
            "upload_time": "2024-05-20T16:26:43",
            "upload_time_iso_8601": "2024-05-20T16:26:43.270842Z",
            "url": "https://files.pythonhosted.org/packages/e5/bb/806ba3acedc59cd3f1231d44578d621ddc139c26f0612f3def1fd3d4871e/edc_crf-0.3.75.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-20 16:26:43",
    "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: 2.03564s