Skip to content

Latest commit

 

History

History
 
 

concepts

Contents of this folder

This folder contains scripts to generate materialized views in a PostgreSQL database with MIMIC installed. If you do not have access to a PostgreSQL database with MIMIC, you can read more about it in the buildmimic folder.

Concepts are categorized into folders if possible, otherwise they remain in the top-level directory.

The make-concepts.sql file can be used to build all concepts in a PostgreSQL database. It uses relative paths to call the other SQL scripts, so you need to execute the script from this folder.

Subfolders

comorbidity

These scripts derive binary flags indicating the presence of various comorbidities using billing codes (ICD-9) assigned to the patient at hospital discharge.

cookbook

This is an asortment of scripts intended to give the user more familiarity with the MIMIC-III database. None of these scripts generate materialized views.

demographics

Summary of patient/admission level information such as age, height, weight, etc.

firstday

The first day subfolder contains scripts used to calculate various clinical concepts on the first day of a patient's admission to the ICU, such as the highest blood pressure, lowest temperature, etc. This folder contains many useful scripts which can be adapted to capture data outside the first day.

functions

Useful snippets of SQL implementing common functions. For example, the auroc.sql file calculates the area under the receiver operator characteristic curve (AUROC) for a set of predictions, PRED, given a set of targets, TAR. The AUROC is a useful measure of the discrimination of a set of predictions.

other-languages

Scripts in flavours of SQL which are not necessarily compatible with PostgreSQL.

sepsis

Definitions of sepsis, a common cause of mortality for intensive care unit patients.

severityscores

Severity of illness scores which summarize the acuity of a patient's illness on admission to the intensive care unit (usually in the first 24 hours).

durations

Start and stop times for administration of various treatments or durations of various phenomena, including: medical agents which have a vasoactive effect on a patient's circulatory system, continuous renal replacement therapy (CRRT), and mechanical ventilation.

Row counts

Below are row counts generated by each script called in make-concepts.sql. Note that a table with 61532 rows likely has one row per icustay_id, and a table with 58976 likely has one row per hadm_id.

Script name Row count
Top level files..
code-status.sql 61532
echo-data.sql 45794
Directory 1 of 9: durations
durations/ventilation-durations.sql 38594
durations/crrt-durations.sql 5918
durations/adenosine-durations.sql 160
durations/dobutamine-durations.sql 1792
durations/dopamine-durations.sql 6524
durations/epinephrine-durations.sql 3126
durations/isuprel-durations.sql 24
durations/milrinone-durations.sql 3600
durations/norepinephrine-durations.sql 23188
durations/phenylephrine-durations.sql 33141
durations/vasopressin-durations.sql 4190
durations/vasopressor-durations.sql 38832
durations/weight-durations.sql 158140
Directory 2 of 9: comorbidity
comorbidity/elixhauser-ahrq-v37-with-drg.sql 58976
comorbidity/elixhauser-ahrq-v37-no-drg.sql 58976
comorbidity/elixhauser-ahrq-v37-no-drg-all-icd.sql 58976
comorbidity/elixhauser-quan.sql 58976
comorbidity/elixhauser-score-ahrq.sql 58976
comorbidity/elixhauser-score-quan.sql 58976
Directory 3 of 9: demographics
demographics/HeightWeightQuery.sql 52971
demographics/icustay-detail.sql 61051
Directory 4 of 9: firstday
firstday/blood-gas-first-day.sql 243458
firstday/blood-gas-first-day-arterial.sql 171406
firstday/gcs-first-day.sql 61532
firstday/height-first-day.sql 53432
firstday/labs-first-day.sql 61532
firstday/rrt-first-day.sql 61532
firstday/urine-output-first-day.sql 53359
firstday/ventilation-first-day.sql 61532
firstday/vitals-first-day.sql 59247
firstday/weight-first-day.sql 53432
Directory 5 of 9: fluid-balance
fluid-balance/urine-output.sql 3361794
Directory 6 of 9: sepsis
sepsis/angus.sql 58976
sepsis/martin.sql 58976
sepsis/explicit.sql 58976
Directory 7 of 9: diagnosis
ccs_diagnosis_table.sql 15079 and 13626
Directory 8 of 9: organfailure
organfailure/kdigo-creatinine.sql 61532
organfailure/kdigo-uo.sql 3361827
organfailure/kdigo-stages-7day.sql 61532
organfailure/kdigo-stages-48hr.sql 61532
organfailure/meld.sql 61532
Directory 9 of 9: severityscores
severityscores/oasis.sql 61532
severityscores/sofa.sql 61532
severityscores/saps.sql 61532
severityscores/sapsii.sql 61532
severityscores/apsiii.sql 61532
severityscores/lods.sql 61532
severityscores/sirs.sql 61532