-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
171 lines (132 loc) · 5.51 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
title: "The New Hospital Programme demand model"
subtitle: "A Tool for Forecasting Hospital Activity"
title-block-banner: true
output: html_document
execute:
echo: false
message: false
warning: false
---
## What is it for?
The New Hospital Programme (NHP) aims to transform healthcare, by building hospitals that meet the evolving needs of patients and communities across the country. To help plan for the future, [The Strategy Unit](https://www.strategyunitwm.nhs.uk/) developed a tool to predict how many people might use these hospitals and how long they’ll need care.
## What does it do?
The model estimates:
- How many patients will visit hospital
- How many patients will stay overnight, and how long they need a bed
- How many people will attend A&E
It looks at all types of hospital visits, like surgeries, check-ups, and emergencies, and breaks it down by things like age, sex, and treatment.
```{r multiple}
value_boxes <- list(
bslib::value_box(
title = "NHS trusts using the model",
value = "27+",
showcase = bsicons::bs_icon("hospital"),
theme = "primary"
),
bslib::value_box(
title = "Looking ahead",
value = "2041/42",
showcase = bsicons::bs_icon("graph-up"),
theme = "primary"
),
bslib::value_box(
title = "Customisation options",
value = "90+ ",
showcase = bsicons::bs_icon("gear"),
theme = "primary"
),
bslib::value_box(
title = "Rows of real hospital data",
value = "140 million",
showcase = bsicons::bs_icon("journal-medical"),
theme = "primary"
)
)
bslib::layout_column_wrap(
width = "150px",
!!!value_boxes[1:2]
)
```
## What factors does it consider?
There are many elements that can change how much people need hospitals in the future. The main four main components that the model considers are demographic growth, non-demographic growth, unmet needs and mitigation.
```{mermaid}
flowchart TD
B(Demographic <br>growth) --> A(NHP demand model)
C(Non-demographic <br>growth) --> A
D(Unmet <br>needs) --> A
E(Mitigation) --> A
```
### Demographic growth
As the population grows and ages, healthcare demand will change. We use ONS population projections and health trends to model how these factors will evolve over time.
### Non-demographic growth
This refers to changes in healthcare demand not related to population size, age, or gender, such as:
- Advances in medical technology
- Changes in clinical standards
- Rising patient expectations
Experts have analysed previous trends to predict how this growth will affect the future.
### Unmet needs
Not all healthcare needs are currently met due to long waits, travel distances, or use of private care. We adjust for this gap to better predict future requirements.
### Mitigation
Hospitals use strategies to reduce the need for care, such as preventing falls in older people or shortening hospital stays. These strategies include:
- Moving care from hospitals to community settings
- Preventing health problems early with public health initiatives
- Shortening hospital stays with less invasive procedures and better healthcare
NHS trusts tell us which of these strategies they intend to implement, and estimate how much they might reduce future activity. They provide these as a _range_, rather than a single number, for example a reduction of between 10% and 30% of treatments related to smoking.
```{r}
bslib::layout_column_wrap(
width = "150px",
!!!value_boxes[3:4]
)
```
## Many possible futures
The future is uncertain. We run our model hundreds of times to generate a range of possible futures, based on the data trusts provide.
```{r, eval=TRUE}
library(ggplot2)
# Parameters
n_rep <- 10
baseline <- 500
targets <- 500 + rnorm(n = n_rep, mean = 120, sd = 50)
targets <- c(targets, mean(targets))
steps <- 22
n_runs <- length(targets)
random_walk <- function(start, end, steps) {
increments <- (end - start) / steps + rnorm(steps, mean = 0, sd = abs(end - start) / (2 * steps))
cumsum(c(start, increments))
}
# Generate data for all runs
set.seed(42)
random_walks <- tibble::tibble(
run = seq_along(targets),
target = targets
) |>
dplyr::mutate(
data = purrr::map(target, \(x) tibble::tibble(
step = 0:steps,
value = random_walk(baseline, x, steps)
))
) |>
tidyr::unnest(data)
random_walks |>
dplyr::mutate(step = step + 2019) |>
ggplot(aes(x = step, y = value)) +
geom_line(aes(group = run), colour = "#005EB8", linewidth = 1.8) +
gghighlight::gghighlight(run == n_runs, use_direct_label = FALSE) +
labs(title = "Our model provides hundreds of possible futures and the <span style=\'color:#005EB8'>**average forecast**</span>.") +
theme_minimal(base_size = 12) +
theme(axis.title = element_blank(),
axis.text.y = element_blank(),
legend.position = "none",
plot.title= ggtext::element_markdown(),
panel.grid = element_blank(),
panel.border = element_blank())
```
## Transparent and open
We believe that knowledge and tools developed within the NHS should be made available to the wider health and care system. This is why the code underpinning the model, quality assurance and supporting documentation is open source.
::: {.callout-note}
## Learn more
Explore additional resources:
- `r bsicons::bs_icon("youtube")` Watch a [video](https://www.youtube.com/watch?v=vXBxDOa6tfw)
- `r bsicons::bs_icon("book")` Explore the [documentation](https://connect.strategyunitwm.nhs.uk/nhp/project_information)
- `r bsicons::bs_icon("chat-dots")` [Talk](mailto:[email protected]) to us
:::