|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/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.11",
"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/c2/86/f4589df88291cb58b45ecee2e60ba0ccc987c4e80c193ca02e365f34c794/edc-mnsi-0.3.5.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/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.3.5",
"project_urls": {
"Homepage": "https://github.com/clinicedc/edc-mnsi"
},
"split_keywords": [
"django edc mnsi",
"clinicedc",
"clinical trials"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8258d8f3df1c8d8c524b0ff935382853cc390a29f95c7486c6dcf83323e30bab",
"md5": "af782b170e3eb59fed89abfad05a94c8",
"sha256": "277f744c7324776fb88823e12e5cbf3bfd8cad213b2e2abc81b0aa349b7ff6fe"
},
"downloads": -1,
"filename": "edc_mnsi-0.3.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "af782b170e3eb59fed89abfad05a94c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 51197,
"upload_time": "2024-02-11T18:19:11",
"upload_time_iso_8601": "2024-02-11T18:19:11.327004Z",
"url": "https://files.pythonhosted.org/packages/82/58/d8f3df1c8d8c524b0ff935382853cc390a29f95c7486c6dcf83323e30bab/edc_mnsi-0.3.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c286f4589df88291cb58b45ecee2e60ba0ccc987c4e80c193ca02e365f34c794",
"md5": "a360eef936366ac807ccf08651d38828",
"sha256": "875d7dd702eed20c359e85fda2f59dd03b44d37f83eb0c97df0991061f20c694"
},
"downloads": -1,
"filename": "edc-mnsi-0.3.5.tar.gz",
"has_sig": false,
"md5_digest": "a360eef936366ac807ccf08651d38828",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 44768,
"upload_time": "2024-02-11T18:19:13",
"upload_time_iso_8601": "2024-02-11T18:19:13.276498Z",
"url": "https://files.pythonhosted.org/packages/c2/86/f4589df88291cb58b45ecee2e60ba0ccc987c4e80c193ca02e365f34c794/edc-mnsi-0.3.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-11 18:19:13",
"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"
}