Skip to content

This is the code for retrieval of patient files and analysis of the MIMIC III Critical Care Database

Notifications You must be signed in to change notification settings

kchg/MIMICIII_Research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

The objective of this script is to extract data from the MIMICIII Database useful for developing methods for patient-specific prediction of in-hospital mortality. These scripts generate ICU files for a subset of general descriptor and time series features, a file that contains the mortality outcomes for each ICU stay, and a features matrices listing the first, last, min, max, and median of each feature for each ICU stay.

MIMIC-III (Medical Information Mart for Intensive Care III) is a large, freely-available database comprising deidentified health-related data associated with over forty thousand patients who stayed in critical care units of the Beth Israel Deaconess Medical Center between 2001 and 2012. The database includes information such as demographics, vital sign measurements made at the bedside (~1 data point per hour), laboratory test results, procedures, medications, caregiver notes, imaging reports, and mortality (both in and out of hospital). MIMIC supports a diverse range of analytic studies spanning epidemiology, clinical decision-rule improvement, and electronic tool development. It is notable for three factors: • it is freely available to researchers worldwide • it encompasses a diverse and very large population of ICU patients • it contains high temporal resolution data including lab results, electronic documentation, and bedside monitor trends and waveforms.

To get access to the MIMIC-III database, request access from http://mimic.physionet.org/gettingstarted/access/ and setup the server according to the tutorials section of the website.

To run these programs on your machine, download psycopg for python at http://initd.org/psycopg/.

Generate Data* To generate a data set:

  1. Edit params in genHelper.py to have the credentials to log in to your database.
  2. (This only needs to be done once) Run genViews.py to create the materialized views to help generate the tables required to generate the severity scores in the outcomes file. This process takes a while about an hour on a solid state drive.
  3. Run genData.py. This will create a folder called "set-a" and place each ICU entry's data in its own text file, with the filename as the subject_id. This program takes about an hour to run on ~20000 patients on a solid state drive, and likely much longer on a hard drive.
  4. Run genOutcomes.py, which will create a file called "Outcomes-a.txt" that contains subject_id, SAPS score, SOFA score, length of stay, survival, and in-hospital death. This program takes about half an hour to run on 20251 entries.
  5. Run genFeaturesTable.py, which generates a table of all features generated by genData.py. This table is formatted as a .csv file, with each row indicating an ICU stay and the columns showing the first, last, highest, lowest, median and frequency for each time series feature.

About

This is the code for retrieval of patient files and analysis of the MIMIC III Critical Care Database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published