Optimising the use of electronic medical records for large scale research in psychiatry | Synapse