Assessing the impact of artificial intelligence and machine learning on forecasting medication demand and supply in public pharmaceutical systems: A systematic review

Background : Effectively managing drug demand and supply through pharmaceutical quantification is critical as it ensures that medications are readily available when needed while reducing costs, optimizing inventory management, and ultimately improving patient care. This research aimed to examine the existing literature on the influence of artificial intelligence (AI) and machine learning (ML) on predicting pharmaceutical demand in public systems. This review focused specifically on the accuracy of these methods, their limitations, and the ethical concerns associated with their use. Methods : The research used PubMed and Google Scholar databases, following PRISMA principles, and yielded 13 peer-reviewed articles. The quality of the included studies was assessed for potential bias using established standard criteria, the Cochrane Risk of Bias Checklist Tool for systematic reviews of intervention. Results : The results show that linear regression and random forest are the predominant models for predicting medication quantities in hospital pharmacies. However, the precision of these models can be affected by data entry inaccuracies and fluctuations. The study identified technical, human, and organizational obstacles as barriers to adoption, as well as problems related to privacy and confidentiality. Conclusion: The use of AI and ML can estimate the demand and supply of medicine in public pharmaceutical delivery systems. The results highlight the importance of further study to improve forecasting algorithm simulation accuracy, broaden single time-series projections to incorporate additional patient-associated factors and investigate various efficiency measures.


Introduction
Access to essential medicines remains a fundamental aspect of public health systems worldwide, directly impacting the well-being and quality of life of populations.A scoping review of African countries by Yenet et al. [1] found that the median availability of essential medicines in the public sector was 40%, compared with 78.1% in the private sector.Thus, public health pharmaceuticals have garnered attention from various stakeholders because of their vital role in promoting universal health coverage and achieving global health goals [2,3].The pharmaceutical industry faces numerous challenges related to medication demand and supply forecasting, such as rapidly changing market dynamics, regulatory requirements, and patient expectations [4].As a result, conventional forecasting methods are inadequate for accurately quantifying medicines because of these complexities [5].
Owing to forecasting errors, hospital pharmacy departments have experienced shortages and demand and supply changes, affecting pharmaceutical stock control [6,7].Effective management of medication demand and supply through pharmaceutical quantification is essential because it ensures that medications are readily available when needed [8].However, it is worth noting that, for reliable and successful quantification of essential medicines, accurate information about consumption data, procurement period, lead time, morbidity, and demographic data, along with compliance with the use of an Essential Medicines List (EML), is critically required [9].
As the global market grows technologically, artificial intelligence (AI) and machine learning (ML) have become influential tools in various industries, including healthcare [10].Artificial intelligence (AI) refers to a collection of technological advancements that enable computers, including machine learning (ML), to perform tasks that would typically require the expertise of humans [11].Artificial intelligence and machine learning have emerged as promising technologies that have the potential to revolutionize drug demand and supply prediction in public drug delivery systems [12].Using these sophisticated analytical methods, it is possible to analyze enormous quantities of data, detect latent patterns, and generate predictions in real-time, thus enhancing the precision of forecasts and the effectiveness of supply chains [13].
Therefore, AI and ML can be particularly beneficial in effectively forecasting medication demand and supply to patients in public pharmaceutical delivery systems.AI and ML in pharmacy stock control can optimize medicine supplies to enhance patient care, and reduce extra inventory despite demand and supply variations [6].By using sophisticated algorithms to examine intricate and ever-changing consumption trends, AI and ML can enhance the precision of forecasts and the management of inventories [14].
This study systematically reviewed the existing literature on the use of AI and ML in forecasting medication demand and supply in public pharmaceutical delivery systems.This work might change public healthcare systems and pharmaceutical management by revealing how AI and machine learning can predict medicine demand and supply [12].This is a significant and relevant study because it affects healthcare cost efficiency, pharmaceutical accessibility, inventory management, and public health outcomes.

Specific Objectives
 To assess the accuracy and impact of AI and ML in predicting pharmaceutical needs in the public healthcare system. To identify the limitations of AI and ML in pharmaceutical forecasting. To understand the ethical considerations of AI/ML use in forecasting medication demand and supply in public pharmaceutical delivery systems.

