Authors: Dr. Pradeep, Dr. Kirti, Nilesh Paliwal, Aditya Solanki, Kanika Khurana
Abstract: Managing a pharmaceutical inventory requires holding enough medicine to meet needs while avoiding surplus purchases, since any stock that outlives its expiry date must be discarded. Most inventory software stores quantities and expiry dates but cannot indicate whether a particular batch will be sold before it expires. This paper presents a decision-support framework that predicts weekly demand for every medicine, applies the prediction to estimate how much of each batch will still be unsold on its expiry date, and converts these estimates into reorder suggestions and expiry alerts. A naïve forecast, an 8-week moving average and a Random Forest were compared, and the complete framework was evaluated in a weekly inventory simulation using 100 randomly generated datasets of 15 medicines each. Real batch records were unavailable, so every dataset is synthetic; the findings illustrate how the method behaves and do not measure the savings a real pharmacy would obtain. The moving average produced the smallest one-week-ahead error (WAPE 25.2%), whereas the Random Forest was more accurate for total demand over 12 weeks (19.9% versus 22.9%). When batches were examined 12 weeks before expiry, the forecast-based rule issued 109 alerts for 1,563 batches, compared with 1,563 alerts from a date-only rule, and achieved 89% precision and 83% recall for batches that finished with at least one fifth of their stock unsold. Capping order quantities according to expiry risk cut average stock value by roughly 5%, yet it did not significantly reduce expiry losses and it lowered the fill rate for slow-moving medicines. The alerts were therefore the more valuable component of the framework in this study. We also built a web prototype around the framework using Python and Flask, a SQLite or PostgreSQL database, role-based login, batch-wise stock, billing and a dashboard. Only the operation of this prototype was verified, and its outputs are excluded from the experiments.