In this talk I will describe how electronic health record (EHR) data can be analysed to provide novel insights into the clinical outcomes of people with mental disorders and how the analysis of unstructured, free text clinical assessments using natural language processing (NLP) could improve our understanding of clinical phenotypes and their associations with clinical outcomes.