Search Strategy
This comprehensive study examined how AI and machine learning estimate public pharmaceutical systems of distribution, medicine availability, and demand.To assess the effect of these technologies, PubMed and Google Scholar databases were used to carefully compile and integrate applicable published research using PRISMA principles.

Inclusion Criteria
 Focus on AI and ML applications in medication demand and supply forecasting within pharmaceutical delivery systems. Studies published within five years (2019 to 2023). Studies published in peer-reviewed journals as well as gray literature. Studies in English.
Since technological advancement progresses at a quick rate, focusing on recent articles is imperative.

Exclusion Criteria
 Studies that are not directly related to AI and machine learning in medication demand and supply forecasting.
 Studies conducted in private settings. Studies with insufficient and biased information. Studies conducted before 2019.
Studies in private settings were excluded on the basis that the offerings, service organization, and medications frequently encountered are different, which could complicate data synthesis and conclusions.A Preferred Reporting Item for Systematic Review and Meta-Analysis (PRISMA) was used for screening data sources for the study.

Data Extraction
The process of data extraction was based on the study approach, strategies for including and excluding papers, settings, contrasts among them, and the result measurements used.The data extracted include the author(s), country of study, setting, objectives, model, programming method, number of medicines used, and results.

Quality Assessment
The quality of the included studies was assessed for potential bias using established standard criteria, the Cochrane Risk of Bias Checklist Tool for systematic reviews of intervention.

Data Synthesis and Analysis
The data were analyzed using Microsoft Excel to identify trends, patterns, and commonalities among the selected studies.

Ethical Considerations
There was no primary data collection involved in this study, therefore, ethical approval was not considered.

Data Selection Process
The search criteria resulted in 76 articles which were then processed as shown in the flow diagram below, which details the search process.

Study Features
The selection criteria applied yielded 13 papers that were published in peer-reviewed journals between 2020 and 2023.The studies dealt with an assortment of medicines, whereas only two papers [15,16] dealt with vaccines only, with the latter specifically dealing with COVID-19 vaccines.The data used in the study ranged from 1 to 9 years, with three studies not revealing this information.
Ten of the papers (76.9%) tested at least one model while the other two (16.4%) did not.Data sources were either local, regional, or national health information systems.One study, [5] used data from a public domain to demonstrate the effectiveness of the suggested models.The majority of the papers (5, 38%) employed the R programing language while four (30.8%) used the Python programing language.However, one study did not state the programing language used, and the other three studies did not employ any programing language as they did not test any model.Six of the papers (46.2%) used the methodology of Cross Industry Standard Process for Data Mining (CRISP-DM) [14,17] for data preparation and processing.

Number of Medicines Involved
The number of medicines involved in the prediction models ranged from 1 to 105, with a median of 14.Two papers did not report the number of products predicted, while one paper did not demonstrate any prediction model.Figure 2 shows the number of medicines/products used in each study.

Risk of Bias
The risk of bias was assessed using the Cochrane Risk of Bias Tool [17].Only one study [13] was considered high-risk.The rest of the papers were either low risk or low risk with some concerns.Figure 6 summarizes the risk of bias gleaned from the studies.

Predictive Accuracy
This research explored the applicability of AI and ML in forecasting drug quantities for hospital pharmacies, including the accuracy of the models, implementation challenges, and data privacy.Most of the studies focused on testing a model or a few models and then evaluating their accuracy using R 2 , RMSE, or both.While a universally agreed-upon standard metric for evaluating model outcomes has not yet been established, Chicco et al. [18] provided evidence that R 2 is a more insightful and accurate measure than RSME.Furthermore, R 2 does not suffer from the restrictions associated with interpretability.Liemohn et al. [19] contend that the practice of assessing a model or prediction approach solely based on one indicator followed by refining it to maximize that particular statistic might result in enhancements in one aspect while compromising another significant characteristic.
Linear regression and random forest were the most popular models identified in the studies.While linear regression typically investigates the association between the average values of the input and output parameters, this approach fails to provide a comprehensive depiction of individual variables, indicating a limited comprehension of the interactions between variables [20].Given that the root mean square error (RMSE) quantifies the discrepancy between observed and anticipated data [12], it is preferable to have a lower RMSE value.Comparatively, it may seem as if the Random Forest model tested by Sujatha [21] with an RMSE value of 0.74 outperformed other models.However, Chai and Draxler [22] warn that it is frequently necessary to use a mix of measures to evaluate model performance since variations from the error distribution appear to be more significant when comparing models with only one metric.
The accuracy of the tested models might have been compromised by errors in judgment that occurred throughout the traditional data-entering process and the variability in the number of medicines involved and the length of period of the data used [9,13,23].Without accounting for the lead times necessary for medicine restocking and employing real-time data, accurate modeling, and comparison become challenging [13].

