edc-lab


Nameedc-lab JSON
Version 0.3.23 PyPI version JSON
download
home_pagehttps://github.com/clinicedc/edc-lab
SummaryLIMS/lab classes for clinicedc/edc projects
upload_time2022-06-23 20:57:31
maintainer
docs_urlNone
authorErik van Widenfelt
requires_python>=3.9
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/workflows/build/badge.svg?branch=develop
  :target: https://github.com/clinicedc/edc-lab/actions?query=workflow:build

.. |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": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "django,edc,lab classes,clinicedc,clinical trials",
    "author": "Erik van Widenfelt",
    "author_email": "ew2789@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/31/ba/8d7d548e7948d2fab798174ce6ae71d699bbdd538c98a9f516866bb32457/edc-lab-0.3.23.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/workflows/build/badge.svg?branch=develop\n  :target: https://github.com/clinicedc/edc-lab/actions?query=workflow:build\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.23",
    "split_keywords": [
        "django",
        "edc",
        "lab classes",
        "clinicedc",
        "clinical trials"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "b18c3029f2f53c5169440efaac7d9b77",
                "sha256": "6e1d6eac00d6e336ce1157f296a21fe7578ecdcbf0fa05b1fd74f8b0748b4527"
            },
            "downloads": -1,
            "filename": "edc_lab-0.3.23-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b18c3029f2f53c5169440efaac7d9b77",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 118563,
            "upload_time": "2022-06-23T20:57:28",
            "upload_time_iso_8601": "2022-06-23T20:57:28.588886Z",
            "url": "https://files.pythonhosted.org/packages/41/d2/91b02ff2d732d18677641f003cacb90ed11c94b2458fb22b87090bb317fc/edc_lab-0.3.23-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "367a7177cbd2c01753bfc9c076528884",
                "sha256": "c24e80cca19e97f4535a3fdec6ff7c98287912bde432ffc6eabf14a7efa97e47"
            },
            "downloads": -1,
            "filename": "edc-lab-0.3.23.tar.gz",
            "has_sig": false,
            "md5_digest": "367a7177cbd2c01753bfc9c076528884",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 74752,
            "upload_time": "2022-06-23T20:57:31",
            "upload_time_iso_8601": "2022-06-23T20:57:31.364858Z",
            "url": "https://files.pythonhosted.org/packages/31/ba/8d7d548e7948d2fab798174ce6ae71d699bbdd538c98a9f516866bb32457/edc-lab-0.3.23.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-06-23 20:57:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "clinicedc",
    "github_project": "edc-lab",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "edc-lab"
}
        
Elapsed time: 0.51565s