PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
April 19, 2026BMC Medical Informatics and Decision Making0 citationsOpen Access

A machine learning model to simplify recognition of patients with atrial fibrillation based on diagnostic codes in Swedish primary health care

ANAnders NorrmanCWCaroline WachtlerPWPer Wändell

Key Result

A machine learning model based on routine primary health care data, including visit frequency, age, and diagnostic codes, predicted newly diagnosed atrial fibrillation with an AUC of 0.77 to 0.79.

Key Points

  • The aim is to develop a machine learning model to differentiate between low and high risk of atrial fibrillation using diagnostic codes.
  • Developed machine learning models using stochastic gradient boosting.
  • Analyzed diagnostic data from 42,607 individuals with atrial fibrillation and 427,169 matched controls.
  • Stratified models for age and sex; assessed performance using AUC, sensitivity, and specificity.
  • Ranked key predictors including visit frequency, age, and ICD-10 codes.
  • Model AUC values ranged from 0.77 to 0.79 across subgroups.
  • Sensitivity was between 0.76 and 0.80, with higher sensitivity in older groups.
  • Specificity ranged from 0.58 to 0.66, higher in younger individuals.
  • Models correctly identified 95–98% of individuals without known atrial fibrillation.

Study Design

Type

Case-Control (n=469,776)

Structured PICO

Can a machine learning model based on routinely collected primary health care data (visit frequency, age, and diagnostic codes) accurately identify individuals at high risk of incident atrial fibrillation?

P
Population
469,776 individuals aged ≥ 45 years from primary health care in Region Stockholm, Sweden, comprising 42,607 cases with newly diagnosed atrial fibrillation or atrial flutter and 427,169 age- and sex-matched controls.
I
Intervention
Machine learning model (stochastic gradient boosting) utilizing the number of primary health care visits in the preceding 12 months, age, and ICD-10 diagnostic codes from a 3-year retrospective window to predict incident atrial fibrillation.
O
Outcome
Model predictive performance evaluated by Area Under the Receiver Operating Characteristic Curve (AUC), sensitivity, and specificity.

A machine learning model using only age, visit frequency, and routine diagnostic codes can effectively stratify patients for atrial fibrillation risk in primary care, potentially guiding targeted screening efforts.

Main Result

Effect estimate: AUC 0.77-0.79

Limitations

  • The correctness of the atrial fibrillation diagnosis was not validated.
  • Unable to determine if the diagnosis was made for the first time in primary health care or had been established previously elsewhere.
  • Unable to account for ethnicity and socioeconomic status due to lack of available data.
  • Lifestyle and behavioral variables such as alcohol consumption, smoking, physical inactivity, and family history of AF were absent from the dataset.
  • Potential underuse or underreporting of several chronic diagnoses in primary health care.
  • Correctness of the AF diagnosis was not validated
  • Unknown whether controls underwent any investigations to screen for AF
  • Unable to account for ethnicity and socioeconomic status
  • Lack of lifestyle and behavioral variables (alcohol consumption, smoking, physical inactivity, family history)
  • Potential underuse or underreporting of chronic diagnoses in primary health care

Abstract

Atrial fibrillation (AF) is a major risk factor for atherothrombotic complications but is often asymptomatic and undiagnosed. This study aimed to develop a machine learning model to distinguish between individuals with low and high risk of AF, using routinely collected diagnostic data from Swedish primary health care. Cases (n = 42,607, aged ≥ 45 years) with diagnosed new onset AF and controls (n = 427,169) matched by age and sex. Machine learning models stratified for age (45–69 and ≥ 70 years) and sex were developed using stochastic gradient boosting, based on number of primary health care visits during the year before the index AF diagnosis, age, and ICD-10 codes from electronic medical records 2014–2019. Performance was evaluated by AUC, sensitivity and specificity, and key predictors ranked by normalized relative influence (NRI) and odds ratios for marginal effects. The most influential predictors were the number of visits (NRI: 29.9–46.3%) and age (NRI: 6.2–15.9%), followed by risk factors for AF such as heart failure, hypertension, and cardiac arrhythmias. Model AUC ranged from 0.77 to 0.79 across subgroups. Sensitivity was 0.76–0.80, and specificity 0.58–0.66, with higher sensitivity in older groups and higher specificity in younger ones. The models correctly identified 95–98% of individuals without known AF. The models show good predictive ability, effectively ruling out low-risk patients while identifying known risk factors. With AUC values comparable to more complex models, our approach using only visit frequency, age, and diagnoses may support initial risk assessment in primary health care for identifying individuals at risk of AF.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Norrman et al. (2026) conducted a case-control in Atrial fibrillation (n=469,776). Stochastic gradient boosting machine learning model was evaluated on Prediction of newly diagnosed atrial fibrillation (AUC 0.77-0.79). A machine learning model based on routine primary health care data, including visit frequency, age, and diagnostic codes, predicted newly diagnosed atrial fibrillation with an AUC of 0.77 to 0.79.

synapsesocial.com/papers/69e47376010ef96374d8f3f5https://doi.org/10.1186/s12911-026-03491-4
Ask AI
Helpful
Bookmark
Share
View Full Paper

Also Consider

Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context:

  1. 1The Epidemiology of Heart Failure, Based on Data for 2.1 Million Inhabitants in Sweden2013 · 315 citations
  2. 2TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods2024 · 3,246 citations
  3. 3Machine learning-based identification of risk-factor signatures for undiagnosed atrial fibrillation in primary prevention and post-stroke in clinical practice2022 · 27 citations
  4. 4Prediction of Atrial Fibrillation Using Machine Learning: A Review2021 · 49 citations
  5. 5Assessment of a Machine Learning Model Applied to Harmonized Electronic Health Record Data for the Prediction of Incident Atrial Fibrillation2020 · 149 citations