edc-mnsi


Nameedc-mnsi JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-mnsi
SummaryMNSI form/model for the clinicedc/edc and other django projects
upload_time2022-06-23 21:19:44
maintainer
docs_urlNone
authorJonathan Willitts
requires_python>=3.8
licenseGPL license, see LICENSE
keywords django edc mnsi clinicedc clinical trials
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            |pypi| |actions| |codecov| |downloads|

edc-mnsi
--------

Django classes for the Michigan Neuropathy Screening Instrument (MNSI).

* https://pubmed.ncbi.nlm.nih.gov/7821168/
* https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3641573/ (omits monofilament testing)
* https://medicine.umich.edu/sites/default/files/downloads/MNSI_howto.pdf

MNSI scores are calculated in ``signals.py`` through a call to the ``MnsiCalculator`` and stored in two calculated fields on the model. The two calculated fields can also be viewed as read only on the form in Admin.

See also:

* https://github.com/clinicedc/edc
* https://github.com/meta-trial/meta-edc

``edc_mnsi`` has an ``Mnsi`` model. If the default model does not meet your needs,
you can use the ``Mnsi`` model mixin, ``MnsiModelMixin``, and declare a custom ``Mnsi`` model in your app.

.. code-block:: python

    # models.py
    from edc_mnsi.model_mixins import MnsiModelMixin
    from edc_model import models as edc_models
    # a custom mixin
    from ..model_mixins import CrfModelMixin


    class Mnsi(
        MnsiModelMixin,
        CrfModelMixin,
        edc_models.BaseUuidModel,
    ):
        class Meta(MnsiModelMixin.Meta, CrfModelMixin.Meta, edc_models.BaseUuidModel.Meta):
            pass

Add the following to ``settings`` if using a custom ``Mnsi`` model::

    EDC_MNSI_MODEL = "my_app.mnsi"

Note: ``settings.EDC_MNSI_MODEL`` is needed by ``edc_mnsi.auths.py`` to find the ``Mnsi`` model.
This is applicable if you are using ``edc_auth``.

A custom admin class will be needed for your custom ``Mnsi`` model. Here is an example of a custom ``admin`` class that refers to fields added to the custom ``Mnsi`` model and adds a custom ``modeladmin`` mixin.

Note: In your custom ``admin`` you should unregister the default ``admin`` class before registering your custom ``admin`` class.

.. code-block:: python

    # admin.py
    from django.contrib import admin
    from django_audit_fields import audit_fieldset_tuple
    from edc_crf.admin import crf_status_fieldset_tuple
    from edc_mnsi.admin_site import edc_mnsi_admin
    from edc_mnsi.fieldsets import calculated_values_fieldset
    from edc_mnsi.fieldsets import get_fieldsets as get_mnsi_fieldsets
    from edc_mnsi.model_admin_mixin import MnsiModelAdminMixin, radio_fields
    from edc_mnsi.models import Mnsi as DefaultMnsi
    from edc_model_admin import SimpleHistoryAdmin

    # your app's admin site
    from ..admin_site import my_app_admin
    # your custom form
    from ..forms import MnsiForm
    # your custom model
    from ..models import Mnsi
    # a custom mixin
    from .modeladmin import CrfModelAdmin

    # customize the fieldsets as needed
    def get_fieldsets():
        fieldset = (
            None,
            {
                "fields": (
                    "subject_visit",
                    "report_datetime",
                    "mnsi_performed",
                    "mnsi_not_performed_reason",
                )
            },
        )

        fieldsets = (fieldset,) + get_mnsi_fieldsets()
        fieldsets += (crf_status_fieldset_tuple,)
        fieldsets += (calculated_values_fieldset,)
        fieldsets += (audit_fieldset_tuple,)
        return fieldsets

    # customize radio_fields
    radio_fields.update(crf_status=admin.VERTICAL)
    # unregister the default model
    edc_mnsi_admin.unregister(DefaultMnsi)

    @admin.register(Mnsi, site=meta_subject_admin)
    class MnsiAdmin(
        MnsiModelAdminMixin,
        CrfModelAdmin,
        SimpleHistoryAdmin,
    ):
        form = MnsiForm
        fieldsets = get_fieldsets()
        radio_fields = radio_fields

