Creating medical and drug code lists to identify cases in primary care databases

Pharmacoepidemiol Drug Saf. 2009 Aug;18(8):704-7. doi: 10.1002/pds.1770.


This paper demonstrates how compilation of medical and drug code lists for outcomes or exposures of interest for studies using primary care databases can be carried out efficiently using Stata. Use of Stata do-files to record and execute the commands provides good documentation and ease of replication of the procedure.

MeSH terms

  • Antidepressive Agents / therapeutic use
  • Database Management Systems*
  • Databases as Topic*
  • Depressive Disorder / drug therapy
  • Humans
  • Medical Records Systems, Computerized*
  • Primary Health Care*
  • Reproducibility of Results
  • Software*
  • Vocabulary, Controlled*


  • Antidepressive Agents