Timing-aware inpatient drug-drug interaction detection and interpretable prioritization for pharmacist review at discharge: supplementary data and code
Interaction rules, detection SQL and aggregate model results from 358,038 MIMIC-IV admissions.
Parsa Lajmiri · Matthew Holman · Thomas Moore · Arran Rounds · Victor Damptey
- Published
- September 24, 2026
- Version
- 1.0.0
- Files
- 6 release files
About this dataset
Overview
Supplementary data and code for “Timing-Aware Inpatient Drug-Drug Interaction Detection and Interpretable Prioritization for Pharmacist Review at Discharge: A MIMIC-IV Study.” The release contains the exact-match medication mapping, the nine interaction rules, the BigQuery SQL that finds co-active drug pairs in MIMIC-IV v3.1, and the aggregate results behind supplementary tables S1 to S14: model metrics, bootstrap confidence intervals, calibration bins, coefficients, a decision-threshold grid and sensitivity analyses across 358,038 admissions. A data dictionary defines every column. No file contains patient-level data.
Inspect before download
Data preview
S14_colisted_comparator.csv · first 3 rows
| severity | colisted_pair_admissions | timing_aware_pair_admissions | pct_suppressed | colisted_admissions_alerted | timing_aware_admissions_alerted | pct_fewer_admissions |
|---|---|---|---|---|---|---|
| major | 59222 | 39495 | 33.3 | 42900 | 31169 | 27.3 |
| moderate | 9737 | 7779 | 20.1 | 9588 | 7699 | 19.7 |
| minor | 15355 | 9173 | 40.3 | 15049 | 9148 | 39.2 |
Read the columns
Data dictionary
Supplementary_Material.pdf
Supplementary tables S1 to S14 with captions.
Supplementary_Data/S1_mapping_table.csvExact-match medication mapping: 39 source names, 29 generics, 10 classes.4 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| src_name | text | lowercase medication name | Medication string as ordered in MIMIC-IV, lowercased. An order maps only on an exact match. |
| generic | text | 29 generic names | Normalized generic drug name. |
| class | text | antiarrhythmic; antibiotic; anticholinergic; antiplatelet; benzodiazepine; doac; nsaid; opioid; ssri; warfarin | Therapeutic class used by class-level rules. |
| source | text | seed | Origin of the entry: the predefined seed list. |
Supplementary_Data/S2_ruleset.csvThe nine interaction rules as implemented.11 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| rule_id | text | R001 to R009 | Rule identifier. |
| rule_type | text | generic+generic; generic+class; class+generic; class+class | Whether each side matches a generic name or a class. |
| left_generic | text | generic name or blank | Left-side generic, when that side matches a generic. |
| left_class | text | class or blank | Left-side class, when that side matches a class. |
| right_generic | text | generic name or blank | Right-side generic, when that side matches a generic. |
| right_class | text | class or blank | Right-side class, when that side matches a class. |
| min_age | integer | years; blank = no age limit | Minimum anchor age for the rule to apply. Only R009 is restricted (65). |
| severity | text | major; moderate; minor | Severity assigned to a match. |
| evidence | text | Evidence cited: a 2023 AGS Beers Criteria table or clinical consensus. | |
| rationale | text | Plain-language reason the combination is flagged. | |
| source | text | Source of the rule. |
Supplementary_Data/S3_detection_logic.sql
Detection and feature-aggregation SQL for MIMIC-IV v3.1 on BigQuery. Load S1 and S2 as tables, replace the project.dataset names and run in order. Requires credentialed MIMIC-IV access; the database itself is not included.
Supplementary_Data/S4_full_model_metrics.csvFull per-model metrics for has_major at every operating point (held-out test set: 71,935 admissions, 6,220 positive).19 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major; readmit_30d (S7a) | Prediction target. has_major = 1 when the admission has at least one major rule match. readmit_30d = 1 when the next admission starts 0 to 30 days after discharge. |
| feature_set | text | n_drugs_only; core_3; expanded; expanded_no_ddi; expanded_with_ddi; none | Predictors used. n_drugs_only = n_drugs. core_3 = n_drugs, los_hours, age. expanded = core_3 plus n_diagnoses, six comorbidity flags, creatinine_median and albumin_median with missingness indicators. expanded_no_ddi and expanded_with_ddi (readmission only) are expanded without or with the six DDI summaries. none = no-skill reference. |
| model | text | logistic_regression; random_forest; xgboost; always_negative | Classifier. always_negative predicts no positives and is the no-skill reference. |
| eval_type | text | cv_mean; cv_std; test | cv_mean and cv_std are the mean and standard deviation across five patient-grouped cross-validation folds of the full cohort (logistic regression only). test is the patient-disjoint 20% held-out set. |
| threshold_type | text | 5fold_cv; default_0.5; train_f1_optimal; train_recall_0.80; predict_all_negative | Operating point. train_f1_optimal maximizes F1 on the training precision-recall curve. train_recall_0.80 is the threshold that reaches training recall of at least 0.80. Both are chosen without the test set. |
| threshold | number | 0 to 1; blank for cross-validation and always-negative rows | Decision threshold on the predicted probability. |
| n | integer | admissions | Admissions evaluated: the full cohort for cross-validation rows, the held-out set for test rows. |
| accuracy | number | 0 to 1 | Share of admissions classified correctly. In cv_std rows this and every metric column hold the standard deviation across folds. |
| precision | number | 0 to 1 | True positives divided by predicted positives. |
| recall | number | 0 to 1 | True positives divided by actual positives. |
| specificity | number | 0 to 1; blank in cross-validation rows | True negatives divided by actual negatives. |
| npv | number | 0 to 1; blank in cross-validation rows | Negative predictive value: true negatives divided by predicted negatives. |
| f1 | number | 0 to 1 | Harmonic mean of precision and recall. |
| roc_auc | number | 0 to 1; blank for always-negative test rows | Area under the ROC curve. |
| avg_precision | number | 0 to 1 | Average precision (area under the precision-recall curve). |
| tn | integer | admissions; blank in cross-validation rows | True negatives. |
| fp | integer | admissions; blank in cross-validation rows | False positives. |
| fn | integer | admissions; blank in cross-validation rows | False negatives. |
| tp | integer | admissions; blank in cross-validation rows | True positives. |
Supplementary_Data/S5_bootstrap_confidence_intervals.csvBootstrap 95% confidence intervals on the held-out test set.10 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major | Prediction target (see S4). |
| feature_set | text | n_drugs_only; core_3; expanded; expanded_vs_n_drugs_only | Feature set (see S4). expanded_vs_n_drugs_only rows are paired differences between those two sets. |
| model | text | logistic_regression; random_forest; xgboost | Classifier. |
| metric | text | roc_auc; avg_precision; precision@0.5; recall@0.5; f1@0.5; specificity@0.5; delta_roc_auc; delta_avg_precision | Metric estimated. @0.5 metrics use the fixed 0.5 threshold. delta_ metrics are expanded minus n_drugs_only. |
| point_estimate | number | metric scale | Estimate on the held-out test set. |
| ci_low | number | metric scale | Lower bound of the 95% bootstrap confidence interval. |
| ci_high | number | metric scale | Upper bound of the 95% bootstrap confidence interval. |
| n_bootstrap | integer | 1000 | Number of bootstrap resamples. |
| split | text | test | Data split resampled. |
| notes | text | Resampling method: stratified by label, or paired on the same resampled rows for differences. |
Supplementary_Data/S6a_age65_model_metrics.csvS4 repeated for admissions with age 65 or older (145,533 admissions).19 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major; readmit_30d (S7a) | Prediction target. has_major = 1 when the admission has at least one major rule match. readmit_30d = 1 when the next admission starts 0 to 30 days after discharge. |
| feature_set | text | n_drugs_only; core_3; expanded; expanded_no_ddi; expanded_with_ddi; none | Predictors used. n_drugs_only = n_drugs. core_3 = n_drugs, los_hours, age. expanded = core_3 plus n_diagnoses, six comorbidity flags, creatinine_median and albumin_median with missingness indicators. expanded_no_ddi and expanded_with_ddi (readmission only) are expanded without or with the six DDI summaries. none = no-skill reference. |
| model | text | logistic_regression; random_forest; xgboost; always_negative | Classifier. always_negative predicts no positives and is the no-skill reference. |
| eval_type | text | cv_mean; cv_std; test | cv_mean and cv_std are the mean and standard deviation across five patient-grouped cross-validation folds of the full cohort (logistic regression only). test is the patient-disjoint 20% held-out set. |
| threshold_type | text | 5fold_cv; default_0.5; train_f1_optimal; train_recall_0.80; predict_all_negative | Operating point. train_f1_optimal maximizes F1 on the training precision-recall curve. train_recall_0.80 is the threshold that reaches training recall of at least 0.80. Both are chosen without the test set. |
| threshold | number | 0 to 1; blank for cross-validation and always-negative rows | Decision threshold on the predicted probability. |
| n | integer | admissions | Admissions evaluated: the full cohort for cross-validation rows, the held-out set for test rows. |
| accuracy | number | 0 to 1 | Share of admissions classified correctly. In cv_std rows this and every metric column hold the standard deviation across folds. |
| precision | number | 0 to 1 | True positives divided by predicted positives. |
| recall | number | 0 to 1 | True positives divided by actual positives. |
| specificity | number | 0 to 1; blank in cross-validation rows | True negatives divided by actual negatives. |
| npv | number | 0 to 1; blank in cross-validation rows | Negative predictive value: true negatives divided by predicted negatives. |
| f1 | number | 0 to 1 | Harmonic mean of precision and recall. |
| roc_auc | number | 0 to 1; blank for always-negative test rows | Area under the ROC curve. |
| avg_precision | number | 0 to 1 | Average precision (area under the precision-recall curve). |
| tn | integer | admissions; blank in cross-validation rows | True negatives. |
| fp | integer | admissions; blank in cross-validation rows | False positives. |
| fn | integer | admissions; blank in cross-validation rows | False negatives. |
| tp | integer | admissions; blank in cross-validation rows | True positives. |
Supplementary_Data/S6b_age65_bootstrap_ci.csvS5 repeated for admissions with age 65 or older.10 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major | Prediction target (see S4). |
| feature_set | text | n_drugs_only; core_3; expanded; expanded_vs_n_drugs_only | Feature set (see S4). expanded_vs_n_drugs_only rows are paired differences between those two sets. |
| model | text | logistic_regression; random_forest; xgboost | Classifier. |
| metric | text | roc_auc; avg_precision; precision@0.5; recall@0.5; f1@0.5; specificity@0.5; delta_roc_auc; delta_avg_precision | Metric estimated. @0.5 metrics use the fixed 0.5 threshold. delta_ metrics are expanded minus n_drugs_only. |
| point_estimate | number | metric scale | Estimate on the held-out test set. |
| ci_low | number | metric scale | Lower bound of the 95% bootstrap confidence interval. |
| ci_high | number | metric scale | Upper bound of the 95% bootstrap confidence interval. |
| n_bootstrap | integer | 1000 | Number of bootstrap resamples. |
| split | text | test | Data split resampled. |
| notes | text | Resampling method: stratified by label, or paired on the same resampled rows for differences. |
Supplementary_Data/S7a_readmission_model_metrics.csvExploratory 30-day readmission models; same columns as S4.19 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major; readmit_30d (S7a) | Prediction target. has_major = 1 when the admission has at least one major rule match. readmit_30d = 1 when the next admission starts 0 to 30 days after discharge. |
| feature_set | text | n_drugs_only; core_3; expanded; expanded_no_ddi; expanded_with_ddi; none | Predictors used. n_drugs_only = n_drugs. core_3 = n_drugs, los_hours, age. expanded = core_3 plus n_diagnoses, six comorbidity flags, creatinine_median and albumin_median with missingness indicators. expanded_no_ddi and expanded_with_ddi (readmission only) are expanded without or with the six DDI summaries. none = no-skill reference. |
| model | text | logistic_regression; random_forest; xgboost; always_negative | Classifier. always_negative predicts no positives and is the no-skill reference. |
| eval_type | text | cv_mean; cv_std; test | cv_mean and cv_std are the mean and standard deviation across five patient-grouped cross-validation folds of the full cohort (logistic regression only). test is the patient-disjoint 20% held-out set. |
| threshold_type | text | 5fold_cv; default_0.5; train_f1_optimal; train_recall_0.80; predict_all_negative | Operating point. train_f1_optimal maximizes F1 on the training precision-recall curve. train_recall_0.80 is the threshold that reaches training recall of at least 0.80. Both are chosen without the test set. |
| threshold | number | 0 to 1; blank for cross-validation and always-negative rows | Decision threshold on the predicted probability. |
| n | integer | admissions | Admissions evaluated: the full cohort for cross-validation rows, the held-out set for test rows. |
| accuracy | number | 0 to 1 | Share of admissions classified correctly. In cv_std rows this and every metric column hold the standard deviation across folds. |
| precision | number | 0 to 1 | True positives divided by predicted positives. |
| recall | number | 0 to 1 | True positives divided by actual positives. |
| specificity | number | 0 to 1; blank in cross-validation rows | True negatives divided by actual negatives. |
| npv | number | 0 to 1; blank in cross-validation rows | Negative predictive value: true negatives divided by predicted negatives. |
| f1 | number | 0 to 1 | Harmonic mean of precision and recall. |
| roc_auc | number | 0 to 1; blank for always-negative test rows | Area under the ROC curve. |
| avg_precision | number | 0 to 1 | Average precision (area under the precision-recall curve). |
| tn | integer | admissions; blank in cross-validation rows | True negatives. |
| fp | integer | admissions; blank in cross-validation rows | False positives. |
| fn | integer | admissions; blank in cross-validation rows | False negatives. |
| tp | integer | admissions; blank in cross-validation rows | True positives. |
Supplementary_Data/S7b_readmission_coefficients.csvLogistic-regression coefficients for readmit_30d with the expanded_with_ddi feature set.3 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| feature | text | feature name | Model feature; definitions are listed under Model features. |
| coefficient | number | log-odds per one native unit | Logistic-regression coefficient on the raw feature scale (no scaling), so magnitudes are not comparable across features. |
| odds_ratio | number | ratio | exp(coefficient): odds multiplier per one-unit increase. |
Supplementary_Data/S8_medication_count_operating_rules.csvRanking the worklist by mapped medication count alone, on the held-out test set.7 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| operating_rule | text | n_drugs >= 2 to n_drugs >= 9 | Flag admissions with at least this many mapped medications. |
| alerts | integer | admissions | Admissions flagged. |
| pct_cohort_flagged | number | percent (0 to 100) | Share of the test set flagged, as a percentage. S10 reports the same measure as a fraction. |
| true_positives_caught | integer | admissions | Flagged admissions with a major rule match. |
| recall | number | 0 to 1 | true_positives_caught divided by all 6,220 positive test admissions. |
| precision | number | 0 to 1 | true_positives_caught divided by alerts. |
| alerts_per_true_positive | number | reviews per catch | Pharmacist reviews needed per captured major rule match. |
Supplementary_Data/S9_overlap_sensitivity.csvDetection counts when the co-activity overlap threshold changes.6 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| overlap_threshold_hours | number | hours: 0, 1, 2, 4, 8 | Minimum overlap of two administration windows for a pair to count as co-active. The main analysis uses 2. |
| major_pairs | integer | co-active order-line pairs | Major-severity rule matches, counted per pair of overlapping order lines. |
| moderate_pairs | integer | co-active order-line pairs | Moderate-severity rule matches. |
| minor_pairs | integer | co-active order-line pairs | Minor-severity rule matches. |
| admissions_with_major | integer | admissions | Admissions with at least one major match. |
| pct_change_in_admissions_vs_2h | number | percent, signed | Change in admissions_with_major relative to the 2-hour threshold. |
Supplementary_Data/S10_full_threshold_grid.csvExpanded logistic model for has_major across thresholds 0.05 to 0.95, with pharmacist-workload measures.18 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major | Prediction target. |
| feature_set | text | expanded | Feature set (see S4). |
| model | text | logistic_regression | Classifier. |
| threshold_type | text | default_0.5; train_f1_optimal; train_recall_0.80; grid_0.05 to grid_0.95 | Named operating point or a grid step. |
| threshold | number | 0 to 1 | Decision threshold on the predicted probability. |
| precision | number | 0 to 1 | True positives divided by predicted positives. |
| recall | number | 0 to 1 | True positives divided by actual positives. |
| specificity | number | 0 to 1 | True negatives divided by actual negatives. |
| f1 | number | 0 to 1 | Harmonic mean of precision and recall. |
| accuracy | number | 0 to 1 | Share classified correctly. |
| tn | integer | admissions | True negatives. |
| fp | integer | admissions | False positives. |
| fn | integer | admissions | False negatives. |
| tp | integer | admissions | True positives. |
| alerts | integer | admissions | Predicted positives (tp + fp). |
| true_positives_caught | integer | admissions | Equal to tp. |
| alerts_per_true_positive | number | reviews per catch | alerts divided by true_positives_caught. |
| pct_cohort_flagged | number | fraction (0 to 1) | Share of the test set flagged, as a fraction. S8 reports the same measure as a percentage. |
Supplementary_Data/S11_calibration_bins.csvReliability curve for the expanded logistic model on the held-out test set.7 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| target | text | has_major | Prediction target. |
| feature_set | text | expanded | Feature set (see S4). |
| model | text | logistic_regression | Classifier. |
| bin | integer | 0 to 9 | Probability bin, ordered from lowest to highest predicted probability. |
| mean_predicted_prob | number | 0 to 1 | Mean predicted probability in the bin. |
| observed_frequency | number | 0 to 1 | Share of admissions in the bin with a major rule match. |
| brier_score | number | 0 to 1 | Brier score of the model on the whole test set, repeated on each row. |
Supplementary_Data/S12_full_coefficients.csvLogistic-regression coefficients for has_major with the expanded feature set.3 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| feature | text | feature name | Model feature; definitions are listed under Model features. |
| coefficient | number | log-odds per one native unit | Logistic-regression coefficient on the raw feature scale (no scaling), so magnitudes are not comparable across features. |
| odds_ratio | number | ratio | exp(coefficient): odds multiplier per one-unit increase. |
Supplementary_Data/S13_discharge_active.csvHow many flagged admissions still had a flagged pair co-active in the last 24 hours of the stay.4 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| severity | text | major; moderate; minor | Rule severity. |
| admissions_with_match | integer | admissions | Admissions with at least one match of that severity. |
| admissions_with_pair_active_within_24h_of_discharge | integer | admissions | Of those, admissions where a flagged pair's co-active window reached the final 24 hours of the stay. |
| pct | number | percent (0 to 100) | Second count as a percentage of the first. |
Supplementary_Data/S14_colisted_comparator.csvWhat the co-activity requirement removes, compared with a checker that flags drugs merely listed together.7 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| severity | text | major; moderate; minor | Rule severity. |
| colisted_pair_admissions | integer | drug pairs per admission | Distinct rule-matched drug pairs per admission when co-listing is enough. |
| timing_aware_pair_admissions | integer | drug pairs per admission | The same count when the 2-hour co-activity requirement applies. |
| pct_suppressed | number | percent (0 to 100) | Share of co-listed pairs removed by the requirement. |
| colisted_admissions_alerted | integer | admissions | Admissions with at least one co-listed match. |
| timing_aware_admissions_alerted | integer | admissions | Admissions with at least one timing-aware match. |
| pct_fewer_admissions | number | percent (0 to 100) | Reduction in admissions alerted. |
Model featuresAdmission-level predictors named in the feature column of S12 and S7b and in the feature sets.20 entries
| Name | Type | Units or values | Meaning |
|---|---|---|---|
| n_drugs | integer | count | Distinct mapped medications in the admission (seed list only, so below the full medication count). |
| los_hours | number | hours | Span from the first to the last mapped administration; a proxy for medication exposure in the stay. |
| age | integer | years | MIMIC-IV anchor_age: age in the patient's anchor year. |
| n_diagnoses | integer | count | Distinct ICD diagnosis codes on the admission. |
| has_ckd | 0/1 | flag | Chronic kidney disease: ICD-10 N18 or ICD-9 585. |
| has_heart_failure | 0/1 | flag | Heart failure: ICD-10 I50 or ICD-9 428. |
| has_diabetes | 0/1 | flag | Diabetes: ICD-10 E10, E11, E13 or ICD-9 250. |
| has_liver_disease | 0/1 | flag | Liver disease: ICD-10 K70 to K77 or ICD-9 571. |
| has_dementia | 0/1 | flag | Dementia: ICD-10 F01, F02, F03, G30 or ICD-9 290, 3310. |
| has_copd | 0/1 | flag | COPD: ICD-10 J44 or ICD-9 491, 492, 496. |
| creatinine_median | number | mg/dL | Median serum creatinine in the admission (MIMIC-IV itemid 50912); median-imputed when missing. |
| albumin_median | number | g/dL | Median serum albumin in the admission (MIMIC-IV itemid 50862); median-imputed when missing. |
| missingindicator_creatinine_median | 0/1 | flag | 1 when no creatinine was measured and the value was imputed. |
| missingindicator_albumin_median | 0/1 | flag | 1 when no albumin was measured and the value was imputed. |
| n_major | integer | co-active order-line pairs | Major rule matches. Readmission models only: DDI summaries are outcome-derived for has_major. |
| n_moderate | integer | co-active order-line pairs | Moderate rule matches (readmission models only). |
| n_minor | integer | co-active order-line pairs | Minor rule matches (readmission models only). |
| mean_overlap_hours | number | hours | Mean overlap of the admission's rule-matched pairs (readmission models only). |
| max_overlap_hours | number | hours | Longest overlap of the admission's rule-matched pairs (readmission models only). |
| has_any_interaction | 0/1 | flag | Any rule match of any severity (readmission models only). |
Files
timing-aware-ddi-data-1.0.0.zip
57.8 kBComplete frozen release: 20 source-manifest files plus MANIFEST.json.
SHA-256 e76d5d6d2682ba4d1e5d096c4f7a60e20d1968b1e23d5105670f3febd389c230
data_dictionary.csv
24.6 kBEvery column of every table, with units and codes, and the model-feature definitions.
SHA-256 265652a2e1faf305f04047f365621682f0f68eca1796436bffc18d172cde3509
README.md
3.0 kBWhat each file contains, the patient-data note and rights.
SHA-256 4b4925ccc8ce0b7d6619caedc4a3d2d8ba417f2c90564c9c0558197585f999c3
MANIFEST.json
3.5 kBByte count and SHA-256 for every file in the source release.
SHA-256 f9f25dc118f6fca90397eb967f220e522d4c7b0f443396b598f95cf2dc3a1339
CITATION.cff
864 bytesDataset citation and creator list.
SHA-256 df607e016988963e189f54b8d9cb36b54c4c7bc93283bf38fe9698c53bc1a0ec
deposit-receipt.json
2.1 kBConductScience verification and packaging receipt.
SHA-256 b3f080dfcbb09a6df8f1a5e2b4ad638abbccd55475e062c1b07f31bd57e8b9b4
How it was made
Methods
- 1
Two drugs count as co-active only when their administration windows overlap by at least two hours. Co-active pairs are matched to nine rules derived from the 2023 AGS Beers Criteria (S2) after exact-match medication mapping (S1); S3 holds the BigQuery SQL.
- 2
Admission-level models (logistic regression, random forest and XGBoost) estimate the chance of a major rule match on a patient-level grouped 80/20 split. S4 to S12 report every metric, interval, threshold and coefficient.
- 3
The release is aggregate only: no file contains patient-level rows. The source manifest fixes all 20 files by byte count and SHA-256, and the archive adds the manifest itself.
Version history
Version 1.0.0 · current
Published September 24, 2026 from source tag v1.0.0 at commit 88feeb6a3ba8.