Create and use de-identified research databases. Preprocess, extract text, anonymise/de-identify, link, apply natural language processing, query for research, manage consent for contact.
Looks good to me. I'd actually started working on this but had only got as far as moving the tests out of sql_writer.pyand writing a failing test for the reported problem. So no duplication of effort!
Fixes https://github.com/ucam-department-of-psychiatry/crate/issues/131, though discovered https://github.com/ucam-department-of-psychiatry/crate/issues/132