2.1.0
- Determine the effect of early PT consults on ICU outcomes for mechanically ventilated adults. Early is defined as within 48 hours of invasive mechanical ventilation or ICU admission (if transferred already intubated).
- Created using MIMIC IV Database converted to CLIF Format
- With early mobilization critaria algorithm taken from Eligibility for Mobilization Algorithm
- patient:
patient_id,race_category,ethnicity_category,sex_category,death_dttm - hospitalization:
patient_id,hospitalization_id,admission_dttm,discharge_dttm,admission_category,discharge_category,age_at_admission - adt:
hospitalization_id,in_dttm,out_dttm,location_category,location_type - vitals:
hospitalization_id,recorded_dttm,vital_category,vital_valuevital_category= 'heart_rate', 'resp_rate', 'sbp', 'dbp', 'map', 'spo2', 'weight_kg'
- labs:
hospitalization_id,lab_result_dttm,lab_order_dttm,lab_category,lab_value,lab_value_numericlab_category= 'lactate', 'creatinine', 'bilirubin_total', 'po2_arterial', 'platelet_count'
- medication_admin_continuous:
hospitalization_id,admin_dttm,med_name,med_category,med_dose,med_dose_unit,med_groupmed_category= 'norepinephrine', 'epinephrine', 'phenylephrine', 'vasopressin','dopamine', 'angiotensin', 'nicardipine', 'nitroprusside','clevidipine','cisatracurium','vecuronium','rocuronium','metaraminol','dobutamine'
- respiratory_support:
hospitalization_id,recorded_dttm,device_category,mode_category,tracheostomy,fio2_set,lpm_set,resp_rate_set,peep_set,resp_rate_obs - patient_assessments:
hospitalization_id,recorded_dttm,assessment_category,numerical_value,categorical_valueassessment_category= 'braden_mobility', 'RASS', 'cam_total', 'gcs_total',
- key_icu_orders:
hospitalization_id,'order_dttm', 'order_category'
- Adults (age >= 18)
- On invasive mechanical ventiulation for at least 4 hours.
- Without a tracheostomy.
- Without a PT consult order in 24 hours prior to intubation.
The project requires Python 3.11+ with uv installed and R 4.x. The Jupyter notebooks are converted to just Python so Jupyter itself is not required. Uses UV and renv, respectively, for dependencies.
Follow the instructions in config/README.md to set your site name, the path to your CLIF tables, the file type, and the time zone.
Run the entire pipeline using the commands.
chmod +x run_pipeline.sh # make it executable (one time only)
bash run_pipeline.sh
Run it with bash (not source): the script uses set -euo pipefail, so if you
source it, any failing step will exit your interactive shell/terminal.
These scripts install the required Python and R dependencies.
| Step | Script | Language | Description |
|---|---|---|---|
| 1 | 1_cohort.py |
Python | File organization, Cohort identification, STROBE diagram |
| 2 | 2_data_gathering.py |
Python | Gathers and aggregates data from multiple CLIF tables, creates "time_bin" and "hourly" data sets. |
| 3 | 3_calculations.py |
Python | Mobilization analysis, outcomes definitions |
| 4 | 4_table_one.R |
R | Table 1, Graphs, setup for CCW |
| 5 | 5_ccw.R |
R | Clone censor weight, outcomes models, bootstrapping |
We want the output saved to output/final and output/logs.
Giulio C. Rottaro Castejon
Jinping Liang
Haidong Lu
Fan Li
Snigdha Jain
Yale University