edc-lab


Nameedc-lab JSON
Version 0.3.62 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-lab
SummaryLIMS/lab classes for clinicedc/edc projects
upload_time2024-11-20 22:46:44
maintainerNone
docs_urlNone
authorErik van Widenfelt
requires_python>=3.12
licenseGPL license, see LICENSE
keywords django edc lab classes clinicedc clinical trials
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            |pypi| |actions| |codecov| |downloads|

edc-lab
-------

Add to settings:

.. code-block:: python

    INSTALLED_APPS = [
        ...
        'edc_lab.apps.AppConfig',
        ...
    ]

Configuration
-------------

Create aliquot types:

.. code-block:: python

    # aliquot types
    wb = AliquotType(name='whole_blood', alpha_code='WB', numeric_code='02')
    bc = AliquotType(name='buffy_coat', alpha_code='BC', numeric_code='16')
    pl = AliquotType(name='plasma', alpha_code='PL', numeric_code='32')

Add possible derivatives to an aliquot type:

.. code-block:: python

    # in this case, plasma and buffy coat are possible derivatives
    wb.add_derivatives(pl, bc)

Set up a processing profile:

.. code-block:: python

    viral_load = ProcessingProfile(
        name='viral_load', aliquot_type=wb)
    process_bc = Process(aliquot_type=bc, aliquot_count=4)
    process_pl = Process(aliquot_type=pl, aliquot_count=2)
    viral_load.add_processes(process_bc, process_pl)

Create a``panel`` that uses the processing profile:

.. code-block:: python

    panel = RequisitionPanel(
        name='Viral Load',
        processing_profile=viral_load)

Add the panel (and others) to a lab profile:

.. code-block:: python

    lab_profile = LabProfile(
        name='lab_profile',
        requisition_model='edc_lab.subjectrequisition')
    lab_profile.add_panel(panel)

Register the ``lab_profile`` with the site global:

.. code-block:: python

    site_labs.register(lab_profile)

Usage
-----

Create a requisition model instance:

.. code-block:: python

    requisition = SubjectRequisition.objects.create(
        subject_visit=self.subject_visit,
        panel_name=self.panel.name,
        is_drawn=YES)

Pass the requisition to ``Specimen``

.. code-block:: python

    specimen = Specimen(requisition=requisition)

Process:

.. code-block:: python

    specimen.process()

Aliquots have been created according to the configured processing profile:

.. code-block:: python

    >>> specimen.primary_aliquot.identifier
    '99900GV63F00000201'

    >>> for aliquot in specimen.aliquots.order_by('count'):
           print(aliquot.aliquot_identifier)
    '99900GV63F00000201'
    '99900GV63F02013202'
    '99900GV63F02013203'
    '99900GV63F02011604'
    '99900GV63F02011605'
    '99900GV63F02011606'
    '99900GV63F02011607'


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

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

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

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clinicedc/edc-lab",
    "name": "edc-lab",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "django, edc, lab classes, clinicedc, clinical trials",
    "author": "Erik van Widenfelt",
    "author_email": "ew2789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3b/53/7b972c66513e945c383ac203ed8eb1b16456f003121e30ac12ab9ae81819/edc_lab-0.3.62.tar.gz",
    "platform": null,
    "description": "|pypi| |actions| |codecov| |downloads|\n\nedc-lab\n-------\n\nAdd to settings:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        ...\n        'edc_lab.apps.AppConfig',\n        ...\n    ]\n\nConfiguration\n-------------\n\nCreate aliquot types:\n\n.. code-block:: python\n\n    # aliquot types\n    wb = AliquotType(name='whole_blood', alpha_code='WB', numeric_code='02')\n    bc = AliquotType(name='buffy_coat', alpha_code='BC', numeric_code='16')\n    pl = AliquotType(name='plasma', alpha_code='PL', numeric_code='32')\n\nAdd possible derivatives to an aliquot type:\n\n.. code-block:: python\n\n    # in this case, plasma and buffy coat are possible derivatives\n    wb.add_derivatives(pl, bc)\n\nSet up a processing profile:\n\n.. code-block:: python\n\n    viral_load = ProcessingProfile(\n        name='viral_load', aliquot_type=wb)\n    process_bc = Process(aliquot_type=bc, aliquot_count=4)\n    process_pl = Process(aliquot_type=pl, aliquot_count=2)\n    viral_load.add_processes(process_bc, process_pl)\n\nCreate a``panel`` that uses the processing profile:\n\n.. code-block:: python\n\n    panel = RequisitionPanel(\n        name='Viral Load',\n        processing_profile=viral_load)\n\nAdd the panel (and others) to a lab profile:\n\n.. code-block:: python\n\n    lab_profile = LabProfile(\n        name='lab_profile',\n        requisition_model='edc_lab.subjectrequisition')\n    lab_profile.add_panel(panel)\n\nRegister the ``lab_profile`` with the site global:\n\n.. code-block:: python\n\n    site_labs.register(lab_profile)\n\nUsage\n-----\n\nCreate a requisition model instance:\n\n.. code-block:: python\n\n    requisition = SubjectRequisition.objects.create(\n        subject_visit=self.subject_visit,\n        panel_name=self.panel.name,\n        is_drawn=YES)\n\nPass the requisition to ``Specimen``\n\n.. code-block:: python\n\n    specimen = Specimen(requisition=requisition)\n\nProcess:\n\n.. code-block:: python\n\n    specimen.process()\n\nAliquots have been created according to the configured processing profile:\n\n.. code-block:: python\n\n    >>> specimen.primary_aliquot.identifier\n    '99900GV63F00000201'\n\n    >>> for aliquot in specimen.aliquots.order_by('count'):\n           print(aliquot.aliquot_identifier)\n    '99900GV63F00000201'\n    '99900GV63F02013202'\n    '99900GV63F02013203'\n    '99900GV63F02011604'\n    '99900GV63F02011605'\n    '99900GV63F02011606'\n    '99900GV63F02011607'\n\n\n.. |pypi| image:: https://img.shields.io/pypi/v/edc-lab.svg\n    :target: https://pypi.python.org/pypi/edc-lab\n\n.. |actions| image:: https://github.com/clinicedc/edc-lab/actions/workflows/build.yml/badge.svg\n  :target: https://github.com/clinicedc/edc-lab/actions/workflows/build.yml\n\n.. |codecov| image:: https://codecov.io/gh/clinicedc/edc-lab/branch/develop/graph/badge.svg\n  :target: https://codecov.io/gh/clinicedc/edc-lab\n\n.. |downloads| image:: https://pepy.tech/badge/edc-lab\n   :target: https://pepy.tech/project/edc-lab\n",
    "bugtrack_url": null,
    "license": "GPL license, see LICENSE",
    "summary": "LIMS/lab classes for clinicedc/edc projects",
    "version": "0.3.62",
    "project_urls": {
        "Homepage": "https://github.com/clinicedc/edc-lab"
    },
    "split_keywords": [
        "django",
        " edc",
        " lab classes",
        " clinicedc",
        " clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4358c241a67e94874979a6b4f453b12148dfbdf26c80ac863db85e7a5298a406",
                "md5": "6886705ff55cd96d5a25453a4c633dea",
                "sha256": "28be19ba4d79647c5fdb824dedad98b45e6444a26ac9dfc1afacdbd30219f6eb"
            },
            "downloads": -1,
            "filename": "edc_lab-0.3.62-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6886705ff55cd96d5a25453a4c633dea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 133125,
            "upload_time": "2024-11-20T22:46:42",
            "upload_time_iso_8601": "2024-11-20T22:46:42.445449Z",
            "url": "https://files.pythonhosted.org/packages/43/58/c241a67e94874979a6b4f453b12148dfbdf26c80ac863db85e7a5298a406/edc_lab-0.3.62-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b537b972c66513e945c383ac203ed8eb1b16456f003121e30ac12ab9ae81819",
                "md5": "91a7bf98112fd9fcd472228f6378162d",
                "sha256": "91d5cf849c7d5b474d3bdb3216115d5a7c192aef34ae2151eec881d2043b6730"
            },
            "downloads": -1,
            "filename": "edc_lab-0.3.62.tar.gz",
            "has_sig": false,
            "md5_digest": "91a7bf98112fd9fcd472228f6378162d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 82472,
            "upload_time": "2024-11-20T22:46:44",
            "upload_time_iso_8601": "2024-11-20T22:46:44.348805Z",
            "url": "https://files.pythonhosted.org/packages/3b/53/7b972c66513e945c383ac203ed8eb1b16456f003121e30ac12ab9ae81819/edc_lab-0.3.62.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-20 22:46:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clinicedc",
    "github_project": "edc-lab",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-lab"
}
        
Elapsed time: 0.94844s