Implementation Challenges
This study also examined the implementation challenges of AI and ML in the public pharmaceutical supply chain.Although most studies concentrated on testing models, a few studies mentioned issues relating to implementation.Kumar et al [23] dealt with important success elements for adopting AI in the hospital supply chain.The author reveals technological issues as the first critical success element, implying that overcoming technological glitches promotes the successful implementation of AI in hospital stock forecasting.Kaushik et al [12] consider the linearity assumption made by persistence and ARIMA algorithms to be problematic because it may not be satisfied in practical applications.In reality, the healthcare supply chain may be conceptualized as intricate structures that function within uncertain circumstances characterized by a multitude of linked components, and possess the ability to adapt to changes in the context, such as technological advancements, legislative modifications, or changes in consumer preferences [24,25].Time-series projections for hospitals require ensuring the models limit over fitting in the data that underpins them [12], while the incorporation between blockchain technologies and ML is another technical challenge arising from the research [16].This is backed by Rodríguez-Espíndola et al. [26], who highlight that these difficulties may be solved with the use of an interwoven mix of emerging disruptive innovations capable of enhancing, tracking, and executing choices that may be beneficial.To achieve higher productivity, another challenge is interoperability which entails seamless interaction between individuals, companies, and government agencies [16,23].
The study also reveals human-related challenges in embracing AI technology, including the choice of a suitable model [12].This agrees with Vora et al. [27], who indicated that the complexity of artificial intelligence (AI) algorithms is a formidable challenge, resulting in outcomes that are difficult to comprehend, even for those with expertise in the domain.While manual data entry is challenging for individuals, it limits the utility and adoption of AI and ML in the hospital supply chain [16,23].The papers also raise the attractiveness of operators as a crucial aspect that encompasses the assessment of technological usage by individuals and transcends their philosophical and moral viewpoints.
Organizational barriers can impede the implementation and acceptance of AI technologies.Three papers [21,28,29] reveal budgetary and resource constraints as barriers to AI adoption.Horváth and Szabó [30] share this view and emphasize that the preparation of organizations, which includes factors such as their business culture, plays a crucial role in ensuring the provision of the necessary resources for the widespread implementation of artificial intelligence (AI).Cao et al. [31] pointed out that organizational governance and collaboration are critical to technology adoption, and better delivery benefits are a consequence of good support.

Ethical Consideration and Data Privacy
A single academic article [16] stated that data accessibility is hampered by privacy regulations, which require obtaining consent from government bodies and vaccine manufacturers.The significance of data privacy and security becomes paramount as organizations increasingly depend on machine learning models for predicting required stock levels [32].Data collection is often sourced from several channels, including online purchases, social network engagements, and loyalty schemes [33].Consequently, organizations must guarantee that the acquisition, retention, and use of such data comply with stringent privacy requirements [34].
Failure to adequately address privacy concerns may result in the inadvertent disclosure of sensitive personal information, with potentially negative consequences for individuals in terms of their personal lives and employment prospects [35].Moreover, the use of artificial intelligence (AI) models in the context of inventory projections necessitates institutions to securely conserve and analyze substantial volumes of personal data [36].The possibility of security breaches or illegal access to highly confidential data has raised concerns [37].To address these concerns, organizations must implement robust data security measures, such as encryption and access controls, to protect customer data from unauthorized access [38].

