-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCedars_CRCs.qmd
999 lines (674 loc) · 27.3 KB
/
Cedars_CRCs.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
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
---
title: "Beyond the Symptoms"
subtitle: "Reducing Emergency Department Overutilization by Broadening Homelessness Services"
author: "Luke Morris"
institute: "Cedars-Sinai Medical Center"
format:
revealjs:
theme:
- moon
self-contained: true
logo: images/CSlogo3.png
from: markdown+emoji
editor: source
---
::: columns
::: {.column width="40%"}
### [AGENDA]{style="font-weight:500"}
:::
::: {.column width="60%"}
- Homelessness Figures
- The ED Care Model
- Problems at the Intersection
- A New Role
- Evidence of Effect
:::
:::
::: footer
This author has no conflicts of interest to disclose
:::
::: {.notes}
Here’s what’s on tap:
A quick look at homelessness figures
The Role Emergency Departments are designed to meet
How those don’t two things don’t always line up
A new role we created to tackle those issues
And how that’s going
:::
## [Homelessness by the Numbers]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="45%"}
- **United States** (\~pop. 331.5 million)
- 580,466 People Experiencing Homelessness (PEH)
- 0.175% of U.S. population
- **California** (\~pop. 40 million)
- 161,548 PEH
- 0.408% of state population
- California makes up 11.9% of U.S. pop, but hosts 28% of all PEH in U.S.
:::
::: {.column width="55%"}

