Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul 21;4(7):e0000936.
doi: 10.1371/journal.pdig.0000936. eCollection 2025 Jul.

Community-acquired pneumonia identification from electronic health records in the absence of a gold standard: A Bayesian latent class analysis

Affiliations

Community-acquired pneumonia identification from electronic health records in the absence of a gold standard: A Bayesian latent class analysis

Jia Wei et al. PLOS Digit Health. .

Abstract

Community-acquired pneumonia (CAP) is common and a significant cause of mortality. However, CAP surveillance commonly relies on diagnostic codes from electronic health records (EHRs), with imperfect accuracy. We used Bayesian latent class models with multiple imputation to assess the accuracy of CAP diagnostic codes in the absence of a gold standard and to explore the contribution of various EHR data sources in improving CAP identification. Using 491,681 hospital admissions in Oxfordshire, UK, from 2016 to 2023, we investigated four EHR-based algorithms for CAP detection based on 1) primary diagnostic codes, 2) clinician-documented indications for antibiotic prescriptions, 3) radiology free-text reports, and 4) vital signs and blood tests. The estimated prevalence of CAP as the reason for emergency hospital admission was 13.6% (95% credible interval 13.3-14.0%). Primary diagnostic codes had low sensitivity but a high specificity (best fitting model, 0.275 and 0.997 respectively), as did vital signs with blood tests (0.348 and 0.963). Antibiotic indication text had a higher sensitivity (0.590) but a lower specificity (0.982), with radiology reports intermediate (0.485 and 0.960). Defining CAP as present when detected by any algorithm produced sensitivity and specificity of 0.873 and 0.905 respectively. Results remained consistent using alternative priors and in sensitivity analyses. Relying solely on diagnostic codes for CAP surveillance leads to substantial under-detection; combining EHR data across multiple algorithms enhances identification accuracy. Bayesian latent class analysis-based approaches could improve CAP surveillance and epidemiological estimates by integrating multiple EHR sources, even without a gold standard for CAP diagnosis.

PubMed Disclaimer

Conflict of interest statement

The authors have declared that no competing interests exist.

Figures

Fig 1
Fig 1. Study inclusion and exclusion flowchart.
Fig 2
Fig 2. Predicted sensitivity, specificity, PPV, and NPV of the four algorithms (a, b) and algorithms combinations (c, d) under Model-3 in the primary analysis.
Algorithm combinations used an ‘OR’ rule for three or four positive outcomes. PPV: positive predictive value; NPV: negative predictive value. Codes: CAP primary diagnostic codes; Indication: CAP antibiotic indication; Radiology: chest X-ray report or CT scan report; Tests: shortness of breath and elevated C-reactive protein levels.
Fig 3
Fig 3. Observed and predicted frequency of each algorithm combination of community-acquired pneumonia (CAP) in Model-3 in the primary analysis.
The columns indicate specific combinations, with filled circles denote an algorithm being positive in each combination. Codes: CAP primary diagnostic codes; Indication: CAP antibiotic indication; Radiology: chest X-ray report or CT scan report; Tests: shortness of breath and elevated C-reactive protein levels.
Fig 4
Fig 4. Proportion of positive results in each algorithm and latent prevalences by year.
Codes: CAP primary diagnostic codes; Indication: CAP antibiotic indication; Radiology: chest X-ray report or CT scan report; Tests: shortness of breath and elevated C-reactive protein levels; Latent: latent prevalence estimated from the model. Shaded area shows the 95% credible intervals for the latent prevalence estimated from the model.

