Back to all datasets
Published datasetVerified release

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

severitycolisted_pair_admissionstiming_aware_pair_admissionspct_suppressedcolisted_admissions_alertedtiming_aware_admissions_alertedpct_fewer_admissions
major592223949533.3429003116927.3
moderate9737777920.19588769919.7
minor15355917340.315049914839.2

Read the columns

Data dictionary

data_dictionary.csv

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
NameTypeUnits or valuesMeaning
src_nametextlowercase medication nameMedication string as ordered in MIMIC-IV, lowercased. An order maps only on an exact match.
generictext29 generic namesNormalized generic drug name.
classtextantiarrhythmic; antibiotic; anticholinergic; antiplatelet; benzodiazepine; doac; nsaid; opioid; ssri; warfarinTherapeutic class used by class-level rules.
sourcetextseedOrigin of the entry: the predefined seed list.
Supplementary_Data/S2_ruleset.csvThe nine interaction rules as implemented.11 entries
NameTypeUnits or valuesMeaning
rule_idtextR001 to R009Rule identifier.
rule_typetextgeneric+generic; generic+class; class+generic; class+classWhether each side matches a generic name or a class.
left_generictextgeneric name or blankLeft-side generic, when that side matches a generic.
left_classtextclass or blankLeft-side class, when that side matches a class.
right_generictextgeneric name or blankRight-side generic, when that side matches a generic.
right_classtextclass or blankRight-side class, when that side matches a class.
min_ageintegeryears; blank = no age limitMinimum anchor age for the rule to apply. Only R009 is restricted (65).
severitytextmajor; moderate; minorSeverity assigned to a match.
evidencetextEvidence cited: a 2023 AGS Beers Criteria table or clinical consensus.
rationaletextPlain-language reason the combination is flagged.
sourcetextSource 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
NameTypeUnits or valuesMeaning
targettexthas_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_settextn_drugs_only; core_3; expanded; expanded_no_ddi; expanded_with_ddi; nonePredictors 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.
modeltextlogistic_regression; random_forest; xgboost; always_negativeClassifier. always_negative predicts no positives and is the no-skill reference.
eval_typetextcv_mean; cv_std; testcv_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_typetext5fold_cv; default_0.5; train_f1_optimal; train_recall_0.80; predict_all_negativeOperating 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.
thresholdnumber0 to 1; blank for cross-validation and always-negative rowsDecision threshold on the predicted probability.
nintegeradmissionsAdmissions evaluated: the full cohort for cross-validation rows, the held-out set for test rows.
accuracynumber0 to 1Share of admissions classified correctly. In cv_std rows this and every metric column hold the standard deviation across folds.
precisionnumber0 to 1True positives divided by predicted positives.
recallnumber0 to 1True positives divided by actual positives.
specificitynumber0 to 1; blank in cross-validation rowsTrue negatives divided by actual negatives.
npvnumber0 to 1; blank in cross-validation rowsNegative predictive value: true negatives divided by predicted negatives.
f1number0 to 1Harmonic mean of precision and recall.
roc_aucnumber0 to 1; blank for always-negative test rowsArea under the ROC curve.
avg_precisionnumber0 to 1Average precision (area under the precision-recall curve).
tnintegeradmissions; blank in cross-validation rowsTrue negatives.
fpintegeradmissions; blank in cross-validation rowsFalse positives.
fnintegeradmissions; blank in cross-validation rowsFalse negatives.
tpintegeradmissions; blank in cross-validation rowsTrue positives.
Supplementary_Data/S5_bootstrap_confidence_intervals.csvBootstrap 95% confidence intervals on the held-out test set.10 entries
NameTypeUnits or valuesMeaning
targettexthas_majorPrediction target (see S4).
feature_settextn_drugs_only; core_3; expanded; expanded_vs_n_drugs_onlyFeature set (see S4). expanded_vs_n_drugs_only rows are paired differences between those two sets.
modeltextlogistic_regression; random_forest; xgboostClassifier.
metrictextroc_auc; avg_precision; precision@0.5; recall@0.5; f1@0.5; specificity@0.5; delta_roc_auc; delta_avg_precisionMetric estimated. @0.5 metrics use the fixed 0.5 threshold. delta_ metrics are expanded minus n_drugs_only.
point_estimatenumbermetric scaleEstimate on the held-out test set.
ci_lownumbermetric scaleLower bound of the 95% bootstrap confidence interval.
ci_highnumbermetric scaleUpper bound of the 95% bootstrap confidence interval.
n_bootstrapinteger1000Number of bootstrap resamples.
splittexttestData split resampled.
notestextResampling 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
NameTypeUnits or valuesMeaning
targettexthas_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_settextn_drugs_only; core_3; expanded; expanded_no_ddi; expanded_with_ddi; nonePredictors 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.
modeltextlogistic_regression; random_forest; xgboost; always_negativeClassifier. always_negative predicts no positives and is the no-skill reference.
eval_typetextcv_mean; cv_std; testcv_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_typetext5fold_cv; default_0.5; train_f1_optimal; train_recall_0.80; predict_all_negativeOperating 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.
thresholdnumber0 to 1; blank for cross-validation and always-negative rowsDecision threshold on the predicted probability.
nintegeradmissionsAdmissions evaluated: the full cohort for cross-validation rows, the held-out set for test rows.
accuracynumber0 to 1Share of admissions classified correctly. In cv_std rows this and every metric column hold the standard deviation across folds.
precisionnumber0 to 1True positives divided by predicted positives.
recallnumber0 to 1True positives divided by actual positives.
specificitynumber0 to 1; blank in cross-validation rowsTrue negatives divided by actual negatives.
npvnumber0 to 1; blank in cross-validation rowsNegative predictive value: true negatives divided by predicted negatives.
f1number0 to 1Harmonic mean of precision and recall.
roc_aucnumber0 to 1; blank for always-negative test rowsArea under the ROC curve.
avg_precisionnumber0 to 1Average precision (area under the precision-recall curve).
tnintegeradmissions; blank in cross-validation rowsTrue negatives.
fpintegeradmissions; blank in cross-validation rowsFalse positives.
fnintegeradmissions; blank in cross-validation rowsFalse negatives.
tpintegeradmissions; blank in cross-validation rowsTrue positives.
Supplementary_Data/S6b_age65_bootstrap_ci.csvS5 repeated for admissions with age 65 or older.10 entries
NameTypeUnits or valuesMeaning
targettexthas_majorPrediction target (see S4).
feature_settextn_drugs_only; core_3; expanded; expanded_vs_n_drugs_onlyFeature set (see S4). expanded_vs_n_drugs_only rows are paired differences between those two sets.
modeltextlogistic_regression; random_forest; xgboostClassifier.
metrictextroc_auc; avg_precision; precision@0.5; recall@0.5; f1@0.5; specificity@0.5; delta_roc_auc; delta_avg_precisionMetric estimated. @0.5 metrics use the fixed 0.5 threshold. delta_ metrics are expanded minus n_drugs_only.
point_estimatenumbermetric scaleEstimate on the held-out test set.
ci_lownumbermetric scaleLower bound of the 95% bootstrap confidence interval.
ci_highnumbermetric scaleUpper bound of the 95% bootstrap confidence interval.
n_bootstrapinteger1000Number of bootstrap resamples.
splittexttestData split resampled.
notestextResampling 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
NameTypeUnits or valuesMeaning
targettexthas_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_settextn_drugs_only; core_3; expanded; expanded_no_ddi; expanded_with_ddi; nonePredictors 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.
modeltextlogistic_regression; random_forest; xgboost; always_negativeClassifier. always_negative predicts no positives and is the no-skill reference.
eval_typetextcv_mean; cv_std; testcv_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_typetext5fold_cv; default_0.5; train_f1_optimal; train_recall_0.80; predict_all_negativeOperating 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.
thresholdnumber0 to 1; blank for cross-validation and always-negative rowsDecision threshold on the predicted probability.
nintegeradmissionsAdmissions evaluated: the full cohort for cross-validation rows, the held-out set for test rows.
accuracynumber0 to 1Share of admissions classified correctly. In cv_std rows this and every metric column hold the standard deviation across folds.
precisionnumber0 to 1True positives divided by predicted positives.
recallnumber0 to 1True positives divided by actual positives.
specificitynumber0 to 1; blank in cross-validation rowsTrue negatives divided by actual negatives.
npvnumber0 to 1; blank in cross-validation rowsNegative predictive value: true negatives divided by predicted negatives.
f1number0 to 1Harmonic mean of precision and recall.
roc_aucnumber0 to 1; blank for always-negative test rowsArea under the ROC curve.
avg_precisionnumber0 to 1Average precision (area under the precision-recall curve).
tnintegeradmissions; blank in cross-validation rowsTrue negatives.
fpintegeradmissions; blank in cross-validation rowsFalse positives.
fnintegeradmissions; blank in cross-validation rowsFalse negatives.
tpintegeradmissions; blank in cross-validation rowsTrue positives.
Supplementary_Data/S7b_readmission_coefficients.csvLogistic-regression coefficients for readmit_30d with the expanded_with_ddi feature set.3 entries
NameTypeUnits or valuesMeaning
featuretextfeature nameModel feature; definitions are listed under Model features.
coefficientnumberlog-odds per one native unitLogistic-regression coefficient on the raw feature scale (no scaling), so magnitudes are not comparable across features.
odds_rationumberratioexp(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
NameTypeUnits or valuesMeaning
operating_ruletextn_drugs >= 2 to n_drugs >= 9Flag admissions with at least this many mapped medications.
alertsintegeradmissionsAdmissions flagged.
pct_cohort_flaggednumberpercent (0 to 100)Share of the test set flagged, as a percentage. S10 reports the same measure as a fraction.
true_positives_caughtintegeradmissionsFlagged admissions with a major rule match.
recallnumber0 to 1true_positives_caught divided by all 6,220 positive test admissions.
precisionnumber0 to 1true_positives_caught divided by alerts.
alerts_per_true_positivenumberreviews per catchPharmacist reviews needed per captured major rule match.
Supplementary_Data/S9_overlap_sensitivity.csvDetection counts when the co-activity overlap threshold changes.6 entries
NameTypeUnits or valuesMeaning
overlap_threshold_hoursnumberhours: 0, 1, 2, 4, 8Minimum overlap of two administration windows for a pair to count as co-active. The main analysis uses 2.
major_pairsintegerco-active order-line pairsMajor-severity rule matches, counted per pair of overlapping order lines.
moderate_pairsintegerco-active order-line pairsModerate-severity rule matches.
minor_pairsintegerco-active order-line pairsMinor-severity rule matches.
admissions_with_majorintegeradmissionsAdmissions with at least one major match.
pct_change_in_admissions_vs_2hnumberpercent, signedChange 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
NameTypeUnits or valuesMeaning
targettexthas_majorPrediction target.
feature_settextexpandedFeature set (see S4).
modeltextlogistic_regressionClassifier.
threshold_typetextdefault_0.5; train_f1_optimal; train_recall_0.80; grid_0.05 to grid_0.95Named operating point or a grid step.
thresholdnumber0 to 1Decision threshold on the predicted probability.
precisionnumber0 to 1True positives divided by predicted positives.
recallnumber0 to 1True positives divided by actual positives.
specificitynumber0 to 1True negatives divided by actual negatives.
f1number0 to 1Harmonic mean of precision and recall.
accuracynumber0 to 1Share classified correctly.
tnintegeradmissionsTrue negatives.
fpintegeradmissionsFalse positives.
fnintegeradmissionsFalse negatives.
tpintegeradmissionsTrue positives.
alertsintegeradmissionsPredicted positives (tp + fp).
true_positives_caughtintegeradmissionsEqual to tp.
alerts_per_true_positivenumberreviews per catchalerts divided by true_positives_caught.
pct_cohort_flaggednumberfraction (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
NameTypeUnits or valuesMeaning
targettexthas_majorPrediction target.
feature_settextexpandedFeature set (see S4).
modeltextlogistic_regressionClassifier.
bininteger0 to 9Probability bin, ordered from lowest to highest predicted probability.
mean_predicted_probnumber0 to 1Mean predicted probability in the bin.
observed_frequencynumber0 to 1Share of admissions in the bin with a major rule match.
brier_scorenumber0 to 1Brier 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
NameTypeUnits or valuesMeaning
featuretextfeature nameModel feature; definitions are listed under Model features.
coefficientnumberlog-odds per one native unitLogistic-regression coefficient on the raw feature scale (no scaling), so magnitudes are not comparable across features.
odds_rationumberratioexp(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
NameTypeUnits or valuesMeaning
severitytextmajor; moderate; minorRule severity.
admissions_with_matchintegeradmissionsAdmissions with at least one match of that severity.
admissions_with_pair_active_within_24h_of_dischargeintegeradmissionsOf those, admissions where a flagged pair's co-active window reached the final 24 hours of the stay.
pctnumberpercent (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
NameTypeUnits or valuesMeaning
severitytextmajor; moderate; minorRule severity.
colisted_pair_admissionsintegerdrug pairs per admissionDistinct rule-matched drug pairs per admission when co-listing is enough.
timing_aware_pair_admissionsintegerdrug pairs per admissionThe same count when the 2-hour co-activity requirement applies.
pct_suppressednumberpercent (0 to 100)Share of co-listed pairs removed by the requirement.
colisted_admissions_alertedintegeradmissionsAdmissions with at least one co-listed match.
timing_aware_admissions_alertedintegeradmissionsAdmissions with at least one timing-aware match.
pct_fewer_admissionsnumberpercent (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
NameTypeUnits or valuesMeaning
n_drugsintegercountDistinct mapped medications in the admission (seed list only, so below the full medication count).
los_hoursnumberhoursSpan from the first to the last mapped administration; a proxy for medication exposure in the stay.
ageintegeryearsMIMIC-IV anchor_age: age in the patient's anchor year.
n_diagnosesintegercountDistinct ICD diagnosis codes on the admission.
has_ckd0/1flagChronic kidney disease: ICD-10 N18 or ICD-9 585.
has_heart_failure0/1flagHeart failure: ICD-10 I50 or ICD-9 428.
has_diabetes0/1flagDiabetes: ICD-10 E10, E11, E13 or ICD-9 250.
has_liver_disease0/1flagLiver disease: ICD-10 K70 to K77 or ICD-9 571.
has_dementia0/1flagDementia: ICD-10 F01, F02, F03, G30 or ICD-9 290, 3310.
has_copd0/1flagCOPD: ICD-10 J44 or ICD-9 491, 492, 496.
creatinine_mediannumbermg/dLMedian serum creatinine in the admission (MIMIC-IV itemid 50912); median-imputed when missing.
albumin_mediannumberg/dLMedian serum albumin in the admission (MIMIC-IV itemid 50862); median-imputed when missing.
missingindicator_creatinine_median0/1flag1 when no creatinine was measured and the value was imputed.
missingindicator_albumin_median0/1flag1 when no albumin was measured and the value was imputed.
n_majorintegerco-active order-line pairsMajor rule matches. Readmission models only: DDI summaries are outcome-derived for has_major.
n_moderateintegerco-active order-line pairsModerate rule matches (readmission models only).
n_minorintegerco-active order-line pairsMinor rule matches (readmission models only).
mean_overlap_hoursnumberhoursMean overlap of the admission's rule-matched pairs (readmission models only).
max_overlap_hoursnumberhoursLongest overlap of the admission's rule-matched pairs (readmission models only).
has_any_interaction0/1flagAny rule match of any severity (readmission models only).

Files

timing-aware-ddi-data-1.0.0.zip

57.8 kB

Complete frozen release: 20 source-manifest files plus MANIFEST.json.

SHA-256 e76d5d6d2682ba4d1e5d096c4f7a60e20d1968b1e23d5105670f3febd389c230

Download

data_dictionary.csv

24.6 kB

Every column of every table, with units and codes, and the model-feature definitions.

SHA-256 265652a2e1faf305f04047f365621682f0f68eca1796436bffc18d172cde3509

Download

README.md

3.0 kB

What each file contains, the patient-data note and rights.

SHA-256 4b4925ccc8ce0b7d6619caedc4a3d2d8ba417f2c90564c9c0558197585f999c3

Download

MANIFEST.json

3.5 kB

Byte count and SHA-256 for every file in the source release.

SHA-256 f9f25dc118f6fca90397eb967f220e522d4c7b0f443396b598f95cf2dc3a1339

Download

CITATION.cff

864 bytes

Dataset citation and creator list.

SHA-256 df607e016988963e189f54b8d9cb36b54c4c7bc93283bf38fe9698c53bc1a0ec

Download

deposit-receipt.json

2.1 kB

ConductScience verification and packaging receipt.

SHA-256 b3f080dfcbb09a6df8f1a5e2b4ad638abbccd55475e062c1b07f31bd57e8b9b4

Download

How it was made

Methods

  1. 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. 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. 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.