Linking Dispense Data to Electronic Health Orders: Tutorial for Querying Commercial Pharmacy Databases to Support Systemwide Quality Improvement.
Benjamin Michaels, Jessica Pourian
Department of Pharmacy, University of California, San Francisco, 1500 Owens Street, San Francisco, CA, 94158, United States, 1 513 658 0104. · Division of Clinical Informatics and Digital Transformation, Department of Pediatrics, University of California, San Francisco, San Francisco, CA, United States.
Key points
From the paper's conclusion- EHR-integrated pharmacy data provide a feasible, timely proxy for assessing medication adherence. This tutorial provides a scalable framework for linking EHR and pharmacy data for medication adherence studies, while highlighting key methodological considerations for SQL coding.
Abstract
BACKGROUND: Assessing medication adherence is central to quality care, yet linking electronic health record (EHR) medication orders to outpatient pharmacy dispense data remains technically complex. OBJECTIVE: This study aimed to present a generalized, reproducible tutorial for linking EHR medication orders to pharmacy dispense data that can be used to assess medication dispense proportions. METHODS: We developed and validated a structured query approach to link EHR medication orders to external pharmacy dispense data using patient identifiers, medication-level identifiers, pharmacy identifiers, and temporal constraints. The tutorial emphasizes key design decisions, including handling multiple triggering events, deduplication across vendors, and managing formulation changes. A retrospective cohort of pediatric acute otitis media encounters (January 1, 2021, to January 1, 2024) was used as an illustrative example. RESULTS: Overall, 98.3% (302/307) of pharmacies in the cohort returned at least 1 dispense record during the study period and were therefore classified as reporting pharmacies. Among 3404 orders, 2616 (76.9%) had a recorded dispense. CONCLUSIONS: EHR-integrated pharmacy data provide a feasible, timely proxy for assessing medication adherence. This tutorial provides a scalable framework for linking EHR and pharmacy data for medication adherence studies, while highlighting key methodological considerations for SQL coding.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- MedMatch: a standardized medication order format for data science and natural language processing applicationsmedRxiv · 2026
- Process evaluation of the INTENSE study aimed at improving adherence to oral diabetes and/or hypertension medication in people with type 2 diabetesmedRxiv · 2026
- Medication Review Training for Japanese Community Pharmacists Using the Ask-Assess-Advise Framework: A Post-Workshop Cross-Sectional Survey of Self-Assessed Competencies.Pharmacy (Basel, Switzerland) · 2026
- Low rate of pharmacists accessing renal function laboratory values: A cross-sectional study using electronic medical records of a Japanese community pharmacyDrug Discoveries & Therapeutics · 2026
- To chat or not to chat: how osteopathic students utilize artificial intelligence platforms in pharmacology education.Frontiers in pharmacology · 2026
- Electronic collection of medication adherence patient-reported outcomes data in community pharmacies: Pilot implementation outcomes.Journal of the American Pharmacists Association : JAPhA · 2026