:::
:::
::: footer
Figures via [2020 Census](https://www.census.gov/programs-surveys/decennial-census/decade/2020/2020-census-results.html) and [HUD 2020 Annual Homelessness Assessment Report](https://www.huduser.gov/portal/sites/default/files/pdf/2020-AHAR-Part-1.pdf)
:::
::: {.notes}
I won’t drag you through all of these figures, but here are the highlights:
About 0.2% of the U.S. population was experiencing homelessness in 2020.
Post-COVID that number’s only gone up from the 580 thousand seen here.
Zooming in, 12 percent of Americans live in California
But 28 percent of all Americans experiencing homelessness live in the state
:::
## [Homelessness in LA]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="60%"}
- **LA County** (\~pop. 10 million)
- 25% of California's population but 41% of its PEH
- 3% of U.S. population but 12% of its PEH
- **LA City** (\~pop. 3.9 million)
- 39% of county population but 62% of PEH
- 2/3 in first episode of homelessness
- Estimated new 20,000 PEH amid COVID
:::
::: {.column width="40%"}
{fig-align="right"}
:::
:::
::: footer
Figures via [LAHSA 2020 Count](https://www.lahsa.org/news?article=726-2020-greater-los-angeles-homeless-count-results#:~:text=LOS%20ANGELES%2C%20CA%E2%80%94The%20Los,point%2Din%2Dtime%20count.) and [Union Rescue Mission in Skid Row](https://urm.org/)
:::
::: {.notes}
Zooming in even further, Los Angeles County is home to 25% of California’s population
but 41% of Californians experiencing homelessness reside in the county.
2 of every 5 LA County residents is within the City of LA,
but 3 of every 5 people experiencing homelessness in the county resides in city limits.
And COVID is expected to have left another 20,000 Angelenos homeless.
:::
## [The Emergency Medicine Model]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="60%"}
- A place for stabilization
- Get you stable enough to go back home
- or stable enough to transport to an inpatient unit
- Problems with non-urgent utilization
- Overburdens department resources
- Increases wait for care for all patients
- Chair reaction of patients Leaving before they're even seen
:::
::: {.column width="40%"}
{fig-align="right"}
:::
:::
::: {.notes}
With the background of homelessness established, let’s look at what Emergency Departments are designed to do:
It’s a community safety net for anyone needing aid.
EMTALA ensures that.
But emergency departments are designed as more or less a midway point in your care journey:
The idea is that you get stabilized enough to go back home or to be admitted.
Recent decades have seen the ED model tested and challenged by growing non-urgent ED utilization.
The results?
The ED’s resources get spread thin,
everybody’s wait time balloons with the influx of patients,
and people leave without even being seen because they’re tired of waiting.
:::
## [Packed EDs]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="65%"}
- Crowding and overflowing longstanding issues
- Examples of low-acuity cases coming in
- prescription refills
- treatment of hypertension
- chronic elevated blood sugar
- behavioral health
- Source of patient and staff harm
- "COVID-19 has laid bare medicine's house of cards." ^\*^
:::
::: {.column width="35%"}
{fig-align="right"}
:::
:::
::: footer
\* [Dr. Sharon Anoush Chekijian in U.S. News and World Report](https://www.usnews.com/news/health-news/articles/2021-10-19/er-crowding-threatens-a-health-care-house-of-cards) \| Graphic via [CDC](https://www.cdc.gov/mmwr/volumes/69/wr/mm6923e1.htm)
:::
::: {.notes}
I’m not telling you anything new here.
We’ve all seen overflowing waiting rooms and gurneys lining hallways.
Those non-urgent cases are part of the culprit
Folks are trying to get their prescriptions refilled at the ED
Poorly regulated blood pressure or blood sugar cases pack the waiting room
and for many behavioral health patients, stopping by the ED essentially becomes part of their social routine.
All through this, staff are getting spread thin,
that drain on energy and burnout puts both staff and patients at risk.
And these issues all existed BEFORE COVID.
:::
## [Homeless Care at Cedars-Sinai ED]{style="font-weight:500"} {.smaller}
- 7,956 visits by 3,194 PEH patients Feb 2020-Jan 2021
- Roughly 2.49 visits per PEH patient
- Many there for basic needs
- Food
- Shelter
- Primary care-level treatment
::: {.notes}
One of the patient groups often behind those low-acuity cases are those experiencing homelessness
Here’s what the homeless caseload looked like in our ED:
February 2020 to January 2021, our neighbors experiencing homelessness visited nearly 8,000 times.
The average here suggests 2-3 times per patient,
but some were seen dozens or even more than 100 times.
Common chief complaints we see in those visits are food needs,
seeking shelter and treatment for issues best handled by a PCP or urgent care.
:::
## [California SB1152]{style="font-weight:500"} {.smaller}
- Passed in 2018, requires hospitals to document info about patients experiencing homelessness before discharging them.
- Services offered
- Transportation
- Meal
- Meds
- Vaccinations
- Weather-appropriate clothing
- Resources offered
- Clinical/Behavioral
- Follow-up with PCP
- Help getting health coverage
::: {.notes}
Rewind a little bit before COVID,
California passed a law requiring hospitals to document the types of services and resources offered to patients experiencing homelessness before discharging them
Were they fed?
Did they get a ride to where they stay?
How about meds? Vaccinations? Help applying for insurance?
Were their clothes appropriate for the conditions outside?
Were they set up with a follow-up appointment with a PCP or behaviorist?
All these must be noted before discharge according to California law.
:::
## [A New Role is Born]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="60%"}
**Community Resource Coordinator**
- Responsible for SB1152 checklist items
- Help PEH patients find more sustainable support
- Provide connections to community resources
- Shelter
- Staple needs
- Insurance
- Follow-up & specialty care appointments
:::
::: {.column width="40%"}
[{fig-align="right"}](https://www.cedars-sinai.org/eoc/cedars-sinai-connects-patients-to-services-for-homelessness.html)
:::
:::
::: {.notes}
Obviously the status quo wasn’t meeting our homeless patients’ needs.
ED leadership started wondering if there was something being missed in the initial encounter
that could limit the need for return visits.
And somebody was going to need to track those new data points.
A generous donor was able to help the ED create a new role,
the Community Resource Coordinator was charged with going beyond the symptoms with our patients experiencing homelessness.
If patients welcome a CRC’s help, the CRC works on connecting them with vital staple needs, or shelter, or health coverage, or follow-up
care.
By the way, this is Weihao, who was one of our OG CRCs.
A lot of the target variables you’re about to see are his brainchild. I just crunched them.
:::
## [How's It Going?]{style="font-weight:500"}
Are CRCs effective at reducing the use of emergency services for non-urgent matters while ensuring that homeless patients can access their basic needs?
Data gathered in fulfilling SB1152 needs used to measure role's impact
::: {.notes}
So let’s tackle this like a research question:
Are CRCs effective at reducing the use of emergency services for non-urgent matters while ensuring that homeless patients can access their basic needs?
Luckily, we’ve got a dataset to help us figure it out.
:::
## [Studying the Impact]{style="font-weight:500"} {.smaller}
- Diff-in-diff cohort model
- Visit rates of patients experiencing homelessness
- Split by whether they were seen by a CRC during their index visit
- Dependent variables
- Time interval between visits (in days)
- Cost of stay
- Length of stay (LOS)
- Differences in the populations were tested for statistical significance using a Welch's t-test
::: {.notes}
Nerd goggles on.
We tested a diff-in-diff cohort model
to compare the visit rate of patients experiencing homelessness.
One group saw a CRC at their index visit,
one group didn’t see a CRC on that visit.
Across groups we compared how long it took a patient to return to the ED, the cost of their stay, and the length of their stay and ran
each through a t-test.
:::
## [What We Found]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="40%"}
- A two-sample t-test demonstrated statistical significance (p = 0.0014)
- 22.82% increase to \# of days elapsed before a patient returned to the ED after visiting with a CRC
- 95% confidence interval: 2.6-10.9 days larger gap between ED visits
:::
::: {.column width="60%"}
{fig-align="right"}
:::
:::
::: {.notes}
When it came to gap between return visits, we indeed found statistical significance.
Patients who saw a CRC took an extra 3-11 days to return compared with those who didn’t.
:::
## [90-Day Return Rate]{style="font-weight:500"} {.scrollable}
::: columns
::: {.column width="65%"}
{style="max-width: 95%;" fig-align="right"}
:::
::: {.column width="35%"}
**Revisit rate:**
:arrow_down:35%
**95% CI:**
0.8-1.4 fewer visits
**p:** \<0.0001
:::
:::
::: {.notes}
We compared visits per next 90 days and next 180 days.
Patients who met with a CRC had 1-2 fewer visits in that window of time.
:::
## [180-Day Return Rate]{style="font-weight:500"} {.scrollable}
::: columns
::: {.column width="60%"}
{style="max-width: 95%;;" fig-align="right"}
:::
::: {.column width="35%"}
**Revisit rate:**
:arrow_down:35%
**95% CI:**
1.1-2.1 fewer visits
**p:** \<0.0001
:::
:::
::: {.notes}
We compared visits per next 90 days and next 180 days.
Patients who met with a CRC had 1-2 fewer visits in that window of time.
:::
## [Other Results]{style="font-weight:500"} {.smaller}
::: columns
::: {.column width="60%"}
- Difference in cost of care
- p = 0.1050
- Not statistically significant
- Difference in length of stay in the ED
- p = 0.1053
- Not statistically significant
- Makes sense considering CRC can't really affect those figures
:::
::: {.column width="40%"}
{fig-align="right"}
:::
:::
::: {.notes}
Those differences for cost and length of stay didn’t quite work out.
We couldn’t achieve statistical significance there,
but upon reflection that made sense.
A CRC doesn’t have any sway in what treatment you receive in the ED or when.
:::
## [Understanding the Results]{style="font-weight:500"} {.smaller}
- Increased gap between ED visits
- Lowered rate of ED visits over 90 and 180 days
- Implications
- Increased utilization of community resources may be decreasing frequency of needs that draw patients experiencing homelessness to ED
- Reduced burden by lower-urgency needs on ED resources
- Possible effects
- Shorter wait times
- Fewer patients leaving without being seen
- Greater focus on other patients with more acute needs
::: {.notes}
So yay, we got a few p-values to go our way. But what does that mean?
The big win comes in the fact we know these patients are getting connected to the community resources they need.
They’re getting opportunities at follow-up care that goes beyond the symptoms.
Meanwhile, in the ED, the possible gains are cuts in wait time,
fewer patients heading for the door before being seen,
and emergency providers getting to do more of what they entered the field to do: Save lives in immediate danger
:::
## [Beyond the First Year ...]{style="font-weight:500"} {.smaller}
- Slides so far showed Feb 2020-Jan 2021, but the work continues.
- Results Feb 2020-Apr 2023
- 20,669 visits by 8,902 PEH patients
::: columns
::: {.column width="30%"}
#### Overall Avg Gap Between Visits {style="font-weight:500"}

:arrow_up: by 10.0-23.6 days
:::
::: {.column width="30%"}
#### 90-Day Visit Rate {style="font-weight:500"}

:arrow_down: by 0.7-1.1 visits
:::
::: {.column width="30%"}
#### 180-day Visit Rate {style="font-weight:500"}

:arrow_down: by 1.2-1.8 visits
:::
:::
::: {.notes}
We’ve continued monitoring results beyond that first year of the CRC program,
and things continue to look promising for reducing repeat visits.
:::
## The Dataset {.smaller}
Patient Identifier
Encounter Identifier
Arrival Datetime
Departure Datetime
ED Navigator
Total Charges
Visits last 90 Days
Visits last 180 Days
## The Script {.scrollable .code-overflow-wrap}
```{r part1, eval=FALSE, warning=FALSE, echo=TRUE}
# Make relevant R packages available.
library(dtplyr)
library(tidyverse, warn.conflicts = FALSE)
# Read in Homeless Patient Discharge Checklist dataset from Excel.
patlog <- readxl::read_excel("~/SomeFolder/Homeless.xlsx")
# Convert variables to appropriate data type.
patlog$DOB <- ymd(patlog$DOB)
patlog$`Admission Date` <- ymd_hms(patlog$`Admission Date`)
patlog$`Discharge Date` <- ymd_hms(patlog$`Discharge Date`)
patlog$`Last Seen DATE` <- ymd_hms(patlog$`Last Seen DATE`)
# Ensure we're only looking at emergency visits
patlog <- patlog %>%
filter(
(Department == "ASAP EMERGENCY DEPT"
| Department == "MDRH EMERGENCY DEPT"))
# Set relevant dates
mindate <- date(min(patlog$`Discharge Date`, na.rm = TRUE))
maxdate <- date(max(patlog$`Discharge Date`, na.rm = TRUE))
lag90days <- date(max(patlog$`Discharge Date`, na.rm = TRUE) - days(90))
lag180days <- date(max(patlog$`Discharge Date`, na.rm = TRUE) - days(180))
# Declare those dates for readers
glue::glue("Before we get into determining whether CSMC\'s and MRDH\'s
Community Resource Coordinators are having a statistically
significant effect on the department, let\'s quickly look at
their caseload from {month(mindate, label = TRUE)}
{day(mindate)}, {year(mindate)} to
{month(maxdate, label = TRUE)} {day(maxdate)},
{year(maxdate)}.")
# Count the number of cases involving an ED Navigator (aka CRC).
patlog %>%
group_by(metCRC = !is.na(`ED Navigator`)) %>%
tally()
# Save those counts to their own variables
CRCtotal <- sum(!is.na(patlog$`ED Navigator`))
noCRCtotal <- sum(is.na(patlog$`ED Navigator`))
# Share results with readers
glue::glue("We can see that the CRCs had {CRCtotal} interactions with
homeless patients. {noCRCtotal} homeless encounters did not
include a CRC interaction.")
# Create three new variables, one calculating days elapsed before
# the patient was seen again after this visit,
# one counting up the number of times the patient was seen in the
# 90 days following this visit, and
# one counting up the number of times the patient was seen in the
# 180 days following this visit.
patlog <- patlog %>%
group_by(Name) %>%
mutate(nextVisit = lead(`Discharge Date`),
daysUntilNextVisit = round(
int_length(
`Discharge Date`%--%nextVisit)/86400),
visitsNext90Days = map_dbl(
`Discharge Date`,
~sum(`Discharge Date` %within% interval(., . + days(90)),
na.rm = TRUE)) -1,
visitsNext180Days = map_dbl(
`Discharge Date`,
~sum(`Discharge Date` %within% interval(., . + days(180)),
na.rm = TRUE)) -1) %>%
ungroup()
# For every patient who saw a CRC during their visit, list the number
# of days between the current visit and their next one
sawCRC <- patlog %>%
filter(!is.na(`ED Navigator`)) %>%
drop_na(daysUntilNextVisit) %>%
pull(daysUntilNextVisit)
# For every patient who did not see a CRC during their visit, list
# the number of days between the current visit and their next one
noCRC <- patlog %>%
filter(is.na(`ED Navigator`)) %>%
drop_na(daysUntilNextVisit) %>%
pull(daysUntilNextVisit)
#Declare n-sizes for readers
glue::glue("In this test, for patients who returned after
encountering a CRC, n = {length(sawCRC)}.
For patients who returned after not
encountering a CRC in their previous visit,
n = {length(noCRC)}.")
# Perform a t-test to determine if the difference in the two
# groups' average number of days between ED visits is
# statistically significant
dayGapTest <- t.test(sawCRC, noCRC, conf.level = 0.95)
# Display raw test results
dayGapTest
#Calculations for visualization
gapInDays <- patlog %>%
filter(is.na(daysUntilNextVisit) == FALSE) %>%
mutate(visitedByCRC = !is.na(`ED Navigator`)) %>%
select(visitedByCRC, daysUntilNextVisit) %>%
group_by(visitedByCRC) %>%
summarize(
avgVisitGap = mean(daysUntilNextVisit),
n = n(),
sd = sd(daysUntilNextVisit)
) %>%
mutate(se=sd/sqrt(n))
# Visualize results
ggplot(
gapInDays,
aes(visitedByCRC, avgVisitGap, fill = visitedByCRC
)
) +
geom_col() +
geom_errorbar(
aes(
x = visitedByCRC,
ymin = avgVisitGap - se,
ymax = avgVisitGap + se),
width = 0.2) +
geom_text(aes(label = format(signif(avgVisitGap, digits = 3),
nsmall = 2)), vjust = 3.9, size = 8) +
ggtitle("Average Gap Between ED Visits for Homeless Patients") +
xlab("Patient Group") +
ylab("Average Gap in Days") +
scale_x_discrete(labels = c ("Wasn't Seen by CRC", "Saw CRC")) +
scale_fill_manual(values = alpha(c("#B0B3B2", "#4EC3E0"), .6)) +
theme_bw() +
theme(
legend.position = "none",
plot.title = element_text(size = 17),
axis.text = element_text(size = 14),
axis.title = element_text(size = 16)
)
# Explain the results
glue::glue("From this output, we can say that we're 95% confident
that CRC interactions had an impact on the rate of
return for repeat homeless visitors seen between
{month(mindate, label = TRUE)}
{day(mindate)}, {year(mindate)} to
{month(maxdate, label = TRUE)} {day(maxdate)},
{year(maxdate)}, equal to somewhere between
{round(dayGapTest$conf.int[[1]], 1)} and
{round(dayGapTest$conf.int[[2]], 1)} extra days
between visits.")
# Since the next test requires a 90-day window and we have data for
# Feb 1 2020 - April 30, 2023, we'll cut off visits at Jan 30 2023 to
# ensure every observation has the necessary 90-day window
cutoff90days <- patlog %>%
filter(`Discharge Date` < ymd(lag90days))
# For every patient who saw a CRC during their visit, list the number of
# times they had been seen in the ED over the 90 days after the
# current visit.
sawCRC90days <- cutoff90days %>%
filter(!is.na(`ED Navigator`)) %>%
pull(visitsNext90Days)
# For every patient who did not see a CRC during their visit, list the
# number of times they had been seen in the ED over the 90 days
# after the current visit.
noCRC90days <- cutoff90days %>%
filter(is.na(`ED Navigator`)) %>%
pull(visitsNext90Days)
#Declare n-sizes for readers
glue::glue("To look further, we'll compare the average number of
visits in a 90-day period for patients who encountered
CRCs vs. those who didn't. Data used for this test is
visits from {month(mindate, label = TRUE)}
{day(mindate)}, {year(mindate)} to
{month(lag90days, label = TRUE)}
{day(lag90days)}, {year(lag90days)},
to allow for the appropriate 90-day measurement window.")
glue::glue("In this test, for ED encounters by patients who met with
a CRC, n = {length(sawCRC90days)}. For ED encounters by
patients who hadn't met with a CRC,
n = {length(noCRC90days)}.")
# Perform a t-test to determine if the difference in the two groups'
# average number of visits over 90 days is statistically significant
test90days <- t.test(sawCRC90days, noCRC90days, conf.level = 0.95)
# Display raw test results
test90days
#Calculations for visualization
rate90Days <- cutoff90days %>%
mutate(visitedByCRC = !is.na(`ED Navigator`)) %>%
select(visitedByCRC, visitsNext90Days) %>%
group_by(visitedByCRC) %>%
summarize(
rateOfVisits90 = mean(visitsNext90Days),
n = n(),
sd = sd(visitsNext90Days)) %>%
mutate(se=sd/sqrt(n))
# Visualize results
ggplot(rate90Days, aes(visitedByCRC, rateOfVisits90,
fill = visitedByCRC)) +
geom_col() +
geom_errorbar(
aes(
x = visitedByCRC,
ymin = rateOfVisits90 - se,
ymax = rateOfVisits90 + se),
width = 0.2) +
geom_text(
aes(
label = format(signif(rateOfVisits90, digits = 3),
nsmall = 2)),
vjust = 3.9,
size = 8) +
ggtitle("Rate of ED Visits per 90 Days for Homeless Patients") +
xlab("Patient Group") +
ylab("Rate of ED Visits per 90 Days") +
scale_x_discrete(labels = c ("Wasn't Seen by CRC", "Saw CRC")) +
scale_fill_manual(values = alpha(c("#B0B3B2", "#4EC3E0"), .6)) +
theme_bw() +
theme(
legend.position = "none",
plot.title = element_text(size = 18),
axis.text = element_text(size = 14),
axis.title = element_text(size = 16)
)
# Explain the results
glue::glue("From these results, we're 95% confident that CRC interactions
have a statistically significant impact on homeless patients'
rate of visits per 90 days, with patients who saw them being
seen somewhere between
{round(abs(test90days$conf.int[[2]]), 1)}
to {round(abs(test90days$conf.int[[1]]), 1)}
fewer times over the next 90 days.")
# For every patient who did not see a CRC during their visit, list the
# number of times they had been seen in the ED over the 180 days after
# the current visit. Since the next test requires a 180-day window and
# we have data for Feb. 1, 2020 - Apr 30, 2023, we'll cut off visits
# at Nov 1 2022 to ensure every observation has the necessary 180-day
# window
cutoff180days <- patlog %>%
filter(`Discharge Date` < ymd(lag180days))
# For every patient who saw a CRC during their visit, list the number
# of times they had been seen in the ED over the 180 days after the
# current visit.
sawCRC180days <- cutoff180days %>%
filter(!is.na(`ED Navigator`)) %>%
drop_na(visitsNext180Days) %>%
pull(visitsNext180Days)
# For every patient who did not see a CRC during their visit, list the
# number of times they had been seen in the ED over the 180 days after
# the current visit.
noCRC180days <- cutoff180days %>%
filter(is.na(`ED Navigator`)) %>%
drop_na(visitsNext180Days) %>%
pull(visitsNext180Days)
#Declare n-sizes for readers
glue::glue("Expanding the window to 180 days also demonstrates value in
the CRC program. Data used for this test is visits from
{month(mindate, label = TRUE)} {day(mindate)}, {year(mindate)}
to {month(lag180days, label = TRUE)} {day(lag180days)},
{year(lag180days)}, to allow for the appropriate 180-day
measurement window.")
glue::glue("In this test, for ED encounters by patients who met with
a CRC, n = {length(sawCRC180days)}. For ED encounters by
patients who hadn't met with a CRC,
n = {length(noCRC180days)}.")
# Perform a t-test to determine if the difference in the two groups'
# average number of visits over 180 days is statistically significant
test180days <- t.test(sawCRC180days, noCRC180days, conf.level = 0.95)
# Display raw test results
test180days
#Calculations for visualization
rate180Days <- cutoff180days %>%
mutate(visitedByCRC = !is.na(`ED Navigator`)) %>%
select(visitedByCRC, visitsNext180Days) %>%
group_by(visitedByCRC) %>%
summarize(
rateOfVisits180 = mean(visitsNext180Days),
n = n(),
sd = sd(visitsNext180Days)) %>%
mutate(se=sd/sqrt(n))
# Visualize results
ggplot(rate180Days,
aes(visitedByCRC, rateOfVisits180, fill = visitedByCRC)) +
geom_col() +
geom_errorbar(aes(
x = visitedByCRC,
ymin = rateOfVisits180 - se,
ymax = rateOfVisits180 + se),
width = 0.2) +
geom_text(aes(
label = format(signif(rateOfVisits180, digits = 3),
nsmall = 2)),
vjust = 3.9,
size = 8) +
ggtitle("Rate of ED Visits per 180 Days for Homeless Patients") +
xlab("Patient Group") +
ylab("Rate of ED Visits per 180 Days") +
scale_x_discrete(labels = c ("Wasn't Seen by CRC", "Saw CRC")) +
scale_fill_manual(values = alpha(c("#B0B3B2", "#4EC3E0"), .6)) +
theme_bw() +
theme(
legend.position = "none",
plot.title = element_text(size = 18),
axis.text = element_text(size = 14),
axis.title = element_text(size = 16)
)
# Explain the results
glue::glue("From these results, we're 95% confident that CRC interactions
have a statistically significant impact on homeless patients'
rate of visits per 180 days, with patients who saw them being
seen somewhere between
{round(abs(test180days$conf.int[[2]]), 1)} to
{round(abs(test180days$conf.int[[1]]), 1)} fewer times over
the next 180 days.")
```
## The Report
[Let's take a look.](https://lukesmorris.com/Cedars_CRCs/demo%20CRC%20Report.html){preview-link="true"}
## . {background-image="images/questions.webp"}
## [Thank you]{style="font-weight:500"}
<p>[{{< fa arrow-pointer >}} lukesmorris.com](https://lukesmorris.com)</p>
<p>[{{< fa envelope >}} luke.morris\@cshs.org](mailto:[email protected])</p>
<p>[{{< fa brands github >}} morrisLuke](https://github.io/morrisLuke)</p>
<p>[{{< fa brands linkedin >}} lukesmorris](https://linkedin.com/in/lukesmorris)</p>