Published October 7, 2026 | Version v3

Measurement-window analysis of vasoactive exposure and bedside risk assessment in ICU-acquired pressure injury: cohort-derivation queries and analysis code for MIMIC-IV

Description

Cohort-derivation queries and analysis code for a landmark competing-risks study of intensive care unit (ICU)-acquired pressure injury in adults receiving vasoactive support, using the Medical Information Mart for Intensive Care IV (MIMIC-IV) version 3.1.
 
The analysis compares, on a common scale and within a measurement window that closes before follow-up begins, the prognostic information carried by early vasoactive exposure and by bedside risk assessment for a pressure injury newly documented in the ICU. Follow-up starts at a landmark 24 hours after ICU admission, by which time every predictor of the primary model has been measured; a second landmark at 48 hours is used where a 48-hour exposure window must close before follow-up begins. Cumulative exposure is decomposed into dose intensity, taken as the peak norepinephrine-equivalent dose, and duration of support, taken as the hours during which any infusion contributing a norepinephrine equivalent was running, with overlapping intervals merged before summation. Each metric is computed over the first 24 hours, the first 48 hours and the whole ICU stay. Hypotension burden is the time spent below a mean arterial pressure of 65 mmHg as a percentage of the time covered by charted values, each value carried forward for at most two hours. The Braden Scale is summarized over the same windows, and the number of assessments recorded is fitted as a falsification analysis in a closed and an open version of the window. Illness severity is the first-day SOFA score; because its cardiovascular component is scored from vasopressor infusion rates, the discrimination comparison, the primary model, the models for lesions severe at first documentation and the dose-threshold models are repeated with the non-cardiovascular SOFA score, the sum of the other five components.
 
Five SQL files extract the source data from BigQuery: the source population with exposure over the three windows and charted mean arterial pressure; the first-24 hour exposure, agent-specific dose, time-weighted hypotension burden, lactate, ventilation and the first-day SOFA score with its six components; outcome ascertainment across both generations of nursing skin-documentation form, pairing the type and stage fields on stay, timestamp and wound number, together with the stage and location of the first documented lesion, the first severe lesion at any time, the form generation used, the admission nursing history and lesion identification dates; the Braden Scale reconstructed from its six subscales with the overlap-merged duration of support and the covariates; and the documented preventive care of the first 24 hours.
 
Five Python scripts run the queries, apply the exclusions and assign the endpoints, implement the survival procedures, produce the estimates reported in the article and its Supplementary Material, and check the implementation. Death in the ICU and alive ICU discharge are competing events throughout; cause-specific hazard ratios are the primary estimate, with Fine-Gray subdistribution hazards, Aalen-Johansen cumulative incidence, restricted cubic splines, an optimism-corrected concordance index for competing risks and the Grambsch-Therneau score test reported alongside. All confidence intervals use a patient-clustered robust variance, heterogeneity between subgroups is tested with the clustered covariance of the subgroup estimates, and all resampling is at the patient level. The Cox, Fine-Gray, Aalen-Johansen, concordance, score-test and spline procedures are implemented directly on NumPy; the verification script constructs the risk set at every event time explicitly from its definition and compares the two.
 
Random seeds are fixed. Running the four documented steps in order writes the four main tables and Supplementary Tables S1 to S27, each lettered part in its own file. Version 3 accompanies the second revision of the article and adds the sensitivity analyses with the non-cardiovascular SOFA score (Supplementary Tables S6, S13b, S14a and S14b).
 
Contents: sql/01_cohort_exposure_haemodynamics.sql; sql/02_first24h_exposure_and_perfusion.sql; sql/03_outcome_stage_location.sql; sql/04_braden_and_covariates.sql; sql/05_preventive_care.sql; python/export_from_bigquery.py; python/build_cohort.py; python/survival.py; python/run_analysis.py; python/verify_implementation.py; requirements.txt; README.md; LICENSE.
 
Requirements: Python 3.12.3; credentialed access to MIMIC-IV v3.1 on PhysioNet and a Google Cloud project authorized to query the physionet-data datasets. The database itself is not redistributed here.

Files

zenodo_v3_code.zip

Files (37.8 kB)

Name Size
md5:a7619e43a5d44810cfb17da9c19b7675
37.8 kB Preview Download