Adverse drug events (ADEs) are a public health issue. The objective of this work is to data-mine electronic health records in order to automatically identify ADEs and generate alert rules to prevent those ADEs. The first step of data-mining is to transform native and complex data into a set of binary variables that can be used as causes and effects. The second step is to identify cause-to-effect relationships using statistical methods. After mining 10,500 hospitalizations from Denmark and France, we automatically obtain 250 rules, 75 have been validated till now. The article details the data aggregation and an example of decision tree that allows finding several rules in the field of vitamin K antagonists.