Using NLP methods to generate clinical variables from free text fields in patient records