ImportanceStandardized processes for identifying when allergic-type reactions occur and linking reactions to drug exposures are limited.ObjectiveTo develop an informatics tool to improve detection of antibiotic allergic-type events.Design, Setting, and ParticipantsThis retrospective cohort study was conducted from October 1, 2015, to September 30, 2019, with data analyzed between July 1, 2021, and January 31, 2022. The study was conducted across Veteran Affairs hospitals among patients who underwent cardiovascular implantable electronic device (CIED) procedures and received periprocedural antibiotic prophylaxis. The cohort was split into training and test cohorts, and cases were manually reviewed to determine presence of allergic-type reaction and its severity. Variables potentially indicative of allergic-type reactions were selected a priori and included allergies entered in the Veteran Affair’s Allergy Reaction Tracking (ART) system (either historical [reported] or observed), allergy diagnosis codes, medications administered to treat allergic reactions, and text searches of clinical notes for keywords and phrases indicative of a potential allergic-type reaction. A model to detect allergic-type reaction events was iteratively developed on the training cohort and then applied to the test cohort. Algorithm test characteristics were assessed.ExposurePreprocedural and postprocedural prophylactic antibiotic administration.Main Outcomes and MeasuresAntibiotic allergic-type reactions.ResultsThe cohort of 36 344 patients included 34 703 CIED procedures with antibiotic exposures (mean [SD] age, 72 [10] years; 34 008 [98%] male patients); median duration of postprocedural prophylaxis was 4 days (IQR, 2-7 days; maximum, 45 days). The final algorithm included 7 variables: entries in the Veteran Affair’s hospitals ART, either historic (odds ratio [OR], 42.37; 95% CI, 11.33-158.43) or observed (OR, 175.10; 95% CI, 44.84-683.76); PheCodes for “symptoms affecting skin” (OR, 8.49; 95% CI, 1.90-37.82), “urticaria” (OR, 7.01; 95% CI, 1.76-27.89), and “allergy or adverse event to an antibiotic” (OR, 11.84, 95% CI, 2.88-48.69); keyword detection in clinical notes (OR, 3.21; 95% CI, 1.27-8.08); and antihistamine administration alone or in combination (OR, 6.51; 95% CI, 1.90-22.30). In the final model, antibiotic allergic-type reactions were identified with an estimated probability of 30% or more; positive predictive value was 61% (95% CI, 45%-76%); and sensitivity was 87% (95% CI, 70%-96%).Conclusions and RelevanceIn this retrospective cohort study of patients receiving periprocedural antibiotic prophylaxis, an algorithm with a high sensitivity to detect incident antibiotic allergic-type reactions that can be used to provide clinician feedback about antibiotic harms from unnecessarily prolonged antibiotic exposures was developed.