amsterdamumcdb


Nameamsterdamumcdb JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/AmsterdamUMC/AmsterdamUMCdb
SummaryCommon functions for data exploration on AmsterdamUMCdb
upload_time2024-05-17 01:35:49
maintainerNone
docs_urlNone
authorAmsterdam UMC Center for Critical Care Computational Intelligence
requires_python>=3
licenseNone
keywords amsterdamumcdb intensive care unit critical care medical patient data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/logo_c4i_square.png?raw=1" alt="Logo C4I" width=128px><img src="https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/logo_amds.png?raw=1" alt="Logo AMDS" width=128px/>


# Welcome

AmsterdamUMCdb is the first freely accessible European intensive care database. It is endorsed by the European Society
of Intensive Care Medicine (ESICM) and its Data Science Section. It contains de-identified health data related to tens
of thousands of intensive care unit admissions, including demographics, vital signs, laboratory tests and medications.

# Version

The current version of AmsterdamUMCdb is 1.0.2, released in March 2020. This version contains data related to 23,106
intensive care unit and high dependency unit admissions of adult patients from 2003-2016. The first version of
AmsterdamUMCdb (1.0) was released in November 2019.

# Requesting Access

The database, although de-identified, still contains detailed information regarding the clinical care of patients, so
must be treated with appropriate care and respect and cannot be shared without permission. To request access, go to
the [Amsterdam Medical Data Science](https://amsterdammedicaldatascience.nl/) website.

# Acknowledgement

When using AmsterdamUMCdb in your research, please cite:

Thoral, P. J., Peppink, J. M., Driessen, R. H., Sijbrands, E. J. G., Kompanje, E. J. O., Kaplan, L., Bailey, H.,
Kesecioglu, J., Cecconi, M., Churpek, M., Clermont, G., van der Schaar, M., Ercole, A., Girbes, A. R. J., Elbers, P. W.
G., on behalf of the Amsterdam University Medical Centers Database (AmsterdamUMCdb) Collaborators and the SCCM/ESICM
Joint Data Science Task Force (2021). Sharing ICU Patient Data Responsibly Under the Society of Critical Care
Medicine/European Society of Intensive Care Medicine Joint Data Science Collaboration: The Amsterdam University Medical
Centers Database (AmsterdamUMCdb) Example. Crit Care Med. 2021 Jun 1;49(6):e563-e577.
doi: [10.1097/CCM.0000000000004916](https://doi.org/10.1097/CCM.0000000000004916). PMID: 33625129; PMCID: PMC8132908.

# Facts and Figures

The current database contains data from the clinical patient data management system of the department of Intensive Care,
a mixed medical-surgical ICU, from Amsterdam University Medical Center. The clinical data contains 23,106 admissions of
20,109 patients admitted from 2003 to 2016 with a total of almost 1.0 billion clinical observations consisting of
vitals, clinical scoring systems, device data and lab results data and nearly 5.0 million medication records.

<img src="https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/plot_admissions_year.png?raw=1" alt="Admissions per year category" height="512px"/>
<img src="https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/plot_admissions_age.png?raw=1" alt="Admission per age category" height="512px"/>

# Available tables

The table and field definitions are available from
the [AmsterdamUMCdb wiki](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki) and from Jupyter Notebooks in
the [tables](tables/) folder.

|Table name|Description|
|:---|:---|
|[admissions](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/admissions)|admissions and demographic data of the patients admitted to the ICU or MCU|
|[drugitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/drugitems)|medication orders including fluids, (parenteral) feeding and blood transfusions during the stay on the ICU|
|[freetextitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/freetextitems)|observations, including laboratory results, that are based on non-numeric (text) data|
|[listitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/listitems)|categorial observations, e.g. based on a selection from a list, like type of heart rhytm, ventilatory mode, etc.|
|[numericitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/numericitems)| numerical measurements and observations, including vital parameters, data from medical devices, lab results, outputs from drains and foley-catheters, scores etc.|
|[procedureorderitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/procedureorderitems)|procedures and tasks, such as performing a chest X-ray, drawing blood and daily ICU nursing care and scoring|
|[processitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/processitems)|catheters, drains, tubes, and continous non-medication processes (e.g. renal replacement therapy, hypothermia induction, etc.)|

# amsterdamumcdb Python package

The `amsterdamumcdb` Python package contains common functions for working with the database.

## Available functions

### *amsterdamumcdb*.get_dictionary():

Gets a dictionary of all items in AmsterdamUMCdb with translated medical concepts mapped to LOINC, SNOMED CT
or ATC (work in progress).

+ Returns:
    + dataframe containing dictionary

### *amsterdamumcdb*.get_fluidbalance(admissionid, from_date, to_date, con):

Calculate the fluid balance (i.e. fluid input - fluid output) for a specific time interval. Typically this will be used
to calculate daily fluid balances.

+ Arguments:
    + admissionid -- the admissionid of ICU admission
    + from_date -- the start of the interval, expressed as the number of milliseconds from start of this ICU admission
    + to_date -- the end of the interval, expressed as the number of milliseconds from start of this ICU admission
    + con -- psycopg2 connection or pandas-gbq Google BigQuery config

### *amsterdamumcdb*.outliers_histogram(data, z_threshold=4.0, lower=None, upper=None, bins=None, binwidth=None, maxbins=None):

Return a pyplot histogram, where the upper and/or lower outliers are binned together for a more even distribution plot.
By default, the histogram will be created with bins that are on boundaries aligned with the pyplot axis ticks.

+ Arguments:
    + data -- dataframe to create the histogram for.
    + z_threshold (Optional) -- number of standard deviations from the median to determine outliers
    + lower (Optional) -- lower threshold for binning lower outliers together
    + upper (Optional) -- upper threshold for binning higher outliers together
    + bins (Optional) -- int or sequence or str, allows specifying the number of bins, the actual bins or a binning
      strategy
      (see: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html)
    + binwidth (Optional) -- forces a specified size of the equally sized bins between the lower and upper threshold
    + maxbins -- the maximum number of equally sized bins to create

## Changelog

### version 0.2.1
+ unified PostgreSQL and BigQuery processing
+ Fixed filtering based boolean indexing using `np.NaN` (pandas default) and `pd.NA` (used by pandas-gbq since the default is `Int64`) leading to different results, particularly when finding the complement using negation.
+ Added unit tests for the cohorts. Forces `pd.Na` to be considered `False` during comparisons.
+ By default, uses only validated data for `amsterdamumcdb` functions for consistent PostgreSQL and BigQuery results.
+ Removed aggregation in SQL code of Glasgow Coma Scale (GCS) in line with other functions.
+ Update SOFA GCS processing for more accurate scoring
+ Added rounding to 1 decimal for conversions (from `kPa` to `mmHg`) in SQL statements
+ Updated deprecated matplotlib style (`seaborn-darkgrid`)
+ Update engine to SQLAlchemy for official pandas support instead of direct psycopg2 connection
+ Moved code from Jupyter `reason_for_admission.ipynb` notebook into `amsterdamumcdb.cohorts` module.


### version 0.2.0
+ added sample cohorts (sepsis-3, mechanical ventilation, shock) in `cohorts.py`
+ added SOFA scoring to `scores.py`
+ util functions for PostgresSQL to BigQuery translation
+ move SQL code from notebooks to separate SQL files

### version 0.1.5

+ dictionary: as part of the `ICUnity` project in preparation for
  the [The Dutch ICU Data Warehouse](https://www.icudata.nl/index-en.html) a number of commonly used items have been
  mapped to [LOINC](https://decor.nictiz.nl/art-decor/loinc)
  , [SNOMED CT](https://decor.nictiz.nl/art-decor/snomed-ct) or [ATC](https://www.whocc.no/atc_ddd_index/) with data in
  the `vocabulary_id`, `vocabulary_concept_code`, `vocabulary_concept_name` columns.
+ dictionary: [UCUM](https://ucum.org/ucum.html) units added

### version 0.1.4

+ fixes binning in `outliers_histogram()` when all values < 1

### version 0.1.3

+ Improves binning in `outliers_histogram()`

### version 0.1.2

+ Allows negative dates in `get_fluidbalance()`

### version 0.1.1

+ Fixes Google BigQuery `Project must be a string` error.

### version 0.1.0

+ initial release for ESICM Datathon 2021

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AmsterdamUMC/AmsterdamUMCdb",
    "name": "amsterdamumcdb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "AmsterdamUMCdb, Intensive Care unit, Critical Care, Medical, Patient Data",
    "author": "Amsterdam UMC Center for Critical Care Computational Intelligence",
    "author_email": "p.thoral@amsterdamumc.nl",
    "download_url": "https://files.pythonhosted.org/packages/ee/9f/0e0fc306f2ab7bf2a30ec85b822b2b2ea0704c93a4477afc5412ee4e2c1d/amsterdamumcdb-0.3.0.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/logo_c4i_square.png?raw=1\" alt=\"Logo C4I\" width=128px><img src=\"https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/logo_amds.png?raw=1\" alt=\"Logo AMDS\" width=128px/>\r\n\r\n\r\n# Welcome\r\n\r\nAmsterdamUMCdb is the first freely accessible European intensive care database. It is endorsed by the European Society\r\nof Intensive Care Medicine (ESICM) and its Data Science Section. It contains de-identified health data related to tens\r\nof thousands of intensive care unit admissions, including demographics, vital signs, laboratory tests and medications.\r\n\r\n# Version\r\n\r\nThe current version of AmsterdamUMCdb is 1.0.2, released in March 2020. This version contains data related to 23,106\r\nintensive care unit and high dependency unit admissions of adult patients from 2003-2016. The first version of\r\nAmsterdamUMCdb (1.0) was released in November 2019.\r\n\r\n# Requesting Access\r\n\r\nThe database, although de-identified, still contains detailed information regarding the clinical care of patients, so\r\nmust be treated with appropriate care and respect and cannot be shared without permission. To request access, go to\r\nthe [Amsterdam Medical Data Science](https://amsterdammedicaldatascience.nl/) website.\r\n\r\n# Acknowledgement\r\n\r\nWhen using AmsterdamUMCdb in your research, please cite:\r\n\r\nThoral, P. J., Peppink, J. M., Driessen, R. H., Sijbrands, E. J. G., Kompanje, E. J. O., Kaplan, L., Bailey, H.,\r\nKesecioglu, J., Cecconi, M., Churpek, M., Clermont, G., van der Schaar, M., Ercole, A., Girbes, A. R. J., Elbers, P. W.\r\nG., on behalf of the Amsterdam University Medical Centers Database (AmsterdamUMCdb) Collaborators and the SCCM/ESICM\r\nJoint Data Science Task Force (2021). Sharing ICU Patient Data Responsibly Under the Society of Critical Care\r\nMedicine/European Society of Intensive Care Medicine Joint Data Science Collaboration: The Amsterdam University Medical\r\nCenters Database (AmsterdamUMCdb) Example. Crit Care Med. 2021 Jun 1;49(6):e563-e577.\r\ndoi: [10.1097/CCM.0000000000004916](https://doi.org/10.1097/CCM.0000000000004916). PMID: 33625129; PMCID: PMC8132908.\r\n\r\n# Facts and Figures\r\n\r\nThe current database contains data from the clinical patient data management system of the department of Intensive Care,\r\na mixed medical-surgical ICU, from Amsterdam University Medical Center. The clinical data contains 23,106 admissions of\r\n20,109 patients admitted from 2003 to 2016 with a total of almost 1.0 billion clinical observations consisting of\r\nvitals, clinical scoring systems, device data and lab results data and nearly 5.0 million medication records.\r\n\r\n<img src=\"https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/plot_admissions_year.png?raw=1\" alt=\"Admissions per year category\" height=\"512px\"/>\r\n<img src=\"https://github.com/AmsterdamUMC/AmsterdamUMCdb/blob/master/img/plot_admissions_age.png?raw=1\" alt=\"Admission per age category\" height=\"512px\"/>\r\n\r\n# Available tables\r\n\r\nThe table and field definitions are available from\r\nthe [AmsterdamUMCdb wiki](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki) and from Jupyter Notebooks in\r\nthe [tables](tables/) folder.\r\n\r\n|Table name|Description|\r\n|:---|:---|\r\n|[admissions](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/admissions)|admissions and demographic data of the patients admitted to the ICU or MCU|\r\n|[drugitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/drugitems)|medication orders including fluids, (parenteral) feeding and blood transfusions during the stay on the ICU|\r\n|[freetextitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/freetextitems)|observations, including laboratory results, that are based on non-numeric (text) data|\r\n|[listitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/listitems)|categorial observations, e.g. based on a selection from a list, like type of heart rhytm, ventilatory mode, etc.|\r\n|[numericitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/numericitems)| numerical measurements and observations, including vital parameters, data from medical devices, lab results, outputs from drains and foley-catheters, scores etc.|\r\n|[procedureorderitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/procedureorderitems)|procedures and tasks, such as performing a chest X-ray, drawing blood and daily ICU nursing care and scoring|\r\n|[processitems](https://github.com/AmsterdamUMC/AmsterdamUMCdb/wiki/processitems)|catheters, drains, tubes, and continous non-medication processes (e.g. renal replacement therapy, hypothermia induction, etc.)|\r\n\r\n# amsterdamumcdb Python package\r\n\r\nThe `amsterdamumcdb` Python package contains common functions for working with the database.\r\n\r\n## Available functions\r\n\r\n### *amsterdamumcdb*.get_dictionary():\r\n\r\nGets a dictionary of all items in AmsterdamUMCdb with translated medical concepts mapped to LOINC, SNOMED CT\r\nor ATC (work in progress).\r\n\r\n+ Returns:\r\n    + dataframe containing dictionary\r\n\r\n### *amsterdamumcdb*.get_fluidbalance(admissionid, from_date, to_date, con):\r\n\r\nCalculate the fluid balance (i.e. fluid input - fluid output) for a specific time interval. Typically this will be used\r\nto calculate daily fluid balances.\r\n\r\n+ Arguments:\r\n    + admissionid -- the admissionid of ICU admission\r\n    + from_date -- the start of the interval, expressed as the number of milliseconds from start of this ICU admission\r\n    + to_date -- the end of the interval, expressed as the number of milliseconds from start of this ICU admission\r\n    + con -- psycopg2 connection or pandas-gbq Google BigQuery config\r\n\r\n### *amsterdamumcdb*.outliers_histogram(data, z_threshold=4.0, lower=None, upper=None, bins=None, binwidth=None, maxbins=None):\r\n\r\nReturn a pyplot histogram, where the upper and/or lower outliers are binned together for a more even distribution plot.\r\nBy default, the histogram will be created with bins that are on boundaries aligned with the pyplot axis ticks.\r\n\r\n+ Arguments:\r\n    + data -- dataframe to create the histogram for.\r\n    + z_threshold (Optional) -- number of standard deviations from the median to determine outliers\r\n    + lower (Optional) -- lower threshold for binning lower outliers together\r\n    + upper (Optional) -- upper threshold for binning higher outliers together\r\n    + bins (Optional) -- int or sequence or str, allows specifying the number of bins, the actual bins or a binning\r\n      strategy\r\n      (see: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html)\r\n    + binwidth (Optional) -- forces a specified size of the equally sized bins between the lower and upper threshold\r\n    + maxbins -- the maximum number of equally sized bins to create\r\n\r\n## Changelog\r\n\r\n### version 0.2.1\r\n+ unified PostgreSQL and BigQuery processing\r\n+ Fixed filtering based boolean indexing using `np.NaN` (pandas default) and `pd.NA` (used by pandas-gbq since the default is `Int64`) leading to different results, particularly when finding the complement using negation.\r\n+ Added unit tests for the cohorts. Forces `pd.Na` to be considered `False` during comparisons.\r\n+ By default, uses only validated data for `amsterdamumcdb` functions for consistent PostgreSQL and BigQuery results.\r\n+ Removed aggregation in SQL code of Glasgow Coma Scale (GCS) in line with other functions.\r\n+ Update SOFA GCS processing for more accurate scoring\r\n+ Added rounding to 1 decimal for conversions (from `kPa` to `mmHg`) in SQL statements\r\n+ Updated deprecated matplotlib style (`seaborn-darkgrid`)\r\n+ Update engine to SQLAlchemy for official pandas support instead of direct psycopg2 connection\r\n+ Moved code from Jupyter `reason_for_admission.ipynb` notebook into `amsterdamumcdb.cohorts` module.\r\n\r\n\r\n### version 0.2.0\r\n+ added sample cohorts (sepsis-3, mechanical ventilation, shock) in `cohorts.py`\r\n+ added SOFA scoring to `scores.py`\r\n+ util functions for PostgresSQL to BigQuery translation\r\n+ move SQL code from notebooks to separate SQL files\r\n\r\n### version 0.1.5\r\n\r\n+ dictionary: as part of the `ICUnity` project in preparation for\r\n  the [The Dutch ICU Data Warehouse](https://www.icudata.nl/index-en.html) a number of commonly used items have been\r\n  mapped to [LOINC](https://decor.nictiz.nl/art-decor/loinc)\r\n  , [SNOMED CT](https://decor.nictiz.nl/art-decor/snomed-ct) or [ATC](https://www.whocc.no/atc_ddd_index/) with data in\r\n  the `vocabulary_id`, `vocabulary_concept_code`, `vocabulary_concept_name` columns.\r\n+ dictionary: [UCUM](https://ucum.org/ucum.html) units added\r\n\r\n### version 0.1.4\r\n\r\n+ fixes binning in `outliers_histogram()` when all values < 1\r\n\r\n### version 0.1.3\r\n\r\n+ Improves binning in `outliers_histogram()`\r\n\r\n### version 0.1.2\r\n\r\n+ Allows negative dates in `get_fluidbalance()`\r\n\r\n### version 0.1.1\r\n\r\n+ Fixes Google BigQuery `Project must be a string` error.\r\n\r\n### version 0.1.0\r\n\r\n+ initial release for ESICM Datathon 2021\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Common functions for data exploration on AmsterdamUMCdb",
    "version": "0.3.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/AmsterdamUMC/AmsterdamUMCdb/issues",
        "Homepage": "https://github.com/AmsterdamUMC/AmsterdamUMCdb"
    },
    "split_keywords": [
        "amsterdamumcdb",
        " intensive care unit",
        " critical care",
        " medical",
        " patient data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "614c90771a067dd32751798041516f256baba5037a3133b70a04d69517127f0b",
                "md5": "9bc9eeae3ef1ffd857d886d307c21597",
                "sha256": "ed9288655621718192931b5b19c4799d1104108324319f54af958c1405241e39"
            },
            "downloads": -1,
            "filename": "amsterdamumcdb-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9bc9eeae3ef1ffd857d886d307c21597",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 528643,
            "upload_time": "2024-05-17T01:35:46",
            "upload_time_iso_8601": "2024-05-17T01:35:46.631969Z",
            "url": "https://files.pythonhosted.org/packages/61/4c/90771a067dd32751798041516f256baba5037a3133b70a04d69517127f0b/amsterdamumcdb-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee9f0e0fc306f2ab7bf2a30ec85b822b2b2ea0704c93a4477afc5412ee4e2c1d",
                "md5": "3169a72f06a1b7abb9613d1a1f7fe0bc",
                "sha256": "485c0a90a5728451d933890213e8ec484299a6221fe9573550809f6ec0fb34e7"
            },
            "downloads": -1,
            "filename": "amsterdamumcdb-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3169a72f06a1b7abb9613d1a1f7fe0bc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 497993,
            "upload_time": "2024-05-17T01:35:49",
            "upload_time_iso_8601": "2024-05-17T01:35:49.849095Z",
            "url": "https://files.pythonhosted.org/packages/ee/9f/0e0fc306f2ab7bf2a30ec85b822b2b2ea0704c93a4477afc5412ee4e2c1d/amsterdamumcdb-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-17 01:35:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AmsterdamUMC",
    "github_project": "AmsterdamUMCdb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "amsterdamumcdb"
}
        
Elapsed time: 4.16831s