Analysing medical data stored in Electronic Health Records is of great interest to build clinical decision support systems. There is a lot of hidden knowledge in these databases, obtained from the continuous work of medical practitioners when attending and diagnosing patients. However, it is not easy for Machine Learning methods to exploit these data. Their use always requires a careful and complex preprocessing stage. In this paper, we study the case of diagnosis of diabetic retinopathy, which is made by ophthalmologists. The characteristics of a 12-year dataset about Type-2 diabetic people are analysed. Several numerical and categorical variables were selected by experts as relevant risk factors for this disease. We explain the challenges that are being faced in order to generate a dataset composed by time series with the same length and intervals. The final aim of the research is to build a clinical decision support system that can make a personalised prediction of the evolution of the disease.