edc-mnsi


Nameedc-mnsi JSON
Version 0.3.6 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-mnsi
SummaryMNSI form/model for the clinicedc/edc and other django projects
upload_time2024-11-20 22:40:56
maintainerNone
docs_urlNone
authorJonathan Willitts
requires_python>=3.12
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.history 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/actions/workflows/build.yml/badge.svg
  :target: https://github.com/clinicedc/edc-mnsi/actions/workflows/build.yml

.. |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": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "django edc mnsi, clinicedc, clinical trials",
    "author": "Jonathan Willitts",
    "author_email": "Jonathan.Willitts@lstmed.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/e8/d6/682ca81a192ede35b03e6f60fd0c4dbe5a1e76a6816a5af57bac7af5fc59/edc_mnsi-0.3.6.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.history 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/actions/workflows/build.yml/badge.svg\n  :target: https://github.com/clinicedc/edc-mnsi/actions/workflows/build.yml\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.3.6",
    "project_urls": {
        "Homepage": "https://github.com/clinicedc/edc-mnsi"
    },
    "split_keywords": [
        "django edc mnsi",
        " clinicedc",
        " clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0768700d622072b1f287fd4ac9323598826e401218c5db1b8b0cb634953bf4c",
                "md5": "6c3bab53774bd3a744120b4f3b917935",
                "sha256": "3c4f4c9b77ca7345dd1dc614ab4ceb927b7963bfe417888147449c5128543823"
            },
            "downloads": -1,
            "filename": "edc_mnsi-0.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c3bab53774bd3a744120b4f3b917935",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 51189,
            "upload_time": "2024-11-20T22:40:55",
            "upload_time_iso_8601": "2024-11-20T22:40:55.132310Z",
            "url": "https://files.pythonhosted.org/packages/f0/76/8700d622072b1f287fd4ac9323598826e401218c5db1b8b0cb634953bf4c/edc_mnsi-0.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8d6682ca81a192ede35b03e6f60fd0c4dbe5a1e76a6816a5af57bac7af5fc59",
                "md5": "0ce46db99677f12e428498e156be1c6d",
                "sha256": "9af81efb9b8e304be15db69ea2082f66e7607133976a3f7e9f46f5a1f642a97a"
            },
            "downloads": -1,
            "filename": "edc_mnsi-0.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "0ce46db99677f12e428498e156be1c6d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 44869,
            "upload_time": "2024-11-20T22:40:56",
            "upload_time_iso_8601": "2024-11-20T22:40:56.869413Z",
            "url": "https://files.pythonhosted.org/packages/e8/d6/682ca81a192ede35b03e6f60fd0c4dbe5a1e76a6816a5af57bac7af5fc59/edc_mnsi-0.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 22:40:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clinicedc",
    "github_project": "edc-mnsi",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-mnsi"
}
        
Elapsed time: 3.47937s