Project facts & technologies
A citation-friendly summary of the Pharmaceutical Inventory Management Platform — scope, technology, and headline outcomes.
- Client context
- Hospital pharmacy with recurring stockouts of critical medications and overstocking of slow-movers
- Industry segment
- Hospital Pharmacy, Healthcare, Pharma Supply Chain
- Engagement type
- AI forecasting + optimization platform — design, build, and deployment
- Forecast accuracy
- 90% across blended horizons and SKUs
- Inventory cost reduction
- 25% reduction in inventory carrying cost
- Stockout reduction
- 80% reduction in stockouts of critical medications
- Return on investment
- 300% ROI on the platform deployment
- Forecasting models
- ARIMA · Random Forest · Prophet (ensemble)
- Optimization layer
- Genetic Algorithm — multi-objective reorder planning
- GA objectives
- Minimise cost, minimise stockout risk, respect shelf life, supplier MOQ, lead time, storage limits
- Data signals ingested
- Historical consumption, patient admissions, seasonal disease trends, prescription patterns, supplier lead times, drug master data
- Cloud platform
- AWS — ingestion, feature store, training and inference, optimizer hosting
- Implementation language
- Python end-to-end — forecasting, ensemble combination, optimization, integration
- Downstream consumption
- Auto-reorder recommendations, stockout risk alerts, slow-mover action list, cost/ROI dashboard, ERP/HIS integration
Why does hospital pharmacy inventory fail in both directions?
Hospital pharmacies sit at the intersection of two problems that pull in opposite directions. On one side, stockouts of critical medications are not just an operational inconvenience — they delay treatment, force substitutions, and in the worst cases compromise patient safety. On the other, overstocking of slow-moving drugs locks up working capital, occupies cold-chain and shelf space, and exposes the hospital to write-offs when medications expire on the shelf.
Both happen simultaneously because hospital medication demand is driven by admission patterns, acuity mix, prescribing patterns that vary by department and protocol, and seasonal disease waves (flu, dengue, respiratory infections, vector-borne disease cycles) — none of which is captured by static reorder rules. What pharmacies actually need is two cooperating capabilities: a forecasting layer that predicts demand with operational accuracy, and an optimization layer that translates those forecasts into reorder plans under real-world constraints — shelf life, supplier MOQs, lead time variability, storage and cold-chain capacity, working capital limits.
What problem does the forecast-and-optimize platform solve?
Hospital pharmacies faced significant challenges with frequent stockouts of critical medications and overstocking of slow-moving drugs, resulting in treatment delays, wastage, and capital lock-up. The platform needed to address four failure modes that no traditional pharmacy inventory system could close.
Key challenges
- Stockouts of critical medications delayed treatment — static reorder thresholds did not adapt to admission spikes, seasonal disease waves, or shifts in prescribing patterns.
- Slow-moving drugs accumulated and expired — slow-movers were ordered on the same periodic basis as fast-movers, reaching expiry while still in stock and tying up working capital.
- Reorder decisions ignored multi-constraint reality — supplier MOQs, lead times, shelf life, storage capacity, cold-chain limits, and working capital ceilings could not be juggled by any spreadsheet.
- Pharmacy and procurement worked from different signals — without a single source for forecasts and reorder recommendations, the two functions built their own views and disagreed routinely.
How does the platform forecast and optimize?
AiSPRY built the Pharmaceutical Inventory Management Platform as a six-layer forecast-and-optimize architecture. Six families of demand and supply signals are ingested into AWS, harmonised through a Python feature pipeline, and passed through an ensemble of three complementary forecasting models. The ensemble's output is combined with weights tuned per SKU and per horizon, and the resulting demand forecasts are handed to a Genetic Algorithm optimizer that solves the multi-constraint reorder problem.
Demand signals and feature engineering
- Historical consumption — by SKU, ward, and period — the foundation of every forecast
- Patient admissions — volume, acuity mix, and length-of-stay that drive medication demand
- Seasonal disease trends — flu, dengue, respiratory, and vector-borne cycles relevant to the catchment
- Prescription patterns and supplier lead times — by department and protocol, with supplier reliability for safe reorder timing
- Drug master data — shelf life, unit cost, storage requirements, and cold-chain needs feed the optimization constraints
Three forecasting models, blended by SKU and horizon
- ARIMA — short-horizon trend and momentum on per-SKU demand series; fast to retrain and the interpretable baseline
- Random Forest — non-linear interactions between admissions, disease trends, and prescribing protocols; feature-importance for explanations
- Prophet — seasonality and event-driven demand waves like flu and dengue seasons
- Ensemble combiner — weights tuned per SKU and per horizon through backtesting, with calibrated confidence intervals
Genetic Algorithm reorder optimization
- Multi-objective optimization — minimise inventory carrying cost and minimise stockout risk simultaneously
- Constraint-respecting — shelf life, supplier MOQ, lead time variability, storage and cold-chain capacity
- Confidence-aware weighting — stockout-aversion weighted higher for critical medications, cost-minimisation higher for non-critical SKUs
- Operational consumption — auto-reorder recommendations, stockout risk alerts, slow-mover action lists, cost/ROI dashboards, ERP/HIS integration
See the pharmacy platform in action
A walkthrough of the platform — ingesting demand signals from admissions and disease trends, running the ARIMA + Random Forest + Prophet ensemble, and converting forecasts into Genetic Algorithm reorder plans that respect shelf life, MOQ, and storage constraints.
Pharmaceutical Inventory Management — forecast-and-optimize in action
Click to play · Three-model ensemble plus Genetic Algorithm reorder planning
- Ensemble forecasts — ARIMA + Random Forest + Prophet weighted per SKU and horizon
- GA reorder plans — multi-objective optimization respecting shelf life, MOQ, lead time, and storage
- Stockout risk alerts — calibrated warning windows on critical medications
- ERP/HIS integration — approved orders flow through to procurement without manual re-entry
What is the architecture of the forecast-and-optimize platform?
The architecture is organised as six layers: hospital pharmacy data sources, the AWS data pipeline and feature engineering, the three-family forecasting ensemble, the ensemble combiner, the Genetic Algorithm optimization layer that converts forecasts into reorder plans, and the pharmacy operations consumption layer with ERP and HIS integration. Raw signals never reach forecasting models without harmonisation; models never see future data during training; the optimizer is the only layer that converts forecasts into actual order decisions; and downstream consumption reads the GA's output rather than touching individual forecasts directly.

