Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Average length of stay calculation and bed-day costing function

L_bar = f(BD, N); D = g(B, o, L_bar); T = h(Q_1, Q_3); R_h = O_h / E_h; C = k(L_bar, c)

Maps the bed-days and discharges of a period to the average length of stay (ALOS), and relates length of stay to bed capacity, payment trim points, a case-mix adjusted comparison and the cost of an admission or of a change in stay. The records follow the notation of the Average Length of Stay article, where L_bar is the average stay in days and N the number of discharges.

  • Average length of stay from bed-days and discharges

    L_bar = BD / N

    Divides the bed-days of the stays that ended in a period by the number of those discharges. BD is the sum of the individual stays L_i, each the discharge date minus the admission date, so the result equals the patient-level mean in the article. Deaths in hospital count as discharges in the OECD definition.

  • Annual discharges from beds, occupancy and average length of stay

    D = 365 * B * o / L_bar

    States the steady-state accounting identity linking capacity to stay length: a year's occupied bed-days, 365 times beds times occupancy, divided by the average stay gives the discharges those beds can support. Halving L_bar doubles potential throughput. Dividing D by B gives the bed turnover rate.

  • NHS Payment Scheme length of stay trim point and excess bed days

    T = max(5, Q_3 + 1.5 * (Q_3 - Q_1)); X = max(0, L_a - T)

    Sets the length of stay trim point for a spell healthcare resource group (HRG) at the larger of 5 days and the upper quartile plus 1.5 times the interquartile range of adjusted length of stay, rounded to the nearest whole number. Days of a spell beyond the trim point are excess bed days, paid at a separate daily long-stay rate. The calculator omits the rounding step.

  • Case-mix adjusted length of stay ratio by indirect standardisation

    E_h = sum_(g=1)^G [n_hg * L_ref_g]; R_h = O_h / E_h

    Computes the bed-days a hospital would use if each of its case-mix groups stayed as long as a reference average, and divides its observed bed-days by that figure. A ratio above 1 means longer stays than expected for its case mix. The relative stay index in Australia's Report on Government Services is of this form.

  • Cost change from a shorter average length of stay

    Delta_C = n * (L_0 - L_1) * c

    Values the bed-days released when the average stay of a patient group falls, at a stated cost per bed day. The answer depends on which cost is used: an average cost gives the apparent saving, a marginal cost the cash saving.