|django|

.. |django| image:: https://www.djangoproject.com/m/img/badges/djangomade124x25.gif
   :target: http://www.djangoproject.com/
   :alt: Made with Django

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

.. |actions| image:: https://github.com/clinicedc/edc-mnsi/workflows/build/badge.svg?branch=develop
  :target: https://github.com/clinicedc/edc-mnsi/actions?query=workflow:build

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

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clinicedc/edc-mnsi",
    "name": "edc-mnsi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "django edc mnsi,clinicedc,clinical trials",
    "author": "Jonathan Willitts",
    "author_email": "Jonathan.Willitts@lstmed.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/22/0a/c97b73278e7a8ab877de64b414f91db62996e9fcace004f29c171ead3812/edc-mnsi-0.1.7.tar.gz",
    "platform": null,
    "description": "|pypi| |actions| |codecov| |downloads|\n\nedc-mnsi\n--------\n\nDjango classes for the Michigan Neuropathy Screening Instrument (MNSI).\n\n* https://pubmed.ncbi.nlm.nih.gov/7821168/\n* https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3641573/ (omits monofilament testing)\n* https://medicine.umich.edu/sites/default/files/downloads/MNSI_howto.pdf\n\nMNSI scores are calculated in ``signals.py`` through a call to the ``MnsiCalculator`` and stored in two calculated fields on the model. The two calculated fields can also be viewed as read only on the form in Admin.\n\nSee also:\n\n* https://github.com/clinicedc/edc\n* https://github.com/meta-trial/meta-edc\n\n``edc_mnsi`` has an ``Mnsi`` model. If the default model does not meet your needs,\nyou can use the ``Mnsi`` model mixin, ``MnsiModelMixin``, and declare a custom ``Mnsi`` model in your app.\n\n.. code-block:: python\n\n    # models.py\n    from edc_mnsi.model_mixins import MnsiModelMixin\n    from edc_model import models as edc_models\n    # a custom mixin\n    from ..model_mixins import CrfModelMixin\n\n\n    class Mnsi(\n        MnsiModelMixin,\n        CrfModelMixin,\n        edc_models.BaseUuidModel,\n    ):\n        class Meta(MnsiModelMixin.Meta, CrfModelMixin.Meta, edc_models.BaseUuidModel.Meta):\n            pass\n\nAdd the following to ``settings`` if using a custom ``Mnsi`` model::\n\n    EDC_MNSI_MODEL = \"my_app.mnsi\"\n\nNote: ``settings.EDC_MNSI_MODEL`` is needed by ``edc_mnsi.auths.py`` to find the ``Mnsi`` model.\nThis is applicable if you are using ``edc_auth``.\n\nA custom admin class will be needed for your custom ``Mnsi`` model. Here is an example of a custom ``admin`` class that refers to fields added to the custom ``Mnsi`` model and adds a custom ``modeladmin`` mixin.\n\nNote: In your custom ``admin`` you should unregister the default ``admin`` class before registering your custom ``admin`` class.\n\n.. code-block:: python\n\n    # admin.py\n    from django.contrib import admin\n    from django_audit_fields import audit_fieldset_tuple\n    from edc_crf.admin import crf_status_fieldset_tuple\n    from edc_mnsi.admin_site import edc_mnsi_admin\n    from edc_mnsi.fieldsets import calculated_values_fieldset\n    from edc_mnsi.fieldsets import get_fieldsets as get_mnsi_fieldsets\n    from edc_mnsi.model_admin_mixin import MnsiModelAdminMixin, radio_fields\n    from edc_mnsi.models import Mnsi as DefaultMnsi\n    from edc_model_admin import SimpleHistoryAdmin\n\n    # your app's admin site\n    from ..admin_site import my_app_admin\n    # your custom form\n    from ..forms import MnsiForm\n    # your custom model\n    from ..models import Mnsi\n    # a custom mixin\n    from .modeladmin import CrfModelAdmin\n\n    # customize the fieldsets as needed\n    def get_fieldsets():\n        fieldset = (\n            None,\n            {\n                \"fields\": (\n                    \"subject_visit\",\n                    \"report_datetime\",\n                    \"mnsi_performed\",\n                    \"mnsi_not_performed_reason\",\n                )\n            },\n        )\n\n        fieldsets = (fieldset,) + get_mnsi_fieldsets()\n        fieldsets += (crf_status_fieldset_tuple,)\n        fieldsets += (calculated_values_fieldset,)\n        fieldsets += (audit_fieldset_tuple,)\n        return fieldsets\n\n    # customize radio_fields\n    radio_fields.update(crf_status=admin.VERTICAL)\n    # unregister the default model\n    edc_mnsi_admin.unregister(DefaultMnsi)\n\n    @admin.register(Mnsi, site=meta_subject_admin)\n    class MnsiAdmin(\n        MnsiModelAdminMixin,\n        CrfModelAdmin,\n        SimpleHistoryAdmin,\n    ):\n        form = MnsiForm\n        fieldsets = get_fieldsets()\n        radio_fields = radio_fields\n\n|django|\n\n.. |django| image:: https://www.djangoproject.com/m/img/badges/djangomade124x25.gif\n   :target: http://www.djangoproject.com/\n   :alt: Made with Django\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc-mnsi.svg\n    :target: https://pypi.python.org/pypi/edc-mnsi\n\n.. |actions| image:: https://github.com/clinicedc/edc-mnsi/workflows/build/badge.svg?branch=develop\n  :target: https://github.com/clinicedc/edc-mnsi/actions?query=workflow:build\n\n.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-mnsi/branch/develop/graph/badge.svg\n    :target: https://codecov.io/gh/clinicedc/edc-mnsi\n\n.. |downloads| image:: https://pepy.tech/badge/edc-mnsi\n    :target: https://pepy.tech/project/edc-mnsi\n",
    "bugtrack_url": null,
    "license": "GPL license, see LICENSE",
    "summary": "MNSI form/model for the clinicedc/edc and other django projects",
    "version": "0.1.7",
    "split_keywords": [
        "django edc mnsi",
        "clinicedc",
        "clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "b49d00d7b85c2fbacfcdc673155884f2",
                "sha256": "6aa0e2c02306f23622ca18d39fc6868646208da2cf60f951320ddd2fb6807dfd"
            },
            "downloads": -1,
            "filename": "edc_mnsi-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b49d00d7b85c2fbacfcdc673155884f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 45604,
            "upload_time": "2022-06-23T21:19:40",
            "upload_time_iso_8601": "2022-06-23T21:19:40.269567Z",
            "url": "https://files.pythonhosted.org/packages/37/79/eb0528415d88f07a3852137adbf80488161c628627316c465c0b657bb173/edc_mnsi-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "06f78044e44f5cc3d7b2a94840e877b8",
                "sha256": "a8eb70a4cfab60c4caf26a426c52268f4e38cb5a2fbc4a7cd9d04db9f91f564e"
            },
            "downloads": -1,
            "filename": "edc-mnsi-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "06f78044e44f5cc3d7b2a94840e877b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 41036,
            "upload_time": "2022-06-23T21:19:44",
            "upload_time_iso_8601": "2022-06-23T21:19:44.064887Z",
            "url": "https://files.pythonhosted.org/packages/22/0a/c97b73278e7a8ab877de64b414f91db62996e9fcace004f29c171ead3812/edc-mnsi-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-06-23 21:19:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "clinicedc",
    "github_project": "edc-mnsi",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-mnsi"
}
        
Elapsed time: 0.49830s