A multi-level time-series analysis for forecasting and operational planning in pharmaceutical services: A case study | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article A multi-level time-series analysis for forecasting and operational planning in pharmaceutical services: A case study Fengrui Pang, Xiaoqing Zhou, Tianxiang Bai, Kexin Wen, Jiajia Zhu, and 1 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7114272/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Background The efficient allocation of resources is a core challenge in health services management. In pharmacy services, accurate forecasting is fundamental to ensuring the availability of essential medicines, managing operational costs, and improving service quality. However, simple forecasts are often insufficient for robust operational planning. This study demonstrates a multi-level analytical framework to provide deeper, more actionable insights for the management of pharmaceutical resources. Methods A retrospective analysis was conducted using a public dataset of daily and weekly pharmaceutical sales from a single pharmacy (2014–2019). We analyzed three drug classes with distinct demand patterns: M01AE (anti-inflammatories), N02BE (analgesics), and R06 (antihistamines). A comparative analysis of SARIMA and Prophet forecasting models was performed on weekly data to guide strategic inventory planning. To provide deeper operational insights, we integrated three additional analyses: Change Point Detection to identify structural shifts in demand, Volatility Analysis to quantify inventory risk, and Market Basket Analysis to uncover product purchasing associations from daily transaction data. Volatility metrics were translated into a Safety Stock Index to inform inventory policy. Results The analysis confirmed that the optimal forecasting model depends on the characteristics of the service demand data. The SARIMA model performed best for the N02BE (RMSE: 57.46) and R06 (RMSE: 9.24) classes, while the Prophet model was more accurate for the M01AE class (RMSE: 9.52). Change Point Detection identified a significant structural break in demand for N02BE, which also exhibited the highest volatility (Std. Dev: 76.07) and thus the greatest inventory risk. The Market Basket Analysis revealed no strong purchasing associations between the selected drug classes (highest Lift: 1.01), suggesting that co-promotion strategies would be ineffective. Conclusions A multi-level analytical framework provides a more comprehensive evidence base for the management of pharmacy services than forecasting alone. By integrating analyses of demand volatility, structural breaks, and purchasing behavior, health service managers can develop more resilient and efficient resource allocation strategies, ultimately improving service delivery and operational performance. Health Services Research Pharmacy Management Inventory Management Forecasting Time-Series Analysis Resource Allocation Data-Driven Decision-Making Figures Figure 1 Figure 2 Figure 3 Figure 4 Background The effective management of health services is critical to ensuring quality patient care and operational sustainability [ 1 ]. A fundamental component of this is the strategic allocation of resources, particularly in environments like retail pharmacies where the timely availability of essential medicines directly impacts patient outcomes [ 2 ]. Inefficient inventory management can lead to stock-outs, which compromise patient safety and service quality, or to overstocking, which increases holding costs and the risk of waste from expired products [ 3 ]. While time-series forecasting is a standard tool for predicting future demand, its utility for comprehensive operational planning is limited when used in isolation [ 4 ]. Real-world demand patterns are often complex, influenced by underlying trend shifts, seasonal variations, and interdependencies between products that are not captured by a single forecast. For instance, an undetected structural break, or change point , in demand could render a forecast inaccurate and lead to significant resource misallocation [ 5 ]. Similarly, understanding the volatility of demand for different products is crucial for setting appropriate inventory levels and mitigating supply chain risks [ 6 ]. Furthermore, analyzing purchasing behavior through techniques like Market Basket Analysis can uncover associations between products, providing an evidence base for decisions related to service layout, promotions, and integrated care pathways [ 7 ]. A framework that combines predictive forecasting with these deeper diagnostic analyses can provide health service managers with a more robust and actionable understanding of their operational environment. This study, therefore, aims to demonstrate the value of a multi-level analytical framework for improving the management of pharmacy services. Using a publicly available dataset, we integrate forecasting with analyses of structural breaks, demand volatility, and product associations to create a holistic decision-support model for pharmacy resource allocation. Methods Study Design and Data Source This study was a retrospective analysis using a publicly available dataset containing transactional sales data from a single pharmacy from 2014 to 2019 [ 8 ]. The dataset provides sales volumes aggregated at daily and weekly intervals. We selected three drug classes for analysis based on the Anatomical Therapeutic Chemical (ATC) Classification System: M01AE (anti-inflammatory products), N02BE (analgesics/antipyretics), and R06 (systemic antihistamines). Data Analysis The analysis was conducted using Python (version 3.9) with the pandas, statsmodels, prophet, ruptures, and mlxtend libraries. Weekly Forecasting Models : For the weekly forecasting task, each time series was partitioned into a training set (2014–2018) and a test set (2019). Two models were developed: SARIMA Model : A Seasonal Autoregressive Integrated Moving Average model whose parameters were optimized for each drug class by minimizing the Akaike Information Criterion (AIC) [ 9 ]. Prophet Model : A machine learning-based model designed to handle time series with strong seasonal effects and trend changes [ 10 ]. Change Point Detection : To identify abrupt structural changes in the weekly sales data, we employed the Pelt search algorithm, an optimal partitioning method implemented in the ruptures library [ 5 ]. Volatility and Safety Stock Analysis : To quantify demand stability, we calculated the historical volatility for each drug class as the standard deviation of weekly sales. To translate this risk into an operational metric, we calculated a relative Safety Stock Index based on this volatility, assuming a desired service level of 95% (Z-score of 1.65). The index is calculated as: Safety Stock Index = Volatility * Z-score. Market Basket Analysis : To identify co-purchasing patterns, we performed a Market Basket Analysis on the daily sales data. Each day was treated as a single transaction. If a drug class had sales greater than zero on a given day, it was considered an item in that day's basket. We used the Apriori algorithm to generate association rules [ 7 ]. The strength of these associations was evaluated using the Lift metric, which measures how much more likely two items are to be purchased together than would be expected by chance. A lift value greater than 1 indicates a positive association. Evaluation : Forecast accuracy was evaluated on the 2019 test set using Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE). Results Comparative Forecast Performance Initial time-series decomposition revealed distinct patterns for each drug class, with R06 showing strong seasonality and N02BE showing a clear trend (Fig. 1 ). The analysis of forecasting models showed that the best-performing model differed according to the data's characteristics (Table 1 ). The Prophet model was more accurate for the M01AE class, which exhibited a clear trend, while the more traditional SARIMA model performed better for the N02BE and R06 classes. A visual comparison of the best-performing forecast versus the actual sales data for 2019 is provided in Fig. 2 . Table 1 Comparative Forecast Accuracy of SARIMA and Prophet Models (Weekly Data) Drug Class Model RMSE MAE M01AE SARIMA 10.129 8.149 Prophet 9.522 7.14 N02BE SARIMA 57.462 43.025 Prophet 59.906 37.403 R06 SARIMA 9.244 7.074 Prophet 9.814 7.344 Change Point and Volatility Analysis The Change Point Detection algorithm identified a significant structural break in the weekly demand for N02BE (analgesics) at week 302 of the dataset (Fig. 3 ). No significant change points were detected for the M01AE and R06 classes. The Volatility Analysis (Table 2 ) revealed that N02BE was by far the most volatile drug class, with a standard deviation of 76.07. Consequently, its Safety Stock Index, which represents the relative inventory buffer needed to protect against stock-outs, was substantially higher than the other drug classes. Table 2 Sales Volatility and Safety Stock Index by Drug Class Drug Class Mean Weekly Sales Standard Deviation (Volatility) Safety Stock Index (95% Service Level) M01AE 27.168 7.043 11.622 N02BE 208.627 76.069 125.514 R06 20.225 11.381 18.779 Market Basket Analysis The Market Basket Analysis revealed only very weak product associations (Table 3 ). The highest lift value observed was approximately 1.01. A lift value this close to 1 indicates that the co-purchase of these items occurs at a rate nearly identical to what would be expected by random chance, suggesting no meaningful purchasing association exists in the data. The lift values for the top rules are visualized in Fig. 4 . Table 3 Top Association Rules from Market Basket Analysis Antecedent Consequent Support Confidence Lift {R06} {M01AE} 0.875 0.996 1.013 {M01AE} {R06} 0.875 0.89 1.013 Discussion This study demonstrates that a multi-level analytical framework can provide a more nuanced and actionable evidence base for managing pharmacy services compared to relying on a single forecasting model. Our findings support a holistic approach to operational planning that integrates multiple data-driven insights. The comparative forecasting analysis reinforces the principle that there is no one-size-fits-all model for demand prediction in health services; the optimal choice depends on the specific characteristics of the demand data [ 10 ]. For services with clear trends, as seen with the M01AE class, modern machine learning models like Prophet may offer superior performance. The Change Point and Volatility analyses provide crucial context for risk management. The identification of a structural break and the quantification of high volatility for the N02BE class (Std. Dev. of 76.07) give managers a clear, data-driven mandate to allocate a larger safety stock (Index of 125.51) for this product line. This directly informs inventory policy and helps protect the service from costly stock-outs. Interestingly, the Market Basket Analysis yielded a significant negative finding. The absence of any strong purchasing associations (highest Lift of 1.01) is itself an important operational insight. It suggests that, for this specific service and patient population, strategies such as product bundling or co-promotions for these drug classes would likely be ineffective. This allows managers to avoid investing resources in low-impact initiatives and focus on areas with greater potential for improvement. The primary strength of this study is its synthesis of predictive and diagnostic techniques into a practical framework for health service management. However, a key limitation is that the analysis is based on data from a single pharmacy, and thus the specific findings may not be generalizable. Future research could apply this framework across multiple service locations to identify broader patterns. Additionally, the analysis is primarily univariate and does not incorporate external regressors (e.g., public health campaigns, pricing changes) that could further explain the observed demand dynamics. Conclusions An effective operational strategy for pharmacy services requires more than a single forecast. By combining forecasting with diagnostic analyses of demand volatility, structural breaks, and purchasing behavior, health service managers can develop more resilient and efficient resource allocation strategies. This integrated, data-driven framework allows for improvements in inventory planning and operational decision-making, ultimately enhancing the quality and sustainability of health service delivery. Declarations Ethics approval and consent to participate: Not applicable. This study was a retrospective analysis of a publicly available, de-identified dataset and did not involve human or animal subjects. Consent for publication: Not applicable. Availability of data and materials: The dataset analysed during the current study is publicly available on Kaggle at https://www.kaggle.com/datasets/milanzdravkovic/pharma-sales-data. The code used to perform the analysis is available from the corresponding author upon reasonable request. Competing interests: The authors declare that they have no competing interests. Funding: This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors. Authors' contributions: FP: Conceptualization, Methodology, Software, Formal Analysis, Investigation, Writing – Original Draft. XZ: Data Curation, Validation, Visualization, Writing – Original Draft. TB: Project Administration, Resources. KW: Validation, Investigation. JZ: Resources, Visualization. BW: Conceptualization, Supervision, Writing – Review & Editing. Acknowledgements: Not applicable. References World Health Organization. Framework on integrated, people-centred health services. Report by the Secretariat. 2016. Babaye, A, et al. Availability and stock-outs of essential medicines in public health facilities of Ethiopia: a multicenter cross-sectional survey. BMC Health Serv Res . 2021;21(1):1-9. Uthayakumar, R, and Priyan, S. Pharmaceutical supply chain and inventory management strategies: A literature review. Operations and Supply Chain Management: An International Journal . 2013;6(2):57-64. Jones, M, et al. Forecasting demand for emergency medical services. Health Care Manag Sci . 2018;21(4):511-26. Truong, C, Oudre, L, and Vayatis, N. Selective review of offline change point detection methods. Signal Processing . 2020;167:107299. Koh, SCL, and Tan, KH. Translating knowledge of supply chain uncertainty to supply chain improvement. International Journal of Physical Distribution & Logistics Management . 2011;41(1):62-84. Agrawal, R, and Srikant, R. Fast algorithms for mining association rules. In Proc. 20th int. conf. very large data bases, VLDB . 1994;1215:487-99. Zdravkovic, M. Pharma Sales Data. Kaggle Dataset . 2022. https://www.kaggle.com/datasets/milanzdravkovic/pharma-sales-data. Box, GEP, Jenkins, GM, Reinsel, GC, and Ljung, GM. Time series analysis: forecasting and control. 5th ed. Wiley; 2015. Taylor, SJ, and Letham, B. Forecasting at scale. The American Statistician . 2018;72(1):37-45. Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7114272","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":487033142,"identity":"893283a4-60c4-4849-8148-202b2c49b596","order_by":0,"name":"Fengrui Pang","email":"","orcid":"","institution":"Qilu Hospital of Shandong University","correspondingAuthor":false,"prefix":"","firstName":"Fengrui","middleName":"","lastName":"Pang","suffix":""},{"id":487033143,"identity":"7ba39fdb-8138-4b57-8feb-39f3a0151728","order_by":1,"name":"Xiaoqing Zhou","email":"","orcid":"","institution":"Xi'an Eighth Hospital","correspondingAuthor":false,"prefix":"","firstName":"Xiaoqing","middleName":"","lastName":"Zhou","suffix":""},{"id":487033144,"identity":"8f9693e1-363b-490f-af9a-a17fa8ecba2e","order_by":2,"name":"Tianxiang Bai","email":"","orcid":"","institution":"Shuangyashan People's Hospital","correspondingAuthor":false,"prefix":"","firstName":"Tianxiang","middleName":"","lastName":"Bai","suffix":""},{"id":487033145,"identity":"90c1ca7b-d293-4f7c-a8fd-934bafad3363","order_by":3,"name":"Kexin Wen","email":"","orcid":"","institution":"ChangSha Center For Disease Control And Prevention","correspondingAuthor":false,"prefix":"","firstName":"Kexin","middleName":"","lastName":"Wen","suffix":""},{"id":487033146,"identity":"4b7e5f74-04d8-4e32-b0e9-969fe66a2975","order_by":4,"name":"Jiajia Zhu","email":"","orcid":"","institution":"Chia Tai Tianqing Pharmaceutical Group","correspondingAuthor":false,"prefix":"","firstName":"Jiajia","middleName":"","lastName":"Zhu","suffix":""},{"id":487033147,"identity":"690b5d9e-4035-4d99-9aa5-8c705dfddc56","order_by":5,"name":"Bin Wu","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAvElEQVRIiWNgGAWjYBACA2YIXc8PIh8ABYjWkiDZwMDYkECUFiidYHCAWC3m7LzHHhfuuJNnfLzH/EFChY0xA/vhoxvwabFs5ks3nnnmWbHZmTOGDQln0swYeNLSbuB12GEeM2netsOM227kGDYkth22YZDgMSNOy+YZpGpJ3CAB0WJGUItlM0SLscSZY4UzgH4xZiPkF3P+M2AtcvztzRs+fKiwMexnP3wMrxZMwEaa8lEwCkbBKBgF2AAAGQpHBIk5OeMAAAAASUVORK5CYII=","orcid":"","institution":"SAP China Ltd","correspondingAuthor":true,"prefix":"","firstName":"Bin","middleName":"","lastName":"Wu","suffix":""}],"badges":[],"createdAt":"2025-07-13 15:38:23","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7114272/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7114272/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":87364753,"identity":"ace4ea8d-7e13-4ded-83f4-b624fd01eb18","added_by":"auto","created_at":"2025-07-23 06:20:06","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":315471,"visible":true,"origin":"","legend":"\u003cp\u003eTime-series decomposition of weekly sales for each drug class. The plots show the observed data, trend, seasonal, and residual components for M01AE, N02BE, and R06 from 2014-2019.\u003c/p\u003e","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7114272/v1/76a5152efc77c304647e6828.png"},{"id":87366028,"identity":"821937d2-c7f2-402d-ae45-fab964d53965","added_by":"auto","created_at":"2025-07-23 06:36:06","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":194926,"visible":true,"origin":"","legend":"\u003cp\u003eForecast vs. Actual Sales for 2019. The plots show the actual weekly sales (solid line) versus the forecast from the best-performing model (dashed line) for each drug class.\u003c/p\u003e","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7114272/v1/477c486fb844ec33cf3c503b.png"},{"id":87364759,"identity":"38a53be7-a49d-47a7-b526-7db877bc69c9","added_by":"auto","created_at":"2025-07-23 06:20:06","extension":"png","order_by":3,"title":"Figure 3","display":"","copyAsset":false,"role":"figure","size":72837,"visible":true,"origin":"","legend":"\u003cp\u003eChange Point Detection for N02BE (Analgesics). The plot shows the weekly sales data for N02BE with a vertical line indicating the detected structural break.\u003c/p\u003e","description":"","filename":"floatimage3.png","url":"https://assets-eu.researchsquare.com/files/rs-7114272/v1/5fd6839c1fdeb5b202fbc97c.png"},{"id":87364755,"identity":"0f97b795-05d3-4614-925b-ab54be45da74","added_by":"auto","created_at":"2025-07-23 06:20:06","extension":"png","order_by":4,"title":"Figure 4","display":"","copyAsset":false,"role":"figure","size":18977,"visible":true,"origin":"","legend":"\u003cp\u003eTop Association Rules by Lift Value. The bar chart displays the lift values for the top association rules found in the Market Basket Analysis.\u003c/p\u003e","description":"","filename":"floatimage4.png","url":"https://assets-eu.researchsquare.com/files/rs-7114272/v1/48b0962783391db206dd4d93.png"},{"id":88224526,"identity":"9deb4929-b52a-40b7-878a-db871ee7b986","added_by":"auto","created_at":"2025-08-04 08:25:06","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":1430833,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7114272/v1/3c2a1203-6058-45a7-83cd-3a37037851ab.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"A multi-level time-series analysis for forecasting and operational planning in pharmaceutical services: A case study","fulltext":[{"header":"Background","content":"\u003cp\u003eThe effective management of health services is critical to ensuring quality patient care and operational sustainability [\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e]. A fundamental component of this is the strategic allocation of resources, particularly in environments like retail pharmacies where the timely availability of essential medicines directly impacts patient outcomes [\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e]. Inefficient inventory management can lead to stock-outs, which compromise patient safety and service quality, or to overstocking, which increases holding costs and the risk of waste from expired products [\u003cspan citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e].\u003c/p\u003e\u003cp\u003eWhile time-series forecasting is a standard tool for predicting future demand, its utility for comprehensive operational planning is limited when used in isolation [\u003cspan citationid=\"CR4\" class=\"CitationRef\"\u003e4\u003c/span\u003e]. Real-world demand patterns are often complex, influenced by underlying trend shifts, seasonal variations, and interdependencies between products that are not captured by a single forecast. For instance, an undetected structural break, or \u003cb\u003echange point\u003c/b\u003e, in demand could render a forecast inaccurate and lead to significant resource misallocation [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e]. Similarly, understanding the \u003cb\u003evolatility\u003c/b\u003e of demand for different products is crucial for setting appropriate inventory levels and mitigating supply chain risks [\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e].\u003c/p\u003e\u003cp\u003eFurthermore, analyzing purchasing behavior through techniques like \u003cb\u003eMarket Basket Analysis\u003c/b\u003e can uncover associations between products, providing an evidence base for decisions related to service layout, promotions, and integrated care pathways [\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e]. A framework that combines predictive forecasting with these deeper diagnostic analyses can provide health service managers with a more robust and actionable understanding of their operational environment.\u003c/p\u003e\u003cp\u003eThis study, therefore, aims to demonstrate the value of a multi-level analytical framework for improving the management of pharmacy services. Using a publicly available dataset, we integrate forecasting with analyses of structural breaks, demand volatility, and product associations to create a holistic decision-support model for pharmacy resource allocation.\u003c/p\u003e"},{"header":"Methods","content":"\u003cp\u003e\u003cb\u003eStudy Design and Data Source\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis study was a retrospective analysis using a publicly available dataset containing transactional sales data from a single pharmacy from 2014 to 2019 [\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e]. The dataset provides sales volumes aggregated at daily and weekly intervals. We selected three drug classes for analysis based on the Anatomical Therapeutic Chemical (ATC) Classification System: M01AE (anti-inflammatory products), N02BE (analgesics/antipyretics), and R06 (systemic antihistamines).\u003c/p\u003e\u003ch2\u003eData Analysis\u003c/h2\u003e\u003cp\u003eThe analysis was conducted using Python (version 3.9) with the pandas, statsmodels, prophet, ruptures, and mlxtend libraries.\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eWeekly Forecasting Models\u003c/b\u003e: For the weekly forecasting task, each time series was partitioned into a training set (2014–2018) and a test set (2019). Two models were developed:\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003col\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eSARIMA Model\u003c/b\u003e: A Seasonal Autoregressive Integrated Moving Average model whose parameters were optimized for each drug class by minimizing the Akaike Information Criterion (AIC) [\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e].\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003cspan\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eProphet Model\u003c/b\u003e: A machine learning-based model designed to handle time series with strong seasonal effects and trend changes [\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e].\u003c/p\u003e\u003c/li\u003e\u003c/span\u003e\u003c/ol\u003e\u003cp\u003e\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eChange Point Detection\u003c/b\u003e: To identify abrupt structural changes in the weekly sales data, we employed the Pelt search algorithm, an optimal partitioning method implemented in the ruptures library [\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e].\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eVolatility and Safety Stock Analysis\u003c/b\u003e: To quantify demand stability, we calculated the historical volatility for each drug class as the standard deviation of weekly sales. To translate this risk into an operational metric, we calculated a relative Safety Stock Index based on this volatility, assuming a desired service level of 95% (Z-score of 1.65). The index is calculated as: Safety Stock Index = Volatility * Z-score.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eMarket Basket Analysis\u003c/b\u003e: To identify co-purchasing patterns, we performed a Market Basket Analysis on the daily sales data. Each day was treated as a single transaction. If a drug class had sales greater than zero on a given day, it was considered an item in that day's basket. We used the Apriori algorithm to generate association rules [\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e]. The strength of these associations was evaluated using the Lift metric, which measures how much more likely two items are to be purchased together than would be expected by chance. A lift value greater than 1 indicates a positive association.\u003c/p\u003e\u003c/li\u003e\u003cli\u003e\u003cp\u003e\u003cb\u003eEvaluation\u003c/b\u003e: Forecast accuracy was evaluated on the 2019 test set using Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE).\u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e"},{"header":"Results","content":"\u003cp\u003eComparative Forecast Performance\u003c/p\u003e\u003cp\u003eInitial time-series decomposition revealed distinct patterns for each drug class, with R06 showing strong seasonality and N02BE showing a clear trend (Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e). The analysis of forecasting models showed that the best-performing model differed according to the data's characteristics (Table\u0026nbsp;\u003cspan refid=\"Tab1\" class=\"InternalRef\"\u003e1\u003c/span\u003e). The Prophet model was more accurate for the M01AE class, which exhibited a clear trend, while the more traditional SARIMA model performed better for the N02BE and R06 classes. A visual comparison of the best-performing forecast versus the actual sales data for 2019 is provided in Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab1\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eComparative Forecast Accuracy of SARIMA and Prophet Models (Weekly Data)\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"4\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eDrug Class\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eModel\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eRMSE\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eMAE\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003eM01AE\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eSARIMA\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e10.129\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e8.149\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u0026nbsp;\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eProphet\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e9.522\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e7.14\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003eN02BE\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eSARIMA\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e57.462\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e43.025\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u0026nbsp;\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eProphet\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e59.906\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e37.403\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003eR06\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eSARIMA\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e9.244\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e7.074\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u0026nbsp;\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eProphet\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e9.814\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e7.344\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eChange Point and Volatility Analysis\u003c/p\u003e\u003cp\u003eThe Change Point Detection algorithm identified a significant structural break in the weekly demand for N02BE (analgesics) at week 302 of the dataset (Fig.\u0026nbsp;\u003cspan refid=\"Fig3\" class=\"InternalRef\"\u003e3\u003c/span\u003e). No significant change points were detected for the M01AE and R06 classes.\u003c/p\u003e\u003cp\u003eThe Volatility Analysis (Table\u0026nbsp;\u003cspan refid=\"Tab2\" class=\"InternalRef\"\u003e2\u003c/span\u003e) revealed that N02BE was by far the most volatile drug class, with a standard deviation of 76.07. Consequently, its Safety Stock Index, which represents the relative inventory buffer needed to protect against stock-outs, was substantially higher than the other drug classes.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab2\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eSales Volatility and Safety Stock Index by Drug Class\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"4\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eDrug Class\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eMean Weekly Sales\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eStandard Deviation (Volatility)\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eSafety Stock Index (95% Service Level)\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003eM01AE\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e27.168\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e7.043\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e11.622\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003eN02BE\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e208.627\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e76.069\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e125.514\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003eR06\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e20.225\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e11.381\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e18.779\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eMarket Basket Analysis\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe Market Basket Analysis revealed only very weak product associations (Table\u0026nbsp;\u003cspan refid=\"Tab3\" class=\"InternalRef\"\u003e3\u003c/span\u003e). The highest lift value observed was approximately 1.01. A lift value this close to 1 indicates that the co-purchase of these items occurs at a rate nearly identical to what would be expected by random chance, suggesting no meaningful purchasing association exists in the data. The lift values for the top rules are visualized in Fig.\u0026nbsp;\u003cspan refid=\"Fig4\" class=\"InternalRef\"\u003e4\u003c/span\u003e.\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab3\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 3\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eTop Association Rules from Market Basket Analysis\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"5\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eAntecedent\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eConsequent\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eSupport\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eConfidence\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c5\"\u003e\u003cp\u003eLift\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003e{R06}\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e\u003cb\u003e{M01AE}\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.875\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.996\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1.013\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003e\u003cb\u003e{M01AE}\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e\u003cb\u003e{R06}\u003c/b\u003e\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.875\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.89\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1.013\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003e\u003c/p\u003e"},{"header":"Discussion","content":"\u003cp\u003eThis study demonstrates that a multi-level analytical framework can provide a more nuanced and actionable evidence base for managing pharmacy services compared to relying on a single forecasting model. Our findings support a holistic approach to operational planning that integrates multiple data-driven insights.\u003c/p\u003e\u003cp\u003eThe comparative forecasting analysis reinforces the principle that there is no one-size-fits-all model for demand prediction in health services; the optimal choice depends on the specific characteristics of the demand data [\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e]. For services with clear trends, as seen with the M01AE class, modern machine learning models like Prophet may offer superior performance.\u003c/p\u003e\u003cp\u003eThe Change Point and Volatility analyses provide crucial context for risk management. The identification of a structural break and the quantification of high volatility for the N02BE class (Std. Dev. of 76.07) give managers a clear, data-driven mandate to allocate a larger safety stock (Index of 125.51) for this product line. This directly informs inventory policy and helps protect the service from costly stock-outs.\u003c/p\u003e\u003cp\u003eInterestingly, the Market Basket Analysis yielded a significant \u003cem\u003enegative\u003c/em\u003e finding. The absence of any strong purchasing associations (highest Lift of 1.01) is itself an important operational insight. It suggests that, for this specific service and patient population, strategies such as product bundling or co-promotions for these drug classes would likely be ineffective. This allows managers to avoid investing resources in low-impact initiatives and focus on areas with greater potential for improvement.\u003c/p\u003e\u003cp\u003eThe primary strength of this study is its synthesis of predictive and diagnostic techniques into a practical framework for health service management. However, a key limitation is that the analysis is based on data from a single pharmacy, and thus the specific findings may not be generalizable. Future research could apply this framework across multiple service locations to identify broader patterns. Additionally, the analysis is primarily univariate and does not incorporate external regressors (e.g., public health campaigns, pricing changes) that could further explain the observed demand dynamics.\u003c/p\u003e"},{"header":"Conclusions","content":"\u003cp\u003eAn effective operational strategy for pharmacy services requires more than a single forecast. By combining forecasting with diagnostic analyses of demand volatility, structural breaks, and purchasing behavior, health service managers can develop more resilient and efficient resource allocation strategies. This integrated, data-driven framework allows for improvements in inventory planning and operational decision-making, ultimately enhancing the quality and sustainability of health service delivery.\u003c/p\u003e"},{"header":"Declarations","content":"\u003cul\u003e\n \u003cli\u003e\u003cstrong\u003eEthics approval and consent to participate:\u003c/strong\u003e Not applicable. This study was a retrospective analysis of a publicly available, de-identified dataset and did not involve human or animal subjects.\u003c/li\u003e\n \u003cli\u003e\u003cstrong\u003eConsent for publication:\u003c/strong\u003e Not applicable.\u003c/li\u003e\n \u003cli\u003e\u003cstrong\u003eAvailability of data and materials:\u003c/strong\u003e The dataset analysed during the current study is publicly available on Kaggle at https://www.kaggle.com/datasets/milanzdravkovic/pharma-sales-data. The code used to perform the analysis is available from the corresponding author upon reasonable request.\u003c/li\u003e\n \u003cli\u003e\u003cstrong\u003eCompeting interests:\u003c/strong\u003e The authors declare that they have no competing interests.\u003c/li\u003e\n \u003cli\u003e\u003cstrong\u003eFunding:\u003c/strong\u003e This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.\u003c/li\u003e\n \u003cli\u003e\u003cstrong\u003eAuthors\u0026apos; contributions:\u003c/strong\u003e\n \u003cul\u003e\n \u003cli\u003eFP: Conceptualization, Methodology, Software, Formal Analysis, Investigation, Writing \u0026ndash; Original Draft.\u003c/li\u003e\n \u003cli\u003eXZ: Data Curation, Validation, Visualization, Writing \u0026ndash; Original Draft.\u003c/li\u003e\n \u003cli\u003eTB: Project Administration, Resources.\u003c/li\u003e\n \u003cli\u003eKW: Validation, Investigation.\u003c/li\u003e\n \u003cli\u003eJZ: Resources, Visualization.\u003c/li\u003e\n \u003cli\u003eBW: Conceptualization, Supervision, Writing \u0026ndash; Review \u0026amp; Editing.\u003c/li\u003e\n \u003c/ul\u003e\n \u003c/li\u003e\n \u003cli\u003e\u003cstrong\u003eAcknowledgements:\u003c/strong\u003e Not applicable.\u003c/li\u003e\n\u003c/ul\u003e\n"},{"header":"References","content":"\u003col\u003e\n\u003cli\u003eWorld Health Organization. \u003cstrong\u003eFramework on integrated, people-centred health services.\u003c/strong\u003e Report by the Secretariat. 2016.\u003c/li\u003e\n\u003cli\u003eBabaye, A, et al. \u003cstrong\u003eAvailability and stock-outs of essential medicines in public health facilities of Ethiopia: a multicenter cross-sectional survey.\u003c/strong\u003e\u003cem\u003eBMC Health Serv Res\u003c/em\u003e. 2021;21(1):1-9.\u003c/li\u003e\n\u003cli\u003eUthayakumar, R, and Priyan, S. \u003cstrong\u003ePharmaceutical supply chain and inventory management strategies: A literature review.\u003c/strong\u003e\u003cem\u003eOperations and Supply Chain Management: An International Journal\u003c/em\u003e. 2013;6(2):57-64.\u003c/li\u003e\n\u003cli\u003eJones, M, et al. \u003cstrong\u003eForecasting demand for emergency medical services.\u003c/strong\u003e\u003cem\u003eHealth Care Manag Sci\u003c/em\u003e. 2018;21(4):511-26.\u003c/li\u003e\n\u003cli\u003eTruong, C, Oudre, L, and Vayatis, N. \u003cstrong\u003eSelective review of offline change point detection methods.\u003c/strong\u003e\u003cem\u003eSignal Processing\u003c/em\u003e. 2020;167:107299.\u003c/li\u003e\n\u003cli\u003eKoh, SCL, and Tan, KH. \u003cstrong\u003eTranslating knowledge of supply chain uncertainty to supply chain improvement.\u003c/strong\u003e\u003cem\u003eInternational Journal of Physical Distribution \u0026amp; Logistics Management\u003c/em\u003e. 2011;41(1):62-84.\u003c/li\u003e\n\u003cli\u003eAgrawal, R, and Srikant, R. \u003cstrong\u003eFast algorithms for mining association rules.\u003c/strong\u003e In \u003cem\u003eProc. 20th int. conf. very large data bases, VLDB\u003c/em\u003e. 1994;1215:487-99.\u003c/li\u003e\n\u003cli\u003eZdravkovic, M. \u003cstrong\u003ePharma Sales Data.\u003c/strong\u003e\u003cem\u003eKaggle Dataset\u003c/em\u003e. 2022. https://www.kaggle.com/datasets/milanzdravkovic/pharma-sales-data.\u003c/li\u003e\n\u003cli\u003eBox, GEP, Jenkins, GM, Reinsel, GC, and Ljung, GM. \u003cstrong\u003eTime series analysis: forecasting and control.\u003c/strong\u003e 5th ed. Wiley; 2015.\u003c/li\u003e\n\u003cli\u003eTaylor, SJ, and Letham, B. \u003cstrong\u003eForecasting at scale.\u003c/strong\u003e\u003cem\u003eThe American Statistician\u003c/em\u003e. 2018;72(1):37-45.\u003c/li\u003e\n\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Health Services Research, Pharmacy Management, Inventory Management, Forecasting, Time-Series Analysis, Resource Allocation, Data-Driven Decision-Making","lastPublishedDoi":"10.21203/rs.3.rs-7114272/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7114272/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003ch2\u003eBackground\u003c/h2\u003e\u003cp\u003eThe efficient allocation of resources is a core challenge in health services management. In pharmacy services, accurate forecasting is fundamental to ensuring the availability of essential medicines, managing operational costs, and improving service quality. However, simple forecasts are often insufficient for robust operational planning. This study demonstrates a multi-level analytical framework to provide deeper, more actionable insights for the management of pharmaceutical resources.\u003c/p\u003e\u003ch2\u003eMethods\u003c/h2\u003e\u003cp\u003eA retrospective analysis was conducted using a public dataset of daily and weekly pharmaceutical sales from a single pharmacy (2014\u0026ndash;2019). We analyzed three drug classes with distinct demand patterns: M01AE (anti-inflammatories), N02BE (analgesics), and R06 (antihistamines). A comparative analysis of SARIMA and Prophet forecasting models was performed on weekly data to guide strategic inventory planning. To provide deeper operational insights, we integrated three additional analyses: Change Point Detection to identify structural shifts in demand, Volatility Analysis to quantify inventory risk, and Market Basket Analysis to uncover product purchasing associations from daily transaction data. Volatility metrics were translated into a Safety Stock Index to inform inventory policy.\u003c/p\u003e\u003ch2\u003eResults\u003c/h2\u003e\u003cp\u003eThe analysis confirmed that the optimal forecasting model depends on the characteristics of the service demand data. The SARIMA model performed best for the N02BE (RMSE: 57.46) and R06 (RMSE: 9.24) classes, while the Prophet model was more accurate for the M01AE class (RMSE: 9.52). Change Point Detection identified a significant structural break in demand for N02BE, which also exhibited the highest volatility (Std. Dev: 76.07) and thus the greatest inventory risk. The Market Basket Analysis revealed no strong purchasing associations between the selected drug classes (highest Lift: 1.01), suggesting that co-promotion strategies would be ineffective.\u003c/p\u003e\u003ch2\u003eConclusions\u003c/h2\u003e\u003cp\u003eA multi-level analytical framework provides a more comprehensive evidence base for the management of pharmacy services than forecasting alone. By integrating analyses of demand volatility, structural breaks, and purchasing behavior, health service managers can develop more resilient and efficient resource allocation strategies, ultimately improving service delivery and operational performance.\u003c/p\u003e","manuscriptTitle":"A multi-level time-series analysis for forecasting and operational planning in pharmaceutical services: A case study","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-07-23 06:20:02","doi":"10.21203/rs.3.rs-7114272/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"809b6994-7a47-4691-89c9-d57a975a46a5","owner":[],"postedDate":"July 23rd, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-08-04T08:23:44+00:00","versionOfRecord":[],"versionCreatedAt":"2025-07-23 06:20:02","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7114272","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7114272","identity":"rs-7114272","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.