Aims To identify and prioritize the root causes of adverse drug events (ADEs) in hospitals and to assess the ability of artificial intelligence (AI) capabilities to prevent ADEs. Design A mixed method design was used. Methods A cross-sectional study for hospitals in Spain was carried out between February and April 2019 to identify and prioritize the root causes of ADEs. A nominal group technique was also used to assess the ability of AI capabilities to prevent ADEs. Results The main root cause of ADEs was a lack of adherence to safety protocols (64.8%), followed by identification errors (57.4%), and fragile and polymedicated patients (44.4%). An analysis of the AI capabilities to prevent the root causes of ADEs showed that identification and reading are two potentially useful capabilities. Conclusion Identification error is one of the main root causes of drug adverse events and AI capabilities could potentially prevent drug adverse events. Impact This study highlights the role of AI capabilities in safely identifying both patients and drugs, which is a crucial part of the medication administration process, and how this can prevent ADEs in hospitals.