PT - JOURNAL ARTICLE AU - Lethebe, B. Cord AU - Williamson, Tyler AU - Garies, Stephanie AU - McBrien, Kerry AU - Leduc, Charles AU - Butalia, Sonia AU - Soos, Boglarka AU - Shaw, Marta AU - Drummond, Neil TI - Developing a case definition for type 1 diabetes mellitus in a primary care electronic medical record database: an exploratory study AID - 10.9778/cmajo.20180142 DP - 2019 Apr 01 TA - CMAJ Open PG - E246--E251 VI - 7 IP - 2 4099 - http://www.cmajopen.ca/content/7/2/E246.short 4100 - http://www.cmajopen.ca/content/7/2/E246.full SO - CMAJ2019 Apr 01; 7 AB - Background: Identifying cases of disease in primary care electronic medical records (EMRs) is important for surveillance, research, quality improvement and clinical care. We aimed to develop and validate a case definition for type 1 diabetes mellitus using EMRs.Methods: For this exploratory study, we used EMR data from the Southern Alberta Primary Care Network within the Canadian Primary Care Sentinel Surveillance Network (CPCSSN), for the period 2008 to 2016. For patients identified as having diabetes mellitus according to the existing CPCSSN case definition, we asked family physicians to confirm the diabetes subtype, to create the reference standard. We used 3 decision-tree classification algorithms and least absolute shrinkage and selection operator logistic regression to identify variables that correctly distinguished between type 1 and type 2 diabetes cases.Results: We identified a total of 1309 people with type 1 or type 2 diabetes, 110 of whom were confirmed by their physicians as having type 1 diabetes. Two machine learning algorithms were useful in identifying these cases in the EMRs. The first algorithm used “type 1” text words or age less than 22 years at time of initial diabetes diagnosis; this algorithm had sensitivity 42.7% (95% confidence interval [CI] 33.5%–52.5%), specificity 99.3% (95% CI 98.6%–99.7%), positive predictive value 85.5% (95% CI 72.8%–93.1%) and negative predictive value 94.9% (95% CI 93.5%–96.1%). The second algorithm used a combination of free-text terms, insulin prescriptions and age; it had sensitivity 87.3% (95% CI 79.2%–92.6%), specificity 85.4% (95% CI 83.2%–87.3%), positive predictive value 35.6% (95% CI 29.9%–41.6%) and negative predictive value 98.6% (95% CI 97.7%–99.2%).Interpretation: We used machine learning to develop and validate 2 case definitions that achieve different goals in distinguishing between type 1 and type 2 diabetes in CPCSSN data. Further validation and testing with a larger and more diverse sample are recommended.