Back to all posts

How Health Facilities Can Use Routine Data to Predict Stockouts Before They Happen

A practical deep dive into leveraging HMIS data and time-series models like ARIMA and Prophet to forecast medicine and supply stockouts in health systems.

How Health Facilities Can Use Routine Data to Predict Stockouts Before They Happen

In many low- and middle-income countries, running out of essential medicines is not a rare crisis—it’s a chronic one. Stockouts of vaccines, antibiotics, or maternal health supplies not only disrupt services but also erode public trust in the health system.

Yet, most stockouts are predictable. With the right data and simple forecasting models, we can catch the warning signs weeks—or even months—in advance.

This post explores how health facilities and district managers can use routine Health Management Information System (HMIS) data to forecast stockouts using time-series modeling techniques like ARIMA and Prophet.


Why Predict Stockouts?

Preventing stockouts is more than an operational goal—it's a health outcome intervention.

A facility running out of Oxytocin during childbirth emergencies could face avoidable maternal deaths. A stockout of antiretrovirals can disrupt HIV treatment continuity. These failures aren’t just logistical—they’re life-threatening.

And yet, most countries already collect the data needed to prevent this.


The Data You Already Have

Most HMIS platforms (like DHIS2 or custom EMRs) track monthly or weekly data on:

  • Dispensed quantities per commodity
  • Stock-on-hand at month-end
  • Lead time (time between order and delivery)
  • Consumption trends (per patient or visit type)

You don’t need sensors, AI, or even daily granularity. You just need a consistent time series of consumption or stock data.


Meet Your Forecasting Friends: ARIMA and Prophet

Two proven time-series models work well in low-data, real-world settings:

1. ARIMA (Auto-Regressive Integrated Moving Average)

  • Best when your data shows seasonality or long-term trends.
  • Can be tuned to account for past usage patterns and autocorrelation.
  • Requires some statistical skill but is highly customizable.

2. Facebook Prophet

  • Built to be easy and robust—even with missing values and outliers.
  • Accepts simple input (date + stock/consumption value).
  • Automatically handles seasonality, holidays, and change-points.

A Simple Use Case: Forecasting Amoxicillin Demand

Let’s say a district hospital dispenses amoxicillin to outpatients every month. You have 24 months of historical data. You can:

  1. Clean the data (remove outliers or reporting errors).
  2. Fit a Prophet model to forecast demand 3 months into the future.
  3. Compare that prediction to current stock-on-hand + average lead time.
  4. If projected demand exceeds available supply, trigger an alert.

Result? The pharmacy manager knows to place an order before a stockout happens.


Integrating into Health Systems

This doesn’t have to be a PhD project. A simple dashboard could display:

  • Predicted vs. actual stock levels
  • Buffer thresholds (e.g., <4 weeks of supply)
  • Commodity-specific alerts
  • Visual trends over time

Some countries are already piloting this. In Kenya and Zambia, partners have used machine learning to predict antimalarial stockouts with high accuracy. Rwanda has explored time-series forecasting for family planning commodities.


Challenges to Consider

  • Data Gaps: Many facilities have inconsistent reporting.
  • Lead Time Uncertainty: Logistics delays can throw off forecasts.
  • Trust in Models: Facility staff may resist replacing manual reorder points.
  • Lack of Feedback Loops: Predictions should be linked to actual procurement workflows.

Final Thoughts

Health systems don’t need cutting-edge AI to solve stockouts—they need timely action, informed by the data they already collect.

By embedding even basic forecasting into existing workflows, we can move from reactive panic to proactive planning. In a world where delays cost lives, forecasting isn't a luxury—it's a necessity.

Want to try it? Start with your top 5 essential medicines. Get the last 12 months of consumption data. Fit a Prophet model. Watch what happens next.

The stockout might already be written in your data—you just haven’t read it yet.

Comments

Sign in to join the discussion

No comments yet. Be the first to comment!