Developing and testing a framework for coding general practitioners' free-text diagnoses in electronic medical records - a reliability study for generating training data in natural language processing
- PMID: 39014311
- PMCID: PMC11251376
- DOI: 10.1186/s12875-024-02514-1
Developing and testing a framework for coding general practitioners' free-text diagnoses in electronic medical records - a reliability study for generating training data in natural language processing
Abstract
Background: Diagnoses entered by general practitioners into electronic medical records have great potential for research and practice, but unfortunately, diagnoses are often in uncoded format, making them of little use. Natural language processing (NLP) could assist in coding free-text diagnoses, but NLP models require local training data to unlock their potential. The aim of this study was to develop a framework of research-relevant diagnostic codes, to test the framework using free-text diagnoses from a Swiss primary care database and to generate training data for NLP modelling.
Methods: The framework of diagnostic codes was developed based on input from local stakeholders and consideration of epidemiological data. After pre-testing, the framework contained 105 diagnostic codes, which were then applied by two raters who independently coded randomly drawn lines of free text (LoFT) from diagnosis lists extracted from the electronic medical records of 3000 patients of 27 general practitioners. Coding frequency and mean occurrence rates (n and %) and inter-rater reliability (IRR) of coding were calculated using Cohen's kappa (Κ).
Results: The sample consisted of 26,980 LoFT and in 56.3% no code could be assigned because it was not a specific diagnosis. The most common diagnostic codes were, 'dorsopathies' (3.9%, a code covering all types of back problems, including non-specific lower back pain, scoliosis, and others) and 'other diseases of the circulatory system' (3.1%). Raters were in almost perfect agreement (Κ ≥ 0.81) for 69 of the 105 diagnostic codes, and 28 codes showed a substantial agreement (K between 0.61 and 0.80). Both high coding frequency and almost perfect agreement were found in 37 codes, including codes that are particularly difficult to identify from components of the electronic medical record, such as musculoskeletal conditions, cancer or tobacco use.
Conclusion: The coding framework was characterised by a subset of very frequent and highly reliable diagnostic codes, which will be the most valuable targets for training NLP models for automated disease classification based on free-text diagnoses from Swiss general practice.
Keywords: Diagnostic coding; Electronic medical records; General practitioners; Reliability; Training data.
© 2024. The Author(s).
Conflict of interest statement
The authors declare no competing interests.
Similar articles
-
Using clinical text to refine unspecific condition codes in Dutch general practitioner EHR data.Int J Med Inform. 2024 Sep;189:105506. doi: 10.1016/j.ijmedinf.2024.105506. Epub 2024 May 29. Int J Med Inform. 2024. PMID: 38820647
-
Incorporating natural language processing to improve classification of axial spondyloarthritis using electronic health records.Rheumatology (Oxford). 2020 May 1;59(5):1059-1065. doi: 10.1093/rheumatology/kez375. Rheumatology (Oxford). 2020. PMID: 31535693 Free PMC article.
-
Validation of anorexia nervosa and Bulimia nervosa diagnosis coding in Danish hospitals assisted by a natural language processing model.J Psychiatr Res. 2024 Nov;179:266-269. doi: 10.1016/j.jpsychires.2024.09.018. Epub 2024 Sep 14. J Psychiatr Res. 2024. PMID: 39326221
-
Natural language processing of symptoms documented in free-text narratives of electronic health records: a systematic review.J Am Med Inform Assoc. 2019 Apr 1;26(4):364-379. doi: 10.1093/jamia/ocy173. J Am Med Inform Assoc. 2019. PMID: 30726935 Free PMC article.
-
Automated clinical coding: what, why, and where we are?NPJ Digit Med. 2022 Oct 22;5(1):159. doi: 10.1038/s41746-022-00705-7. NPJ Digit Med. 2022. PMID: 36273236 Free PMC article. Review.
References
-
- Statistik Bf. Konsultationen bei Generalistinnen und Generalisten nach Geschlecht, Alter, Bildungsniveau, Sprachgebiet. In: Statistik Bf, editor. 30.10.2018.
-
- Senn N, Tiaré Ebert S, Cohidon C. Die Hausarztmedizin in Der Schweiz – Perspektiven. Analyse basierend auf den Indikatoren Des Programm SPAM (Swiss Primary Care active monitoring) Obsan Bull. 2016;11/2016:4.
-
- Clothier HJ, Fielding JE, Kelly HA. An evaluation of the Australian Sentinel Practice Research Network (ASPREN) surveillance for influenza-like illness. Commun Dis Intell Q Rep. 2005;29(3):231–47. - PubMed
MeSH terms
Grants and funding
LinkOut - more resources
Full Text Sources