The European project Patient Safety through Intelligent Procedures in medication (PSIP) aims at preventing medical errors. The objective are: (1) to facilitate the systematic production of epidemiological knowledge on Adverse Drug Events (ADE) and (2) to improve the entire medication cycle in a hospital environment. The first sub-objective is to produce knowledge on ADE: to know, as exactly as possible, per hospital, per medical department, their number, type, consequences and causes, including human factors. Data Mining of structured hospital data bases, and semantic mining of free-texts will provide a list of observed ADE, with frequencies and probabilities, thus giving a better understanding of potential risks. The second sub-objective is to develop innovative knowledge based on the mining results and to deliver professionals and patients contextualized alerts and recommendations fitting the local risk parameters. This knowledge will be implemented in a PSIP-Platform independent of existing ICT applications.