-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathefi_acts21poster.Rmd
289 lines (241 loc) · 12.6 KB
/
efi_acts21poster.Rmd
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
---
title: "A Learning Health Systems approach using health record data to construct patient frailty scores and predict safety events"
author: 'Alex Bokov ^1,✉^, Kathleen R. Stevens ^1^, Chandana Tripathy ^1^ , and Sara Espinoza ^1^'
css: "production.css"
abstract: 'We have found that the electronic frailty index (EFI), a risk
score developed using the Rockwood deficit-accumulation framework, is
a strong predictor of patient safety events without relying on any variables
other than diagnoses, vital signs, and laboratory results from the electronic
health record.'
documentclass: article
description: 'Poster'
clean: false
bibliography: efi_paper.bib
csl: vancouver-superscript.csl
output:
bookdown::word_document2:
reference_docx: efi_template.docx
fig_caption: true
self_contained: true
keep_md: true
number_sections: false
bookdown::html_document2:
fig_caption: true
self_contained: true
number_sections: false
keep_md: true
clean: false
---
```{r setup, echo=FALSE, message=FALSE, warning=FALSE,results='hide'}
.projpackages <- c('GGally','pander','dplyr','ggplot2','data.table'
,'survival','broom','forcats','table1','english','bookdown');
.deps <- c( 'analysis.R' );
.debug <- 0;
message(paste0('\n\n working dir: ',getwd(),'\n\n'))
cat('\n\nAvailable Files:',list.files(),sep='\n','\n')
.junk<-capture.output(source(file.path('./scripts/global.R'),chdir=TRUE,echo=!1
,local=TRUE));
# Set some formatting options for this document
panderOptions('table.alignment.default','right');
panderOptions('table.alignment.rownames','right');
panderOptions('table.split.table',Inf);
panderOptions('p.wrap','');
panderOptions('p.copula',', and ');
panderOptions('graph.fontfamily','serif');
# theme_get() gives default theme
theme_set(theme_bw(base_family = 'serif',base_size=14) +
theme(strip.background = element_rect(fill=NA,color=NA)
,strip.text = element_text(size=15), plot.title = element_text(size=30)));
knitr::opts_chunk$set(echo=.debug>0, warning=.debug>0, message=.debug>0);
# detect current output format
.outfmt <- knitr::opts_knit$get('rmarkdown.pandoc.to');
message('.outfmt = ',.outfmt);
if(is.null(.outfmt)){
.outfmt <- if(knitr::is_html_output()) 'html' else {
if(knitr::is_latex_output()) 'latex' else {
if(interactive()) 'html' else {
'unknown';
}}}};
message('.outfmt = ',.outfmt);
.currentscript <- current_scriptname('efi_patientsafety.Rmd');
.outcomenames <- c('vi_c_hospinfect','vi_c_hosptrauma'
,'vi_c_cardiac','vi_c_psi');
#dct0$dispname <- sub(' (specialty)','',dct0$dispname,fixed=TRUE);
#dct0$dispname_short <- sub(' (specialty)','',dct0$dispname_short,fixed=TRUE);
snip_outcomes <- rname(.outcomenames);
# limit the data to items of interest
tb2 <- subset(tb2,outcome %in% .outcomenames & predictor %in%
c('Frailty, age:65+')) %>%
mutate(Outcome = rnameshort(outcome)
, `P, adjusted` = format.pval(`P, adjusted`,digits=3
,eps=0.0001,scientific=FALSE) %>%
sub('<','< ',.,fixed=TRUE));
tb3 <- subset(tb3,Predictor %in% c('Frailty, age:65+') &
Outcome %in% .outcomenames);
dat04 <- subset(dat04,patient_num %in%
subset(dat03,a_agegrp=='65+')$patient_num);
fits <- lapply(fits[.outcomenames],function(xx) {
xx$dispname <- sub(' (specialty)','',xx$dispname,fixed=TRUE);
xx$multiplot <- xx$multiplot[c('65+')];
xx$multidata <- xx$multidata[c('65+')];
xx});
# snippets ----
snip_resultsfold <- tolower(unique(resultsfold00(tb2))) %>%
submulti(rbind(c('cardiac','cardiac complications'),c('any psi','all PSI')));
snip_dat <- with(subset(dat03,a_agegrp=='65+')
,c(pat=length(unique(patient_num))
,vis=length(patient_num))) %>% format(big.mark=',');
```
# Background
Frailty is the lifelong erosion of stress resistance and accumulation of
impairments across multiple physiological systems and is predictive of poor
patient outcomes [@hoover13;@fried01a; @pajewski19; @rockwood06] not limited to
a single illness or clinical specialty. There is no gold standard method to
assess frailty in clinical practice. Currently available frailty assessment
tools used in geriatric practice have good validity but require patient surveys
or assessments [@fried01a] and would be prohibitive to implement at scale.
Others, such as HCC/RAF are complex and dependent on changing external
information such as national and regional utilization trends.
In a 2013 report, the Institute of Medicine highlighted the use of routine data
from service delivery (e.g., electronic health records) to generate knowledge to
continuously improve healthcare. “The committee believes that achieving a
learning health care system—one in which science and informatics,
patient-clinician partnerships, incentives, and culture are aligned to
promote and enable continuous and real-time improvement in both the
effectiveness and efficiency of care—is both necessary and possible for the
nation.” [@smith13a] Leveraging clinical data and harnessing its potential to
generate knowledge rapidly to inform decisions can have transformative effects
on complex systems that provide services. The Learning Health System (LHS) is a
widely held vision for realizing this transformation. An LHS uses routine data
from service delivery and patient care to generate knowledge to continuously
improve healthcare [@friedman14] .
In this spirit, we used real-world EHR data to develop an electronic frailty
index (EFI) based on the Rockwood index [@mitnitski01a] . We improve on previous
approaches by mapping laboratory tests to specific LOINC codes and value-flags,
relying only data elements which are expected to be widely available in diverse
EHR systems, and publicly releasing our source code under an open source
license. EFI is more immediate than claims data and more directly transferable
to clinical use than risk scores based on curated registries making it a very
promising risk metric for providers in a busy practice with minimal time and
cost.
# Study Objective
To generate and validate an electronic Frailty Index (EFI) from real-world EHR
data using the Rockwood deficit-accumulation framework in predicting patient
safety events.
# Methods
To assure that the research approach reflected perspectives of multiple
stakeholders, our multidisciplinary investigative group included an
implementation scientist/nurse, a geriatrician, an internist, and an
informatician, all affiliated with an academic health center.
Using routinely collected EHR data, we developed an electronic frailty index
(EFI) and predicted safety events in patients. We accessed EHR data from our
academic health center for `r snip_dat['vis']` visits by `r snip_dat['pat']`
patients 65 years and older randomly sampled from the deidentified data
warehouse underlying our ACT/SHRINE node. The baseline characteristics of the
cohort are shown in Table \@ref(tab:table1). The per-visit EFI (electronic
frailty index) scores were calculated using ICD10 codes and flags for abnormal
lab values in a rolling 2-year time window. EFI was then used as the predictor
variable. Our mapping tables and sample SQL code are available for public use
and discussion [@bokov20] .
The primary outcomes were: preventable patient-safety events hospital-acquired
infections, non-operative hospital-acquired trauma, cardiac complications, and
patient safety events (PSI). PSI included: hospital infections, hospital trauma,
cardiac complications, pressure ulcers, endocrine/metabolic complications, VTEs,
respiratory complications, hemorrhage, drug reactions, fluid management events,
post-surgical complications, anaesthesia complications, delerium, and CNS
complications. These were identified from ICd10 codes using the definitions
developed by Southern et al. @southern17 Cox proportional hazard models were used to estimate
risk for each outcome with time until first occurrence as the response variable,
censored on death or event-free completion of followup period.
***
```{r table1header}
pander(rbind(c('.','','','','','','',''))
,caption='(\\#tab:table1) Cohort demographics\n\n');
```
```{r table1,results='asis'}
if(.outfmt == 'html'){
.tb1formula <- c('sex_cd','race_cd','BLANK0',.outcomenames
,'Patient age (years)','Frailty','Number of Visits') %>%
paste0('`',.,'`',collapse='+') %>% paste('~',.,'|`Frailty Stage`') %>%
formula;
tb1 <- table1(.tb1formula,data=dat04,render.categorical=table1cat00) %>%
rname(method='partial') %>% gsub('BLANK.','</br>',.) %>%
gsub('Patient age','<br/>Patient age',.);
print(tb1);
};
```
# Results
We found a strong and significant association of EFI with hospital-acquired
infections, non-operative hospital acquired trauma, cardiac complications, PSIs
in general without relying on any data other than diagnoses, vital signs, and
laboratory results from the EHR.
Even after adjusting for for multiple comparisons (`r as.english(nrow(tb2)) %>%
as.character` outcomes reported on the same data) using the Holm correction
@holm79 , EFI is statistically significant for each of the responses.
Furthermore, the effect is practically significant: for each 0.1 increase in EFI
there is nearly a doubling of risk-- `r pander(snip_resultsfold)`. Table
\@ref(tab:tb2) shows the results of Cox proportional hazard models for each of
the responses, with EFI as the predictor.
For each of the outcomes EFI models have a high concordance (Harrel's c-index),
in the same range as would have been obtained using patient age as a predictor
(Table \@ref(tab:tb3) ). In figures 1-4 we show Kaplan-Meier plots for each of
the outcomes stratified by whether EFI is greater than 0.19 (Frail=TRUE) or less
(Frail=FALSE), the cut-point established by Stow et al.
@stow18
```{r tb2}
tb2[,c('predictor','Outcome','β^ (95% CI)','fold-change (95% CI)','SE','Z','P, adjusted','# Events','# Visits')] %>%
pander(digits=3, row.names=FALSE,caption='(\\#tab:tb2) Cox-proportional hazards with EFI as a predictor');
```
```{r tb3}
tb3 %>% mutate(Outcome = rnameshort(Outcome)) %>%
pander(caption='(\\#tab:tb3) Performance of EFI models');
```
::: {.MultiFigure custom-style="MultiFigure"}
```{r kmplots, fig.show="hold", fig.height=4.75, fig.width=10.45,fig.cap=" - "}
# . kmplots ----
.subfig <- 0;
for(jj in fits) {.subfig <- .subfig + 1;
with(jj,{
message(dispname);
print(ggmatrix(multiplot,nrow=1,ncol=length(multiplot)
,legend=grab_legend(plot)
,title=gsub(' (specialty)','',dispname,fixed=TRUE)
#,xAxisLabels = names(multidata)
,xlab=plot$label$x
,ylab=plot$label$y) +
labs(caption=paste0('Figure ',.subfig,'. \n')));
cat('\n\n\n');
# pander(modelsummary);
# cat("\n******\n");
})};
```
:::
# Conclusions
The learning health systems approach was successful in generating an electronic
Frailty Index from real-world EHR data and generated knowledge for care from
service delivery and patient data. The EFI was validated through its association
with clinically relevant patient safety outcomes.
Direct engagement of clinical experts and academic scientists guided meaningful,
relevant outcomes for care planning. Authentic partnership across the
investigative team provided a way to ensure the rigor, relevance, and ease of
adoption of the EFI into routine care.
This EFI can be replicated by other US learning health systems with minimal
time and cost. We improve on previous approaches by mapping laboratory tests to
specific LOINC codes and value-flags, relying only data elements which are
expected to be widely available in diverse EHR systems. To facilitate adoption
and refinement of EFI we published our code mappings and scripts with notes on
adapting them to local environments at https://github.com/bokov/FreeFI .
Frailty assessment offers tangible benefits that include (1) supporting
clinicians in making clinical decisions and (2) allowing leadership to better
forecast health system resource utilization. Being able to harness EHR data for
visit-level calculation of frailty can be transformative for primary and
specialist care.
Our future work will further characterize the association of EFI with patient
and health system outcomes as well as bridge gaps between clinical data and
improved care inx learning health systems through data analytics and informatics.
# Acknowledgments
This work was supported by NIH/NCATS UL1TR001120 and UL1TR002645 (AFB,
KRS), the Long School of Medicine KL2 Award (AFB), the Claude D. Pepper Older
Americans Independence Center P30 AG044271 (SER), Berneice Castella
Distinguished Professorship in Aging Research in Nursing (KRS)
# References