Background: Antimicrobial prophylaxis is an evidence-proven strategy for reducing procedure-related infections; however, measuring this key quality metric typically requires manual review, due to the way antimicrobial prophylaxis is documented in the electronic medical record (EMR). Our objective was to combine structured and unstructured data from the Veterans’ Health Administration (VA) EMR to create an electronic tool for measuring preincisional antimicrobial prophylaxis. We assessed this methodology in cardiac device implantation procedures. Methods: With clinician input and review of clinical guidelines, we developed a list of antimicrobial names recommended for the prevention of cardiac device infection. Next, we iteratively combined positive flags for an antimicrobial order or drug fill from structured data fields in the EMR and hits on text string searches of antimicrobial names documented in electronic clinical notes to optimize an algorithm to flag preincisional antimicrobial use with high sensitivity and specificity. We trained the algorithm using existing fiscal year (FY) 2008-15 data from the VA Clinical Assessment Reporting and Tracking-Electrophysiology (CART-EP), which contains manually determined information about antimicrobial prophylaxis. We then validated the performance of the final version of the algorithm using a national cohort of VA patients who underwent cardiac device procedures in FY 2016 or 2017. Discordant cases underwent expert manual review to identify reasons for algorithm misclassification and to identify potential future implementation barriers. Results: The CART-EP dataset included 2,102 procedures at 38 VA facilities with manually identified antimicrobial prophylaxis in 2,056 cases (97.8%). The final algorithm combining structured EMR fields and text-note search results flagged 2,048 of the CART-EP cases (97.4%). Algorithm validation identified antimicrobial prophylaxis in 16,334 of 19,212 cardiac device procedures (87.9%). Misclassifications occurred due to EMR documentation issues. Conclusions: We developed a methodology with high accuracy to measure guideline-concordant use of antimicrobial prophylaxis before cardiac device procedures using data fields present in modern EMRs that does not rely on manual review. In addition to broad applicability in the VA and other healthcare systems with EMRs, this method could be adapted for other procedural areas in which antimicrobial prophylaxis is recommended but comprehensive measurement has been limited to resource-intense manual review.