PREDIKSI KEBUTUHAN OBAT PADA INSTALASI FARMASI RUMAH SAKIT MENGGUNAKAN METODE RANDOM FOREST BERBASIS DATA HISTORIS TRANSAKSI OBAT

Authors

  • Ahmad Junaidi Universitas Putra Indonesia YPTK Padang, Indonesia Author
  • Yeviki Maisyah Putra Universitas Putra Indonesia YPTK Padang, Indonesia Author

DOI:

https://doi.org/10.54314/jssr.v9i5.7306

Keywords:

drug demand prediction, random forest regression, hospital information system, hospital pharmacy, machine learning, drug transactions

Abstract

Abstract: Effective drug inventory management in hospital pharmacies requires accurate demand planning to minimize the risks of drug shortages and excess inventory. Historical drug transaction data stored in a Hospital Information System (SIMRS) can be utilized as a basis for predicting drug requirements for subsequent periods. This study aims to develop a drug demand prediction model using the Random Forest Regression method based on historical drug transaction data from a hospital pharmacy. The dataset consists of drug transaction records from August 2024 to December 2025 obtained from the hospital information system. The data were processed through preprocessing stages, including data cleaning, missing-value checking, duplicate detection, transaction validation, and monthly aggregation of drug usage. Subsequently, feature engineering was performed by generating historical usage features in the form of lag variables and moving averages as model inputs. The dataset was divided chronologically into training and testing sets to prevent data leakage. The Random Forest Regression model was employed to predict drug requirements for the subsequent period and evaluated using Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Weighted Absolute Percentage Error (WAPE). The results indicate that a historical transaction-based approach can be used to estimate drug requirements and provide supporting information for inventory planning in hospital pharmacies. The integration of the prediction model into SIMRS can further support pharmacy staff in planning drug requirements based on historical usage patterns

 Keyword: drug demand prediction, Random Forest Regression, hospital information system, hospital pharmacy, machine learning, drug transactions

 

Abstrak: Pengelolaan persediaan obat di instalasi farmasi rumah sakit memerlukan perencanaan kebutuhan yang tepat untuk mengurangi risiko kekurangan maupun kelebihan stok. Pemanfaatan data historis transaksi obat pada Sistem Informasi Manajemen Rumah Sakit (SIMRS) dapat digunakan sebagai dasar untuk memprediksi kebutuhan obat pada periode berikutnya. Penelitian ini bertujuan untuk mengembangkan model prediksi kebutuhan obat menggunakan metode Random Forest Regression berbasis data historis transaksi obat pada instalasi farmasi rumah sakit. Data penelitian berupa transaksi obat pada periode Agustus 2024 sampai Desember 2025 yang diperoleh dari sistem SIMRS. Data melalui tahapan preprocessing yang meliputi pembersihan data, pemeriksaan data kosong, duplikasi, validasi transaksi, dan agregasi penggunaan obat secara bulanan. Selanjutnya dilakukan feature engineering dengan membentuk fitur historis berupa lag penggunaan obat dan moving average sebagai variabel masukan model. Data dibagi secara kronologis menjadi data pelatihan dan pengujian untuk menghindari data leakage. Model Random Forest Regression digunakan untuk menghasilkan prediksi kebutuhan obat pada periode berikutnya dan dievaluasi menggunakan Mean Absolute Error (MAE), Root Mean Square Error (RMSE), dan Weighted Absolute Percentage Error (WAPE). Hasil penelitian menunjukkan bahwa pendekatan berbasis pola historis transaksi dapat digunakan untuk menghasilkan estimasi kebutuhan obat dan memberikan informasi pendukung bagi perencanaan persediaan pada instalasi farmasi. Implementasi model pada SIMRS dapat dikembangkan sebagai sistem pendukung keputusan untuk membantu petugas farmasi dalam melakukan perencanaan kebutuhan obat berdasarkan pola penggunaan historis

 Kata kunci: prediksi kebutuhan obat, Random Forest Regression, SIMRS, instalasi farmasi, machine learning, transaksi obat

Downloads

Download data is not yet available.

References

Sutabri, T. (2015). Konsep sistem informasi. Penerbit Andi.

Breiman, L. (2001). Random forests. Machine Learning, 45, 5–32. https://doi.org/10.1023/A:1010933404324.

Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts.

Bergmeir, C., Hyndman, R. J., & Koo, B. (2018). A note on the validity of cross-validation for evaluating autoregressive time series prediction. Computational Statistics & Data Analysis, 120, 70–83.

Makridakis, S., Spiliotis, E., & Assimakopoulos, V. (2018). The M4 competition: Results, findings, conclusion and way forward. International Journal of Forecasting, 34(4), 802–808. https://doi.org/10.1016/j.ijforecast.2018.06.001.

Makridakis, S., Spiliotis, E., & Assimakopoulos, V. (2020). The M4 competition: 100,000 time series and 61 forecasting methods. International Journal of Forecasting, 36(1), 54–74. https://doi.org/10.1016/j.ijforecast.2.

World Health Organization. (2024). WHO supports Ministry of Health to launch new technical guidelines on medicine procurement planning. World Health Organization.

World Health Organization. (2025). Routine health information system and health facility and community data for neglected tropical diseases: Last-mile logistics information system for medicines and health products. World Health Organization. https://doi.org/10.

World Health Organization. (2011). Harmonized monitoring and evaluation indicators for procurement and supply management systems. World Health Organization.

World Health Organization. (2018). Drug stock management at health facilities. World Health Organization.

World Health Organization. (2018). Demand planning. In Antibiotic shortages, stockouts and scarcity. World Health Organization.

World Health Organization. (2023). Warehouse and stock management. World Health Organization.

World Health Organization. (2025). Health products policy and standards: Medicines supply. World Health Organization.

World Health Organization. (2025). Routine health information system and health facility and community data for neglected tropical diseases. World Health Organization.

Scikit-learn developers. (2026). RandomForestRegressor. Scikit-learn documentation.

Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688.

Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time Series Analysis: Forecasting and Control (5th ed.). Wiley.

Brockwell, P. J., & Davis, R. A. (2016). Introduction to Time Series and Forecasting (3rd ed.). Springer.

Hastie, T., Tibshirani, R., & Friedman, J. (2009). The Elements of Statistical Learning: Data Mining, Inference, and Prediction (2nd ed.). Springer.

James, G., Witten, D., Hastie, T., & Tibshirani, R. (2021). An Introduction to Statistical Learning: With Applications in R (2nd ed.). Springer.

Kuhn, M., & Johnson, K. (2013). Applied Predictive Modeling. Springe

Downloads

Published

2026-10-17

How to Cite

PREDIKSI KEBUTUHAN OBAT PADA INSTALASI FARMASI RUMAH SAKIT MENGGUNAKAN METODE RANDOM FOREST BERBASIS DATA HISTORIS TRANSAKSI OBAT. (2026). JOURNAL OF SCIENCE AND SOCIAL RESEARCH, 9(5), 8268 – 8278. https://doi.org/10.54314/jssr.v9i5.7306