edc-he


Nameedc-he JSON
Version 0.3.12 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-he
SummaryBase django classes for health economics
upload_time2024-03-26 05:02:33
maintainerNone
docs_urlNone
authorErik van Widenfelt
requires_python>=3.11
licenseGPL license, see LICENSE
keywords django edc health economics clinicedc clinical trials
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            |pypi| |actions| |codecov| |downloads|

edc-he
------

Health economics model, form mixins for clinicedc / Django


Declare in `settings` if using concrete models not included in this app::

    EDC_HE_ASSETS_MODEL = "<label_lower>"
    EDC_HE_HOUSEHOLDHEAD_MODEL = "<label_lower>"
    EDC_HE_INCOME_MODEL = "<label_lower>"
    EDC_HE_PATIENT_MODEL = "<label_lower>"
    EDC_HE_PROPERTY_MODEL = "<label_lower>"

See also module ``intecomm_subject`` at https://github.com/intecomm-trial/intecomm-edc.

If you need to declare the Health Economics models in your app, use the provided model mixins.

For example, the ``HealthEconomicsHouseholdHead`` model would be declared like this:

.. code-block:: python

    # models.py

    class HealthEconomicsHouseholdHead(
        SingletonCrfModelMixin,
        HouseholdHeadModelMixin,
        HouseholdModelMixin,
        CrfModelMixin,
        BaseUuidModel,
    ):

        class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta):
            verbose_name = "Health Economics: Household head"
            verbose_name_plural = "Health Economics: Household head"


.. code-block:: python

    # forms.py

    class HealthEconomicsHouseholdHeadForm(
        CrfSingletonModelFormMixin, CrfModelFormMixin, forms.ModelForm
    ):
        form_validator_cls = HealthEconomicsHouseholdHeadFormValidator

        def clean(self):
            self.raise_if_singleton_exists()
            raise_if_clinical_review_does_not_exist(self.cleaned_data.get("subject_visit"))
            return super().clean()

.. code-block:: python

    # admin.py


    @admin.register(HealthEconomicsHouseholdHead, site=intecomm_subject_admin)
    class HealthEconomicsHouseholdHeadAdmin(
        HealthEconomicsHouseholdHeadModelAdminMixin, CrfModelAdmin
    ):
        form = HealthEconomicsHouseholdHeadForm


The metadata rules may also be declared locally


.. code-block:: python

    # metadata_rules.py

    from edc_he.rule_groups import Predicates as BaseHealthEconomicsPredicates
    from edc_he.rule_groups import HealthEconomicsRuleGroup as BaseHealthEconomicsRuleGroup

    class HealthEconomicsPredicates(BaseHealthEconomicsPredicates):
        app_label = "intecomm_subject"
        visit_model = "intecomm_subject.subjectvisit"

    @register()
    class HealthEconomicsRuleGroup(BaseHealthEconomicsRuleGroup):
        class Meta:
            app_label = "intecomm_subject"
            source_model = "intecomm_subject.subjectvisit"
            predicates = HealthEconomicsPredicates()



.. |pypi| image:: https://img.shields.io/pypi/v/edc-he.svg
    :target: https://pypi.python.org/pypi/edc-he

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

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

