# Timing-aware inpatient drug-drug interaction detection: supplementary data and code

Version 1.0.0

Supplementary materials for "Timing-Aware Inpatient Drug-Drug Interaction Detection and Interpretable Prioritization for Pharmacist Review at Discharge: A MIMIC-IV Study" by Parsa Lajmiri, Matthew Holman, Thomas Moore, Arran Rounds and Victor Damptey.

The study flags a drug pair only when both drugs were active together for at least two hours and the pair matches one of nine rules derived from the 2023 AGS Beers Criteria. A second layer ranks admissions for pharmacist review at discharge. The analysis used MIMIC-IV v3.1: 358,038 admissions with at least one mapped medication.

## Files

| File | Contents |
| --- | --- |
| `Supplementary_Material.pdf` | Supplementary tables S1 to S14 with captions |
| `data_dictionary.csv` | Every column of every table, with units and codes, and the model features |
| `Supplementary_Data/S1_mapping_table.csv` | Exact-match medication mapping (39 entries) |
| `Supplementary_Data/S2_ruleset.csv` | The nine rules, with evidence and rationale |
| `Supplementary_Data/S3_detection_logic.sql` | Detection and feature-aggregation SQL for BigQuery |
| `Supplementary_Data/S4_full_model_metrics.csv` | Per-model metrics on the held-out test set |
| `Supplementary_Data/S5_bootstrap_confidence_intervals.csv` | Bootstrap 95% confidence intervals |
| `Supplementary_Data/S6a_age65_model_metrics.csv`, `S6b_age65_bootstrap_ci.csv` | Admissions with age 65 or older |
| `Supplementary_Data/S7a_readmission_model_metrics.csv`, `S7b_readmission_coefficients.csv` | Exploratory 30-day readmission analysis |
| `Supplementary_Data/S8_medication_count_operating_rules.csv` | Ranking by mapped medication count alone |
| `Supplementary_Data/S9_overlap_sensitivity.csv` | Detection at overlap thresholds of 0 to 8 hours |
| `Supplementary_Data/S10_full_threshold_grid.csv` | Decision thresholds from 0.05 to 0.95 with workload measures |
| `Supplementary_Data/S11_calibration_bins.csv` | Calibration bins |
| `Supplementary_Data/S12_full_coefficients.csv` | Logistic-regression coefficients |
| `Supplementary_Data/S13_discharge_active.csv` | Flagged pairs still co-active in the last 24 hours of the stay |
| `Supplementary_Data/S14_colisted_comparator.csv` | Timing-aware detection against a co-listing checker |

`MANIFEST.json` lists every file with its byte count and SHA-256.

## Patient data

No file contains patient-level data. The release holds the medication mapping, the rules, SQL and aggregate results. Rerunning `S3_detection_logic.sql` requires your own credentialed access to MIMIC-IV v3.1 through PhysioNet.

## Reading the tables

`data_dictionary.csv` defines each column. Two points trip readers up. In S4, S6a and S7a the `cv_std` rows hold standard deviations across folds, not metric values. `pct_cohort_flagged` is a percentage in S8 and a fraction in S10.

## Rights

The files are free to read and download. The authors have not assigned a reuse license. Cite the dataset when you use the files; `CITATION.cff` gives the citation.
