Medications which can prolong the QT-interval on an electrocardiogram have been associated with fatal and major non-fatal adverse events affecting the heart (MACE). Despite the severity of the outcome and the very frequent need to prescribe these medications, it is surprisingly unclear which medications actually cause MACE in clinical practice for which patients and under what set of circumstances. Meanwhile computerized alerts regarding these medications are constantly disrupting patient care and may lead to lower quality prescribing and physician burnout. This is an international problem. We have formed the largest hospital electronic medical record (EMR) research network in Canada to be able to address this important patient safety issue. Our combined use of the Ontario GEMINI network and Epic-Dovetale EMR data has huge power because of the nearly 1 million patients, the rich data including medication exposure, outcomes and risk factor determination that is not available elsewhere, and the development of data structure that allows for future international collaborations. Our objectives are to a) investigate whether ‘known’ QT-prolonging medications (QTPmeds) are associated with an increased risk of MACE using advanced time-varying methods, b) use advanced machine learning methods to determine which patients, with which other diseases, medications and lab abnormalities, are more likely to suffer MACE while taking a QTPMed, and c) map our data to OMOP international standards. This project will not only improve patient safety dramatically by improving the accuracy of QTPmeds-related alerts, it will also improve productivity and work satisfaction for thousands of healthcare providers internationally. In addition, the continued expansion and improvement of the largest Canadian hospital EMR research data platform is a huge new opportunity for future high-quality research.