Chronic pain is a widespread and complex set of conditions that are often difficult and expensive to treat. Comparative effectiveness research (CER) is an evolving research method that is useful in determining which treatments are most effective for medical conditions such as chronic pain. An underutilized mechanism for conducting CER in pain medicine involves combining patient-reported outcomes (PROs) with electronic health records (EHRs). Patient-reported pain and mental and physical health outcomes are increasingly collected during clinic visits, and these data can be linked to EHR data that are relevant to the treatment of a patient’s pain, such as diagnoses, medications ordered, and medical comorbidities. When aggregated, this information forms a data repository that can be used for high-quality CER. This review provides a blueprint for conducting CER using PROs combined with EHRs. As an example, the University of Pittsburgh’s patient outcomes repository for treatment is described. This system includes PROs collected via the Collaborative Health Outcomes Information Registry software and cross-linked data from the University of Pittsburgh Medical Center EHR. The requirements, best practice guidelines, statistical considerations, and caveats for performing CER with this type of data repository are also discussed.