How is the platform engineered for pharmacy reality?
The platform's design choices reflect the operational constraints of hospital pharmacy inventory — shelf life, supplier MOQs, lead time variability, storage capacity, and the genuinely different demands of forecasting and ordering.
Forecasting and optimization as separate cooperating layers
- Forecasting (what demand will be) and optimization (what to order under constraints) have different inputs and validation methods
- Treating them separately is what allows 90% forecast accuracy and a defensible cost reduction simultaneously
- Most off-the-shelf inventory tools collapse them into a single rule-based formula and lose both
Three complementary models because no single one is best
- ARIMA wins on short-horizon trend and interpretability
- Random Forest wins on multi-feature non-linear interactions
- Prophet wins on seasonality and event-driven demand
- The ensemble combiner is the only place where outputs are blended — keeping the system auditable rather than a black box
Confidence intervals propagate into the optimizer
- Every forecast carries a calibrated confidence interval from backtesting
- The Genetic Algorithm weights stockout-aversion higher for critical medications and cost-minimisation higher for non-critical SKUs
- Buffers grow where they matter and shrink everywhere else — 80% stockout reduction with 25% lower inventory cost
What measurable results did the platform deliver?
The platform was evaluated against the operational pain points it was built to address — stockout frequency on critical medications, working capital tied up in inventory, expiry write-offs from slow-movers, and the overall economic return.
Forecasting and inventory outcomes
- 90% forecast accuracy across blended horizons and SKUs
- 25% reduction in inventory carrying cost from compressed buffers on slow-movers
- Reduced expiry write-offs as inventory matches actual forecast demand
Stockouts and patient outcomes
- 80% reduction in stockouts of critical medications
- Routine substitutions and emergency procurement runs materially decreased
- Care delivery without medication-driven treatment delay improved measurably
Economic and organisational impact
- 300% return on investment on the platform deployment
- Pharmacy and procurement now operate from one plan rather than competing views
- Storage and cold-chain capacity reclaimed for items that actually turn over
Pharmaceutical Inventory — frequently asked questions
The questions most often asked about the Pharmaceutical Inventory Management Platform. Each answer is self-contained, so it can be quoted, cited, or surfaced as a standalone response.