Skip to content

Calculating Notional Funding from Activity Data

This content is for 2025. Switch to the latest version for up-to-date documentation.

This tutorial walks through the calculation of notional equivalent funding (NEP) from admitted patient activity data using the nwau_py package. The result represents what a jurisdiction would have been paid under a given pricing year’s national efficient price (NEP).

  • Python 3.10+
  • nwau_py >= 0.6.0 installed
  • Basic familiarity with activity-based funding (ABF) concepts
import pandas as pd
import numpy as np
from nwau_py.calculators import calculate_acute, AcuteParams
from nwau_py.pricing_constants import get_nep
np.random.seed(42)
n = 20
activity = pd.DataFrame({
"DRG": np.random.choice(["E62A", "E62B", "F62A", "F62B", "G02A"], size=n),
"LOS": np.random.randint(1, 15, size=n),
"ICU_HOURS": np.random.choice([0, 0, 0, 0, 2, 4, 8], size=n),
"ICU_OTHER": 0,
"PAT_SAMEDAY_FLAG": np.random.choice([0, 1], size=n, p=[0.8, 0.2]),
"PAT_PRIVATE_FLAG": np.random.choice([0, 1], size=n, p=[0.85, 0.15]),
})

The synthetic DataFrame contains episode-level DRG codes, length of stay, ICU hours, and patient demographic flags — the columns the acute calculator expects.

result = calculate_acute(activity, AcuteParams())
nep = get_nep("2025")
result["NotionalFunding"] = (result["NWAU25"] * nep).round(2)
result[["DRG", "LOS", "NWAU25", "NotionalFunding"]].head()

The calculate_acute function assigns an NWAU value per episode based on DRG and length of stay. Multiplying each episode’s NWAU by the national efficient price gives the notional equivalent funding.

notional_funding = pd.DataFrame({
"Episodes": len(result),
"Total NWAU": result["NWAU25"].sum().round(4),
"Mean NWAU": result["NWAU25"].mean().round(4),
"Total Notional Funding": result["NotionalFunding"].sum().round(2),
"Mean Notional Funding": result["NotionalFunding"].mean().round(2),
}, index=["Acute"])
notional_funding

This shows the aggregate NWAU and notional funding for the synthetic acute cohort.

notional_funding.to_csv("notional_funding_summary.csv")