Similar articles

  • Signs and symptoms to determine if a patient presenting in primary care or hospital outpatient settings has COVID-19.
    Struyf T, Deeks JJ, Dinnes J, Takwoingi Y, Davenport C, Leeflang MM, Spijker R, Hooft L, Emperador D, Domen J, Tans A, Janssens S, Wickramasinghe D, Lannoy V, Horn SRA, Van den Bruel A; Cochrane COVID-19 Diagnostic Test Accuracy Group. Struyf T, et al. Cochrane Database Syst Rev. 2022 May 20;5(5):CD013665. doi: 10.1002/14651858.CD013665.pub3. Cochrane Database Syst Rev. 2022. PMID: 35593186 Free PMC article.
  • Diagnostic test accuracy and cost-effectiveness of tests for codeletion of chromosomal arms 1p and 19q in people with glioma.
    McAleenan A, Jones HE, Kernohan A, Robinson T, Schmidt L, Dawson S, Kelly C, Spencer Leal E, Faulkner CL, Palmer A, Wragg C, Jefferies S, Brandner S, Vale L, Higgins JP, Kurian KM. McAleenan A, et al. Cochrane Database Syst Rev. 2022 Mar 2;3(3):CD013387. doi: 10.1002/14651858.CD013387.pub2. Cochrane Database Syst Rev. 2022. PMID: 35233774 Free PMC article.
  • Antibody tests for identification of current and past infection with SARS-CoV-2.
    Fox T, Geppert J, Dinnes J, Scandrett K, Bigio J, Sulis G, Hettiarachchi D, Mathangasinghe Y, Weeratunga P, Wickramasinghe D, Bergman H, Buckley BS, Probyn K, Sguassero Y, Davenport C, Cunningham J, Dittrich S, Emperador D, Hooft L, Leeflang MM, McInnes MD, Spijker R, Struyf T, Van den Bruel A, Verbakel JY, Takwoingi Y, Taylor-Phillips S, Deeks JJ; Cochrane COVID-19 Diagnostic Test Accuracy Group. Fox T, et al. Cochrane Database Syst Rev. 2022 Nov 17;11(11):CD013652. doi: 10.1002/14651858.CD013652.pub2. Cochrane Database Syst Rev. 2022. PMID: 36394900 Free PMC article.
  • Magnetic resonance perfusion for differentiating low-grade from high-grade gliomas at first presentation.
    Abrigo JM, Fountain DM, Provenzale JM, Law EK, Kwong JS, Hart MG, Tam WWS. Abrigo JM, et al. Cochrane Database Syst Rev. 2018 Jan 22;1(1):CD011551. doi: 10.1002/14651858.CD011551.pub2. Cochrane Database Syst Rev. 2018. PMID: 29357120 Free PMC article.
  • Rapid, point-of-care antigen tests for diagnosis of SARS-CoV-2 infection.
    Dinnes J, Sharma P, Berhane S, van Wyk SS, Nyaaba N, Domen J, Taylor M, Cunningham J, Davenport C, Dittrich S, Emperador D, Hooft L, Leeflang MM, McInnes MD, Spijker R, Verbakel JY, Takwoingi Y, Taylor-Phillips S, Van den Bruel A, Deeks JJ; Cochrane COVID-19 Diagnostic Test Accuracy Group. Dinnes J, et al. Cochrane Database Syst Rev. 2022 Jul 22;7(7):CD013705. doi: 10.1002/14651858.CD013705.pub3. Cochrane Database Syst Rev. 2022. PMID: 35866452 Free PMC article.

Cited by

References

    1. Roth GA, Abate D, Abate KH, Abay SM, Abbafati C, Abbasi N, et al. Global, regional, and national age-sex-specific mortality for 282 causes of death in 195 countries and territories, 1980-2017: a systematic analysis for the Global Burden of Disease Study 2017. Lancet. 2018;392(10159):1736–88. doi: 10.1016/S0140-6736(18)32203-7 - DOI - PMC - PubMed
    1. Ho J, Ip M. Antibiotic-Resistant Community-Acquired Bacterial Pneumonia. Infectious Disease Clinics of North America. 2019;33(4):1087–103. doi: 10.1016/j.idc.2019.07.002 - DOI - PubMed
    1. Marshall DC, Goodson RJ, Xu Y, Komorowski M, Shalhoub J, Maruthappu M, et al. Trends in mortality from pneumonia in the Europe union: a temporal analysis of the European detailed mortality database between 2001 and 2014. Respir Res. 2018;19(1):81. doi: 10.1186/s12931-018-0781-4 - DOI - PMC - PubMed
    1. Quan TP, Fawcett NJ, Wrightson JM, Finney J, Wyllie D, Jeffery K, et al. Increasing burden of community-acquired pneumonia leading to hospitalisation, 1998-2014. Thorax. 2016;71(6):535–42. doi: 10.1136/thoraxjnl-2015-207688 - DOI - PMC - PubMed
    1. Aronsky D, Haug PJ, Lagor C, Dean NC. Accuracy of administrative data for identifying patients with pneumonia. Am J Med Qual. 2005;20(6):319–28. doi: 10.1177/1062860605280358 - DOI - PubMed

LinkOut - more resources