Fine-Tuned Transformers for Classifying Three Common Outpatient Diagnoses from Indonesian Free-Text Anamnesis
Main Article Content
Fadhil Kasvi
Hizir Sofyan
Muhammad Subianto
Nizamuddin Nizamuddin
Background: Inaccurate ICD-10 diagnostic coding remains common in Indonesian health facilities, and the free-text anamnesis written at each visit is an informative but rarely used source for checking the coded diagnosis. Whether transformer models can recognise diagnoses from such short, informal Indonesian notes has not been established.
Aims: This exploratory single-centre study fine-tuned an English BERT-base model and the Indonesian IndoBERT (IndoLEM) model to classify outpatient anamnesis notes into three physician-assigned final diagnoses (K04.1, K30, and M54.5).
Methods: Of 12,139 records from Ibnu Sina Hospital (Aceh Besar, 2019–2024), 5,611 notes remained after removal of verbatim duplicates and were split 60/20/20 with stratification. Both models were trained for 50 epochs; a second, exploratory configuration restricted the training, validation, and test data to notes of 7–40 words.
Results: In this three-class task, IndoBERT and BERT reached accuracies of 0.86 and 0.83 on the full test set (n = 1,123; macro F1 0.89 and 0.86), with overlapping confidence intervals. Only 792 of the 5,611 notes (14.1%) were 7–40 words long. On the corresponding test set (n = 159), both models were similarly accurate (BERT 147/159 correct, accuracy 0.925; IndoBERT 148/159, accuracy 0.931; McNemar p = 1.00), and all but one error involved confusion between K30 and M54.5. Because the filter also changed the test set, these results describe performance on information-dense notes rather than an effect of filtering on generalisation.
Conclusion: In this three-class, single-hospital setting, both encoders classified information-dense notes accurately, the Indonesian-specific model offered little advantage, and duplicated, very short notes limited what any model could infer. Such models may support coders as human-reviewed consistency checks, not autonomous coding or clinical decision support. Future work should apply patient-level and temporal validation, multiple random seeds, simple baselines, more diagnoses, and multi-site data.
Aden, I., Child, C. H. T., & Reyes-Aldasoro, C. C. (2024). International classification of diseases prediction from MIMIC-III clinical text using pre-trained ClinicalBERT and NLP deep learning models achieving state of the art. Big Data and Cognitive Computing, 8(5), 47. https://doi.org/10.3390/bdcc8050047
Adinda, S. H., & Siregar, R. (2023). Hubungan kelengkapan diagnosis dan tindakan pada resume medis dengan ketepatan koding rawat inap pasien BPJS di Rumah Sakit Umum Sembiring tahun 2022. Jurnal Kesehatan Deli Sumatera, 1(1), 1–7.
Astuti, N. K. N. Y., Purwanti, I. S., & Devhy, N. L. P. (2025). Gambaran ketepatan diagnosis dan keakuratan kodefikasi pada rekam medis rawat inap. Health Sciences and Pharmacy Journal, 9(1), 72–77. https://doi.org/10.32504/hspj.v9i1.1163
Aydogan-Kilic, D., Kilic, D. K., & Nielsen, I. E. (2024). Examination of summarized medical records for ICD code classification via BERT. Applied Computer Science, 20(2), 60–74. https://doi.org/10.35784/acs-2024-16
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) (pp. 4171–4186). Association for Computational Linguistics. https://doi.org/10.18653/v1/N19-1423
Edin, J., Junge, A., Havtorn, J. D., Borgholt, L., Maistro, M., Ruotsalo, T., & Maaløe, L. (2023). Automated medical coding on MIMIC-III and MIMIC-IV: A critical review and replicability study. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval (pp. 2572–2582). Association for Computing Machinery. https://doi.org/10.1145/3539618.3591918
Fadly, F., Sari, F. Y., & Rahmawati, L. (2025). Sosialisasi penggunaan ICD-10 elektronik kasus penyakit menular. EMaSS: Jurnal Pengabdian kepada Masyarakat, 7(1), 72–77.
Hautz, W. E., Kämmer, J. E., Hautz, S. C., Sauter, T. C., Zwaan, L., Exadaktylos, A. K., Birrenbach, T., Maier, V., Müller, M., & Schauber, S. K. (2019). Diagnostic error increases mortality and length of hospital stay in patients presenting through the emergency room. Scandinavian Journal of Trauma, Resuscitation and Emergency Medicine, 27, Article 54. https://doi.org/10.1186/s13049-019-0629-z
Hicks, S. A., Strümke, I., Thambawita, V., Hammou, M., Riegler, M. A., Halvorsen, P., & Parasa, S. (2022). On evaluation metrics for medical applications of artificial intelligence. Scientific Reports, 12, Article 5979. https://doi.org/10.1038/s41598-022-09954-8
Huang, C.-W., Tsai, S.-C., & Chen, Y.-N. (2022). PLM-ICD: Automatic ICD coding with pretrained language models. In Proceedings of the 4th Clinical Natural Language Processing Workshop (pp. 10–20). Association for Computational Linguistics. https://doi.org/10.18653/v1/2022.clinicalnlp-1.2
Imaduddin, H., A’la, F. Y., & Nugroho, Y. S. (2023). Sentiment analysis in Indonesian healthcare applications using IndoBERT approach. International Journal of Advanced Computer Science and Applications, 14(8), 113–117. https://doi.org/10.14569/IJACSA.2023.0140813
Irmawati, I., & Nazillahtunnisa, N. (2019). Keakuratan kode diagnosis penyakit berdasarkan ICD-10 pada rekam medis rawat jalan di Puskesmas. Jurnal Rekam Medis dan Informasi Kesehatan, 2(2), 100–105. https://doi.org/10.31983/jrmik.v2i2.5359
Ji, S., Li, X., Sun, W., Dong, H., Taalas, A., Zhang, Y., Wu, H., Pitkänen, E., & Marttinen, P. (2024). A unified review of deep learning for automated medical coding. ACM Computing Surveys, 56(12), 1–41. https://doi.org/10.1145/3664615
Kaur, R., Ginige, J. A., & Obst, O. (2023). AI-based ICD coding and classification approaches using discharge summaries: A systematic literature review. Expert Systems with Applications, 213, Article 118997. https://doi.org/10.1016/j.eswa.2022.118997
Kementerian Kesehatan Republik Indonesia. (1998). Keputusan Menteri Kesehatan Republik Indonesia Nomor 50/MENKES/SK/I/1998 tentang pemberlakuan klasifikasi statistik internasional mengenai penyakit revisi kesepuluh. Kementerian Kesehatan Republik Indonesia.
Koto, F., Rahimi, A., Lau, J. H., & Baldwin, T. (2020). IndoLEM and IndoBERT: A benchmark dataset and pre-trained language model for Indonesian NLP. In Proceedings of the 28th International Conference on Computational Linguistics (pp. 757–770). International Committee on Computational Linguistics. https://doi.org/10.18653/v1/2020.coling-main.66
Kreimeyer, K., Foster, M., Pandey, A., Arya, N., Halford, G., Jones, S. F., Forshee, R., Walderhaug, M., & Botsis, T. (2017). Natural language processing systems for capturing and standardizing unstructured clinical information: A systematic review. Journal of Biomedical Informatics, 73, 14–29. https://doi.org/10.1016/j.jbi.2017.07.012
Kusnoor, S. V., Blasingame, M. N., Williams, A. M., DesAutels, S. J., Su, J., & Giuse, N. B. (2020). A narrative review of the impact of the transition to ICD-10 and ICD-10-CM/PCS. JAMIA Open, 3(1), 126–131. https://doi.org/10.1093/jamiaopen/ooz066
Moy, A. J., Schwartz, J. M., Chen, R., Sadri, S., Lucas, E., Cato, K. D., & Rossetti, S. C. (2021). Measurement of clinical documentation burden among physicians and nurses using electronic health records: A scoping review. Journal of the American Medical Informatics Association, 28(5), 998–1008. https://doi.org/10.1093/jamia/ocaa325
Octaria, H. (2022). Tinjauan kelengkapan pencatatan anamnesa pasien IGD dengan kasus cidera sebagai pendukung ketetapan pengkodean ICD-10 di Rumah Sakit X Pekanbaru tahun 2022. Journal of Hospital Management and Health Sciences, 3(1), 55–58.
Pramono, A. E., Nuryati, N., Santoso, D. B., & Salim, M. F. (2021). Ketepatan kodifikasi klinis berdasarkan ICD-10 di Puskesmas dan rumah sakit di Indonesia: Sebuah studi literatur. Jurnal Rekam Medis dan Informasi Kesehatan, 4(2), 98–106. https://doi.org/10.31983/jrmik.v4i2.7688
Priwibowo, A., Dewa, C. K., & Luthfi, A. (2025). Enhancing disease diagnosis coding: A deep learning approach with bidirectional GRU for ICD-10 classification. Jurnal Infotel, 17(2), 299–319. https://doi.org/10.20895/infotel.v17i2.1320
Putra, T. I. Z. M., Suprapto, S., & Bukhori, A. F. (2022). Model klasifikasi berbasis multiclass classification dengan kombinasi IndoBERT embedding dan long short-term memory untuk tweet berbahasa Indonesia. Jurnal Ilmu Siber dan Teknologi Digital, 1(1), 1–28. https://doi.org/10.35912/jisted.v1i1.1509
Ramadhiane, I. N., & Sari, I. (2021). Tinjauan pengetahuan perekam medis dan informasi kesehatan mengenai aturan penggunaan ICD-10 dalam menentukan diagnosa di RS Bhayangkara TK II Sartika Asih Bandung. Jurnal Health Sains, 2(8), 1014–1022. https://doi.org/10.46799/jhs.v2i8.211
Rodrigues, J. A. de M., Nava, C. F. G., Fagundes, M. E. R., Gomes, M. C. de O., & Sato, I. D. (2024). The importance of anamnesis in the excellent clinical examination. International Journal of Science and Research Archive, 13(2), 3312–3316. https://doi.org/10.30574/ijsra.2024.13.2.2527
Sinsky, C., Colligan, L., Li, L., Prgomet, M., Reynolds, S., Goeders, L., Westbrook, J., Tutty, M., & Blike, G. (2016). Allocation of physician time in ambulatory practice: A time and motion study in 4 specialties. Annals of Internal Medicine, 165(11), 753–760. https://doi.org/10.7326/M16-0961
Steinkamp, J., Kantrowitz, J. J., & Airan-Javia, S. (2022). Prevalence and sources of duplicate information in the electronic medical record. JAMA Network Open, 5(9), Article e2233348. https://doi.org/10.1001/jamanetworkopen.2022.33348
Susanto, A., Candraningtyas, G. M., & Trijono, A. (2025). Akurasi pengkodean diagnosis dan prosedur medis serta implikasinya terhadap klaim JKN di RSUD Pandan Arang. Jurnal Ilmiah Kedokteran dan Kesehatan, 4(3), 306–317. https://doi.org/10.55606/klinik.v4i3.4610
World Health Organization. (2019). International statistical classification of diseases and related health problems (10th rev., 2019 ed.). https://icd.who.int/browse10/2019/en
Wu, S., Roberts, K., Datta, S., Du, J., Ji, Z., Si, Y., Soni, S., Wang, Q., Wei, Q., Xiang, Y., Zhao, B., & Xu, H. (2020). Deep learning in clinical natural language processing: A methodical review. Journal of the American Medical Informatics Association, 27(3), 457–470. https://doi.org/10.1093/jamia/ocz200
Yan, C., Fu, X., Liu, X., Zhang, Y., Gao, Y., Wu, J., & Li, Q. (2022). A survey of automated International Classification of Diseases coding: Development, challenges, and applications. Intelligent Medicine, 2(3), 161–173. https://doi.org/10.1016/j.imed.2022.03.003