.. |downloads| image:: https://pepy.tech/badge/edc-he
   :target: https://pepy.tech/project/edc-he

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clinicedc/edc-he",
    "name": "edc-he",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "django Edc health economics, clinicedc, clinical trials",
    "author": "Erik van Widenfelt",
    "author_email": "ew2789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/39/be/9738bcd7ffaad0b9c48109dadc1ed523e9ffd9498c7b5791ccafc761b9f8/edc-he-0.3.12.tar.gz",
    "platform": null,
    "description": "|pypi| |actions| |codecov| |downloads|\n\nedc-he\n------\n\nHealth economics model, form mixins for clinicedc / Django\n\n\nDeclare in `settings` if using concrete models not included in this app::\n\n    EDC_HE_ASSETS_MODEL = \"<label_lower>\"\n    EDC_HE_HOUSEHOLDHEAD_MODEL = \"<label_lower>\"\n    EDC_HE_INCOME_MODEL = \"<label_lower>\"\n    EDC_HE_PATIENT_MODEL = \"<label_lower>\"\n    EDC_HE_PROPERTY_MODEL = \"<label_lower>\"\n\nSee also module ``intecomm_subject`` at https://github.com/intecomm-trial/intecomm-edc.\n\nIf you need to declare the Health Economics models in your app, use the provided model mixins.\n\nFor example, the ``HealthEconomicsHouseholdHead`` model would be declared like this:\n\n.. code-block:: python\n\n    # models.py\n\n    class HealthEconomicsHouseholdHead(\n        SingletonCrfModelMixin,\n        HouseholdHeadModelMixin,\n        HouseholdModelMixin,\n        CrfModelMixin,\n        BaseUuidModel,\n    ):\n\n        class Meta(CrfModelMixin.Meta, BaseUuidModel.Meta):\n            verbose_name = \"Health Economics: Household head\"\n            verbose_name_plural = \"Health Economics: Household head\"\n\n\n.. code-block:: python\n\n    # forms.py\n\n    class HealthEconomicsHouseholdHeadForm(\n        CrfSingletonModelFormMixin, CrfModelFormMixin, forms.ModelForm\n    ):\n        form_validator_cls = HealthEconomicsHouseholdHeadFormValidator\n\n        def clean(self):\n            self.raise_if_singleton_exists()\n            raise_if_clinical_review_does_not_exist(self.cleaned_data.get(\"subject_visit\"))\n            return super().clean()\n\n.. code-block:: python\n\n    # admin.py\n\n\n    @admin.register(HealthEconomicsHouseholdHead, site=intecomm_subject_admin)\n    class HealthEconomicsHouseholdHeadAdmin(\n        HealthEconomicsHouseholdHeadModelAdminMixin, CrfModelAdmin\n    ):\n        form = HealthEconomicsHouseholdHeadForm\n\n\nThe metadata rules may also be declared locally\n\n\n.. code-block:: python\n\n    # metadata_rules.py\n\n    from edc_he.rule_groups import Predicates as BaseHealthEconomicsPredicates\n    from edc_he.rule_groups import HealthEconomicsRuleGroup as BaseHealthEconomicsRuleGroup\n\n    class HealthEconomicsPredicates(BaseHealthEconomicsPredicates):\n        app_label = \"intecomm_subject\"\n        visit_model = \"intecomm_subject.subjectvisit\"\n\n    @register()\n    class HealthEconomicsRuleGroup(BaseHealthEconomicsRuleGroup):\n        class Meta:\n            app_label = \"intecomm_subject\"\n            source_model = \"intecomm_subject.subjectvisit\"\n            predicates = HealthEconomicsPredicates()\n\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc-he.svg\n    :target: https://pypi.python.org/pypi/edc-he\n\n.. |actions| image:: https://github.com/clinicedc/edc-he/actions/workflows/build.yml/badge.svg\n  :target: https://github.com/clinicedc/edc-he/actions/workflows/build.yml\n\n.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-he/branch/develop/graph/badge.svg\n  :target: https://codecov.io/gh/clinicedc/edc-he\n\n.. |downloads| image:: https://pepy.tech/badge/edc-he\n   :target: https://pepy.tech/project/edc-he\n",
    "bugtrack_url": null,
    "license": "GPL license, see LICENSE",
    "summary": "Base django classes for health economics",
    "version": "0.3.12",
    "project_urls": {
        "Homepage": "https://github.com/clinicedc/edc-he"
    },
    "split_keywords": [
        "django edc health economics",
        " clinicedc",
        " clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1cff422e84293e515170d2fb6821cfd031cf505e2eef44f704098c52cf47df38",
                "md5": "9cac0329c77d5539a7e5e9e577e51f10",
                "sha256": "9da65b9b96cd84d87e315e6771c70611d3a00c3eb5e724fe1c82aced43113252"
            },
            "downloads": -1,
            "filename": "edc_he-0.3.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9cac0329c77d5539a7e5e9e577e51f10",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 102522,
            "upload_time": "2024-03-26T05:02:31",
            "upload_time_iso_8601": "2024-03-26T05:02:31.702410Z",
            "url": "https://files.pythonhosted.org/packages/1c/ff/422e84293e515170d2fb6821cfd031cf505e2eef44f704098c52cf47df38/edc_he-0.3.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39be9738bcd7ffaad0b9c48109dadc1ed523e9ffd9498c7b5791ccafc761b9f8",
                "md5": "2e5a25d8be45c3230791c8181c37b0d4",
                "sha256": "1c3eec2d432fb663d7014dc5da2eef4dc28bbf1963998a33410b60e67eb36d12"
            },
            "downloads": -1,
            "filename": "edc-he-0.3.12.tar.gz",
            "has_sig": false,
            "md5_digest": "2e5a25d8be45c3230791c8181c37b0d4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 77253,
            "upload_time": "2024-03-26T05:02:33",
            "upload_time_iso_8601": "2024-03-26T05:02:33.377240Z",
            "url": "https://files.pythonhosted.org/packages/39/be/9738bcd7ffaad0b9c48109dadc1ed523e9ffd9498c7b5791ccafc761b9f8/edc-he-0.3.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-26 05:02:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clinicedc",
    "github_project": "edc-he",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-he"
}
        
Elapsed time: 0.31320s