Conducting a matched-pairs historical cohort study with a computer-based ambulatory medical record system