Consumption-based forecasting over facility LMIS data — predicting essential-medicine stockouts before shelves go empty
Predictive stockout systems are only as good as the consumption data feeding them. Across low- and middle-income countries, Logistics Management Information Systems (LMIS) such as OpenLMIS and reporting platforms built on DHIS2 aggregate facility-level dispensing records — units issued per drug, per day, per site — into a national data warehouse that a forecasting layer can consume.
Consumption data enters the pipeline through several channels of varying fidelity:
• Electronic point-of-dispensing logs: pharmacy software records each unit dispensed against a patient encounter, timestamped and SKU-coded — highest fidelity, but only available at larger facilities • SMS-based stock reporting: field workers text weekly stock-on-hand counts to a central shortcode (Tanzania's ILSGateway pioneered this model); parsed into structured records • Paper stockcards digitized monthly: district data clerks transcribe bin-card counts into DHIS2 aggregate reports — introduces lag of 2–6 weeks and transcription error • OpenLMIS requisition cycles: facilities submit Report and Requisition (R&R) forms on a fixed cycle (monthly or bi-monthly), capturing beginning balance, quantity received, quantity dispensed, losses/adjustments, and closing balance
Data quality challenges dominate this stage: incomplete reporting (a facility that reports zero consumption may be stocked out, not demand-free — the two look identical in raw data), inconsistent SKU coding across facilities, and negative or implausible balances from stockcard transcription errors. Cleaning pipelines apply plausibility bounds (e.g., dispensed quantity cannot exceed opening balance + receipts) and flag facilities with reporting gaps for imputation rather than blind interpolation.
Reported consumption in a stocked-out facility silently collapses to zero — not because demand vanished, but because nothing was on the shelf to dispense. Naively feeding this into a forecast model teaches it that demand is falling, compounding the stockout in the next cycle.
Corrective methods: • Stockout-adjusted consumption: days-of-stockout in a period are excluded from the denominator when computing average daily consumption, rather than counted as zero-demand days • Ceiling-consumption imputation: for months with partial stockouts, consumption is scaled up proportional to days of availability • Cross-facility borrowing: sparse-data facilities borrow seasonal shape from demographically similar facilities in the same catchment tier
This adjustment step, unglamorous as it is, is typically the single highest-leverage intervention in supply chain forecasting accuracy studies — correcting it alone has been shown to cut forecast error by a third in USAID Global Health Supply Chain program evaluations.
Once cleaned, consumption histories feed classical time-series forecasting: weighted moving averages for short-horizon stability, layered with seasonal decomposition to capture predictable surges — malaria season antimalarial demand, EPI campaign vaccine draws, back-to-school deworming pushes.
The workhorse forecast for most LMIC supply chains is deliberately simple, because field teams must be able to audit and trust it:
Forecast_t = WMA(consumption, last N periods) × SeasonalIndex_month(t)
• Weighted moving average: recent months weighted higher than older ones (e.g., weights 0.5/0.3/0.2 for months t-1/t-2/t-3), smoothing noise while tracking real trend shifts • Seasonal index: computed as the ratio of each calendar month's historical average consumption to the annual average, applied multiplicatively to the base forecast — captures the ~40–60% consumption spike in antimalarials during rainy season in many East African contexts • Trend adjustment: linear regression slope over the last 6–12 periods nudges the base forecast up or down for structural growth (population growth, new patients on ART, expanding formulary)
More sophisticated deployments layer in Holt-Winters exponential smoothing or ARIMA where data history is long and clean enough (typically >18 months of consistent reporting), but the marginal accuracy gain over a well-tuned seasonal moving average is often small relative to the accuracy lost to underlying data-quality gaps — so most national systems (OpenLMIS forecasting module, Zambia SmartCare analytics) default to the simpler, more auditable method.
Forecast accuracy is tracked with Mean Absolute Percentage Error (MAPE) computed on a rolling backtest: the model is trained on data through month t, used to forecast month t+1, and scored against what actually happened.
Typical benchmarks: • Naive forecast (repeat last month): MAPE 25–40% • Simple moving average, no seasonality: MAPE 18–25% • Weighted MA + seasonal decomposition: MAPE 8–15% • Machine-learning ensemble (gradient boosting on facility covariates): MAPE 6–12%, but requires data science capacity most district health offices don't have in-house
The accuracy ceiling is set less by model sophistication than by data completeness — a facility reporting only 60% of expected periods caps achievable MAPE regardless of algorithm, which is why data-quality investment (Stage 1) and forecasting sophistication (Stage 2) are treated as a joint optimization, not sequential upgrades.
A forecast alone does not trigger action — it must be compared against a threshold that accounts for how long resupply actually takes. The reorder point (ROP) marries forecasted demand with lead-time variability, translating a probabilistic forecast into a single operational trip-wire: order now, or stock out.
Reorder Point (ROP) = Lead-Time Demand + Safety Stock
• Lead-Time Demand (LTD) = average daily consumption × lead time in days — the amount that will be consumed while a resupply order is in transit • Safety Stock (SS) = z × σ_LTD, where σ_LTD is the standard deviation of demand during lead time and z is the service-level factor (z=1.65 targets 95% probability of not stocking out before resupply arrives; z=2.33 targets 99%) • Max stock level (M) = ROP + Economic Order Quantity, defining the ceiling a min-max system orders up to
When forecasted stock-on-hand is projected to cross ROP before the next scheduled delivery, the system flags the facility — this is the geometric essence of the "trend line crossing the threshold before the depletion curve hits zero" that the simulation canvas visualizes: the early warning fires at the ROP crossing, not at the empty-shelf crossing, buying the lead-time window back for corrective action.
Lead time itself is decomposed and monitored: order-processing time at the district store, transport time (worse in rainy season on unpaved roads), and receiving/put-away time at the facility. Programs like Tanzania's ILSGateway track actual delivery lead times via SMS confirmation, feeding real observed lead times back into the ROP calculation rather than relying on a static assumption.
Setting z too high (over-cautious) generates alert fatigue: managers who dispatch emergency resupply for every minor blip stop trusting the system and start ignoring it, undermining the entire early-warning value proposition.
Setting z too low under-protects against demand variability spikes — outbreak-driven demand surges (a cholera or measles outbreak doubling antibiotic or vaccine consumption overnight) will blow through a thin safety margin before the next scheduled review.
Operational calibration typically differentiates SKUs by criticality: vaccines and antiretrovirals — where a stockout has severe clinical consequences and low substitutability — are calibrated to z=2.33 (99% service level); lower-criticality items with therapeutic substitutes are calibrated to z=1.28 (90%) to conserve working capital and warehouse space.
Zambia's SmartCare-integrated supply chain analytics and Tanzania's ILSGateway both demonstrated that shifting from fixed periodic review to dynamically calibrated reorder points — without changing physical logistics capacity at all — was sufficient on its own to cut essential-medicine stockout days by roughly a third, purely by ordering earlier relative to actual depletion.
A correctly calibrated threshold is inert until it reaches a human who can act on it. Alert generation converts a silent database crossing into an SMS to a district pharmacist and a red row on a dashboard — the interface layer that determines whether predictive analytics actually changes what happens in the supply chain.
Alert delivery is engineered around the actual infrastructure district-level staff have, not the infrastructure a system designer wishes they had:
• SMS shortcode alerts: a two-way SMS gateway (the model popularized by Tanzania's ILSGateway, built on RapidSMS/RapidPro) sends a plain-text alert — facility name, drug, days-of-stock-remaining, recommended action — to the district pharmacist's basic phone, requiring no data connection • Web dashboard: OpenLMIS and DHIS2-based systems surface a facility map or table color-coded by risk tier (green/amber/red), letting a program manager triage across an entire district or province at a glance • Escalation logic: an unacknowledged alert re-fires after 48–72 hours and escalates to a regional supervisor, preventing a single missed SMS from silently expiring the warning
Alert content is deliberately terse and action-oriented — days-of-stock-remaining and a specific recommended order quantity, not a raw forecast chart — because the alert's job is to compress a statistical projection into a decision a busy district officer can execute in under a minute.
Field evaluations consistently find that alert volume, not alert accuracy, is the binding constraint on system adoption. A system that fires ten low-confidence alerts a week trains its recipients to ignore all of them, including the real ones.
Mitigations adopted by mature systems: • Tiered severity: only threshold crossings within the current lead-time window trigger an immediate SMS; earlier-horizon risk appears only on the dashboard as a watch-list entry • Confidence-weighted suppression: alerts are suppressed when the underlying consumption data itself is incomplete or highly volatile (the forecast confidence interval is too wide to act on) • Batching: multiple SKUs at risk in the same facility are bundled into one message rather than one SMS per drug, cutting message volume by 60–80% in multi-drug facilities without losing information
The action an alert exists to provoke is a resupply order that arrives before stock hits zero. This stage routes an emergency shipment outside the normal quarterly or bimonthly delivery cycle, drawing on buffer stock held at the district or regional depot specifically for this purpose.
Most national distribution systems run on a fixed periodic-review cycle — trucks follow pre-planned routes on a monthly or bimonthly schedule, which is efficient for routine resupply but far too slow for a facility whose forecast crosses the reorder point mid-cycle.
Emergency resupply mechanisms bypass this cadence: • District buffer stock release: district depots hold a reserved buffer (commonly 10–15% of total inventory) specifically to cover emergency requisitions between routine cycles • Lateral redistribution: stock is transferred from a nearby facility with surplus rather than from the central warehouse, cutting transit time dramatically — a same-district transfer can arrive in 1–2 days versus a week or more from a regional depot • Motorcycle courier / last-mile emergency transport: for time-critical, low-volume emergency orders, many programs (e.g., in Zambia, Malawi) contract motorcycle logistics specifically for last-mile emergency legs that trucks can't justify running off-schedule
Cold-chain items (vaccines, some biologics) constrain emergency routing options — an emergency resupply must still traverse a validated cold-chain path, which limits the courier options available compared to ambient-temperature essential medicines.
A resupply trigger is not complete until delivery is confirmed against the facility's updated stock-on-hand — an alert that generates an order but is never verified as delivered risks masking a second failure point (transport delay, delivery to the wrong site, partial fulfillment against the requested quantity).
Systems close this loop by requiring an SMS or dashboard confirmation of received quantity from the facility, which both closes the specific alert and feeds a new, corrected stock-on-hand figure back into the forecasting model — the same feedback loop that lets systems like ILSGateway calibrate real observed lead times rather than static assumptions, continuously tightening Stage 3's safety-stock calculation over time.
The ultimate metric for a predictive stockout system is not forecast accuracy in isolation but the tracer-drug stockout rate measured across the network over time — the percentage of facility-months in which a defined basket of essential medicines was unavailable at the point of care.
The standard indicator — used by WHO, USAID's Global Health Supply Chain program, and most national monitoring frameworks — is the percentage of facility-months in which a tracer drug from a defined basket (commonly 15–25 essential SKUs spanning malaria, maternal health, family planning, and childhood illness) was recorded as unavailable at the point of care on the day of a supervision visit or per continuous stockcard record.
Baseline rates in unmanaged LMIC supply chains commonly run 20–40% for at least one tracer item in a given facility-month — meaning a patient visiting essentially at random has a meaningful chance of encountering a stocked-out essential medicine. Predictive early-warning systems, layered onto existing distribution infrastructure without necessarily increasing total drug budget, have been documented to cut this rate by roughly a third to half in controlled pilot comparisons against non-intervention districts.
The reduction decomposes into three mechanisms operating together: earlier detection (Stage 3's reorder point fires before the naive depletion-to-zero signal would), faster human response (Stage 4's alert channel compresses detection-to-action time from weeks to days), and tighter emergency logistics (Stage 5's buffer stock and lateral transfer routes shorten the resupply lead time itself).
The approach has real limits: it cannot fix a supply chain with no buffer stock to draw on, no functioning transport network, or systemically inadequate national procurement — predictive analytics reallocates existing stock more intelligently in time and space, but cannot manufacture medicine that was never procured. Evaluations consistently find the largest gains in systems with moderate baseline dysfunction (some buffer capacity, imperfect but real distribution) and the smallest gains in the most severely under-resourced systems, where the binding constraint is total supply, not forecasting precision.