OBJECTIVES: Evaluation of the appropriateness of the duration of antimicrobial treatment is a cornerstone of antibiotic stewardship programs, but it is time-consuming. Furthermore, it is often restricted to antibiotics prescribed during hospital admission. This study aimed to determine whether mandatory prescription-indication registration at the moment of prescribing antibiotics enables reliable automated assessment of the duration of antibiotic therapy, including post-discharge duration, limiting the need for manual chart review to data validation. METHODS: Antibiotic prescription and admission data, from 1-6-2020 to 31-12-2021, were electronically extracted from the Electronic Medical Record of two hospitals using mandatory indication registration. All consecutively prescribed antibiotics of adult patients who received empiric therapy in the first 24 h of admission were merged to calculate the total length of therapy (LOT) per patient, broken down per registered indication. Endpoints were the accuracy of the data, evaluated by comparing the extracted LOT and registered indication with the clinical notes in 400 randomly selected records, and guideline adherence of treatment duration. Data were analysed using a reproducible syntax, allowing semi-automated surveillance. RESULTS: A total of 3,466 antibiotic courses were analysed. LOT was accurately retrieved in 96% of the 400 evaluated antibiotic courses. The registered indication did not match chart review in 17% of antibiotic courses, of which only half affected the assessment of guideline adherence. On average, in 44% of patients treatment was continued post-discharge, accounting for 60% (± 19%) of their total LOT. Guideline adherence ranged from 26 to 75% across indications. CONCLUSIONS: Mandatory prescription-indication registration data can be used to reliably assess total treatment course duration, including post-discharge antibiotic duration, allowing semi-automated surveillance.