Introduction
ICD-codes are used for classification of hospitalisations. The codes are used for administrative, financial and research purposes. It is known however that errors occur. Natural language processing (NLP) offers promising solutions for optimising the process.
Objectives
To investigate methods for automatic classification of disease in unstructured medical records using NLP and to compare these to conventional ICD coding.
Methods
Two datasets were used: the open-source MIMIC-III dataset (n = 55.177) and a dataset from a hospital in Belgium (n = 12.706). Automated searches using NLP algorithms were performed for the diagnoses “atrial fibrillation” and “heart failure”. Four methods were used: rule-based search, logistic regression, term frequency-inverse document frequency (TF-IDF), XGBoost and BioBERT. All algorithms were developed on the MIMIC-III dataset. The best performing algorithm was then deployed on the Belgian dataset.
Results
After pre-processing a total of 1.438 reports was retained in the Belgian dataset. XGBoost on TF-IDF matrix resulted in an accuracy of 0.94 and 0.92 for AF and HF respectively. There were 211 mismatches between algorithm and ICD codes. 103 were due to a difference in data availability or differing definitions. In the remaining 108 mismatches, 70% were due to incorrect labelling by the algorithm and 30% were due to erroneous ICD-coding (2% of total hospitalisations).
Discussion and conclusion
A newly developed NLP algorithm attained a high accuracy for classifying disease in medical records. XGBoost outperformed the deep learning technique BioBERT. NLP algorithms could be used to identify ICD-coding errors and optimise and support the ICD-coding process.