In the UK, general practitioners are responsible for both providing primary care services and for organising referrals for specialist care. Consequently, the medical records held by general practitioners include details of all diagnoses and prescribed drugs, in many cases extending from birth. In an increasing number of general practices, these records are held in electronic format and are potentially available for extraction and analysis. Electronic data from general practice therefore offer unique opportunities to plan and monitor health services, measure the quality of care provided by the National Health Service, and undertake population-based research.