edc-lab


Nameedc-lab JSON
Version 0.3.60 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-lab
SummaryLIMS/lab classes for clinicedc/edc projects
upload_time2024-03-26 05:03:25
maintainerNone
docs_urlNone
authorErik van Widenfelt
requires_python>=3.11
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.11",
    "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/a0/26/514aede33c0e213cfc7052338150f220e2ceaebc53c2ae2e33d4470a31c9/edc-lab-0.3.60.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.60",
    "project_urls": {
        "Homepage": "https://github.com/clinicedc/edc-lab"
    },
    "split_keywords": [
        "django",
        " edc",
        " lab classes",
        " clinicedc",
        " clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d51726416789853d7a09fdf5f2b653be10b6c849fe6ba57ad4291ae27f3fac10",
                "md5": "125559ea021593a5582ac04cf7ca0bbe",
                "sha256": "c36a5f37b2867241daca19d288e7ff70096026c7abfb4995d8da7f355dffee36"
            },
            "downloads": -1,
            "filename": "edc_lab-0.3.60-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "125559ea021593a5582ac04cf7ca0bbe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 132462,
            "upload_time": "2024-03-26T05:03:21",
            "upload_time_iso_8601": "2024-03-26T05:03:21.453671Z",
            "url": "https://files.pythonhosted.org/packages/d5/17/26416789853d7a09fdf5f2b653be10b6c849fe6ba57ad4291ae27f3fac10/edc_lab-0.3.60-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a026514aede33c0e213cfc7052338150f220e2ceaebc53c2ae2e33d4470a31c9",
                "md5": "8e8eece38b329e8eceff348a882b4ff4",
                "sha256": "c21c2af71c0fa08145f87ab118ca1fc7a4ea2466ed8499acf466887e5f49a985"
            },
            "downloads": -1,
            "filename": "edc-lab-0.3.60.tar.gz",
            "has_sig": false,
            "md5_digest": "8e8eece38b329e8eceff348a882b4ff4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 82292,
            "upload_time": "2024-03-26T05:03:25",
            "upload_time_iso_8601": "2024-03-26T05:03:25.330248Z",
            "url": "https://files.pythonhosted.org/packages/a0/26/514aede33c0e213cfc7052338150f220e2ceaebc53c2ae2e33d4470a31c9/edc-lab-0.3.60.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-26 05:03:25",
    "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.26924s