title: The freetext matching algorithm: a computer program to extract diagnoses and causes of death from unstructured text in electronic health records.
abstract: BACKGROUND
  Electronic health records are invaluable for medical research, but much information is stored as free text rather than in a coded form. For example, in the UK General Practice Research Database (GPRD), causes of death and test results are sometimes recorded only in free text. Free text can be difficult to use for research if it requires time-consuming manual review. Our aim was to develop an automated method for extracting coded information from free text in electronic patient records.
  
  
  METHODS
  We reviewed the electronic patient records in GPRD of a random sample of 3310 patients who died in 2001, to identify the cause of death. We developed a computer program called the Freetext Matching Algorithm (FMA) to map diagnoses in text to the Read Clinical Terminology. The program uses lookup tables of synonyms and phrase patterns to identify diagnoses, dates and selected test results. We tested it on two random samples of free text from GPRD (1000 texts associated with death in 2001, and 1000 general texts from cases and controls in a coronary artery disease study), comparing the output to the U.S. National Library of Medicine's MetaMap program and the gold standard of manual review.
  
  
  RESULTS
  Among 3310 patients registered in the GPRD who died in 2001, the cause of death was recorded in coded form in 38.1% of patients, and in the free text alone in 19.4%. On the 1000 texts associated with death, FMA coded 683 of the 735 positive diagnoses, with precision (positive predictive value) 98.4% (95% confidence interval (CI) 97.2, 99.2) and recall (sensitivity) 92.9% (95% CI 90.8, 94.7). On the general sample, FMA detected 346 of the 447 positive diagnoses, with precision 91.5% (95% CI 88.3, 94.1) and recall 77.4% (95% CI 73.2, 81.2), which was similar to MetaMap.
  
  
  CONCLUSIONS
  We have developed an algorithm to extract coded information from free text in GP records with good precision. It may facilitate research using free text in electronic patient records, particularly for extracting the cause of death.
authors.affiliation: Clinical Epidemiology Group, Department of Epidemiology and Public Health, University College London, London, UK. anoop@doctors.org.uk
authors.forename: Anoop D
authors.initials: AD
authors.lastname: Shah
authors.forename: Carlos
authors.initials: C
authors.lastname: Martinez
authors.forename: Harry
authors.initials: H
authors.lastname: Hemingway
mesh_terms: D000465:Algorithms; D002423:Cause of Death; D057286:Electronic Health Records; D005260:Female; D006801:Humans; D008297:Male; D015201:Meta-Analysis as Topic; D060145:Text Messaging