Conclusion
This project focused on the use of AI and Machine Learning (ML) to predict pharmaceutical demand and supply in public health systems.The analysis encompasses a comprehensive evaluation of research conducted from 2020 to 2023.The research used data sources from various regional, or national health IT databases, plus a single investigation employing publicly available data.This argues that artificial intelligence (AI) and machine learning (ML) can significantly improve healthcare and patient outcomes by helping the public sector make more accurate predictions about drug demand and supply.AI and ML have been shown to optimize inventory levels and improve care by examining consumption trends and improving forecast accuracy.This study examined the ability of artificial intelligence (AI) and machine learning (ML) to fundamentally transform the prediction of drug demand and supply in public health systems.This research shows that integrating AI and ML into government drug delivery networks can provide significant benefits.The research found that linear regression and random forest are the most widely used models.
Proper simulation and comparability become problematic when the lead times required for drug refills and real-time data are not considered.This paper highlights the difficulties facing the pharmaceutical sector, including changing market conditions and consumer demands.Identification of technology failures was established as the main factor for success.Interoperability was also identified as a barrier to implementation.This implies that addressing technical glitches is critical to the effective use of AI in hospital inventory forecasting.Nevertheless, the precision of the evaluated models may have been affected by scoring errors that occurred with the traditional data entry method, as well as by variations in the number of drugs involved and the duration of data used.
Organizational obstacles, such as budget and resource constraints, can hinder the implementation and adoption of AI technologies.Human-related challenges include the reluctance to use technology and choosing the appropriate model.The difficulties associated with using AI and ML in pharmaceutical demand and supply prediction in the public sector include the swift fluctuations in market conditions, regulatory obligations, patient expectations, and the need for advanced algorithms to manage intricate consumption patterns.
Ethical aspects, such as the need for clear standards and conscientious use of data, must also be taken into account.Failure to adequately address privacy issues can result in the inadvertent disclosure of sensitive personal information, potentially hurting people's lives and work opportunities.In addition, there is a mismatch between the current capabilities of AI and existing legislation, which requires the establishment of clear and standardized norms to ensure the security, privacy, and ethical use of private information.It highlights the need for regulatory adjustments to adapt to the rapid advances in technology.

Recommendations
In future research endeavors, it is recommended to conduct another experiment that employs this strategy on a larger scale and incorporates supplementary prediction approaches, with special emphasis on the combination of models.Another potential avenue for future investigation is expanding single time-series projections to include projections that would involve other patient-associated variables in conjunction with spending on various treatments for each patient.It is worthwhile to carry out further research on the models and tests using real-time data that spans a long period which considers the lead time and numerous medicines.Additional research should be aimed at enhancing the modeling precision of the prediction algorithm that encompasses a larger number of examples and the exploration of diverse performance metrics.

Limitations
The research is blighted by the small number of papers as it was limited to open-access articles.Because the papers considered are only published in English journals, there exists a possibility of language bias.

Figure 1 Figure 2
Figure 1 Search process flow diagram

Figure 3
Figure 3 Frequency of each model usage in the overall data source3.5.Predictive AccuracyMost studies evaluated the models used either with the coefficient of determination (R 2 ) or the Root Mean Square Error (RMSE).Holt-Winters Seasonal Addictive had the highest RMSE of 408.Random Forest had the lowest RMSE of 0.74.Of the studies that provided the coefficient of determination, the ensemble model had the best data fit with 0.91.Figure4shows the R 2 and RMSE values for each given model.Five papers provided only RMSE values whereas four papers provided both R2 and RMSE values for model evaluation.

Figure 4
Figure 4 Models and their R 2 and RMSE values 3.6.Challenges and Data Privacy in Implementing AI Only 9 of the 13 (69.2%)papers mentioned challenges in AI implementation in hospital forecasting.The challenges were classified into five categories: technology, human, institutional, model, and external related.Only one paper (7.7%) mentioned the issue of data privacy.Figure 5 presents a visualization of the challenges in a pie chart.

Figure 5
Figure 5 Percentage of studies per challenge category

Figure 6
Figure 6 Assessment of the risk of bias per study