generated from opensafely/research-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
mabs_and_antivirals_coverage_report.Rmd
974 lines (799 loc) · 59 KB
/
mabs_and_antivirals_coverage_report.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
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
---
title: Coverage and uptake of antivirals and neutralising monoclonal antibodies for the treatment of non-hospitalised patients with COVID-19
output:
html_document:
theme: journal
github_document:
keep_html: TRUE
# output:
# pdf_document
---
```{css, echo=FALSE}
pre {
max-height: 300px;
overflow-y: auto;
}
pre[class] {
max-height: 200px;
}
```
<style>
body {
text-align: justify;
font-size: 11pt}
</style>
```{r setup, include=FALSE}
# Document settings ----
knitr::opts_chunk$set(echo = TRUE)
# Import libraries ----
library(tidyverse)
library(here)
library(kableExtra)
library(knitr)
library(ggplot2)
library(png)
library(readr)
library(htmltools)
library(gt)
library(scales)
library(lubridate)
# Import custom user functions ----
source(here("analysis", "lib", "custom_functions.R"))
# Input directory ----
input_dir_os <- here("released_outputs", "reports", "coverage")
#input_dir_os <- here("output", "coverage")
# Output directory ----
output_dir_rmd <- here("reports", "coverage")
fs::dir_create(output_dir_rmd)
# Import data ----
report_stats <- read_csv(fs::path(input_dir_os, "table_report_stats_redacted.csv"))
flowchart_non_elig <- read_csv(fs::path(input_dir_os, "table_non_elig_flowchart_redacted.csv"))
# End date ----
end_date <- report_stats$study_end
```
# Overview
This OpenSAFELY report has been rapidly developed to support monitoring the ongoing roll-out of antivirals and neutralising monoclonal antibodies (nMABs) for the treatment of COVID-19, based on the population of 23.4m people registered with practices that use TPP SystmOne software. Since January 2022, this report has been updated approximately bi-monthly, as new data arrives, and will continue to be updated as needed. Consequently, there are likely to be some small changes made between the some versions.
Note that currently the clinician-assigned risk group for patients receiving Paxlovid or Remdesivir is not available. While we’re able to assign high risk groups to about 70% of these patients by implementing the NHS Digital logic, the other 30% are most likely identified via non-digital routes. For now, where results are broken down by high risk cohort and no high risk cohort is able to assigned, these patients are excluded.
The code and data for this report can be found at the OpenSAFELY [antibody-and-antiviral-deployment repository](https://github.com/opensafely/antibody-and-antiviral-deployment). The accompanying manuscript is available on [MedRXiV](https://www.medrxiv.org/content/10.1101/2022.03.07.22272026v2) and is currently undergoing review at a peer-reviewed journal.
##### Contents
* [Introduction](#intro)
* [Results](#results)
+ [Coverage of COVID-19 treatment](#coverage)
+ [High risk patient cohorts](#hrc)
+ [Key demographic and clinical characteristics of treated patients](#demographic)
+ [Consistency with guidance](#concordance)
+ [Time to treatment](#time)
+ [Variation by STP](#stp)
* [Methods](#methods)
# Introduction <a name="intro"></a>
While vaccines remain the best strategy to prevent COVID-19, recent evidence suggests neutralising monoclonal antibodies (nMABs) or antivirals could potentially benefit certain vulnerable populations before or after exposure to SARS-CoV-2, such as the unvaccinated or recently vaccinated high-risk patients. On 11th December 2021, new COVID-19 Medicine Delivery Units (CMDUs) were launched across England, offering antiviral medicines and neutralising monoclonal antibodies (nMABs) as treatment to patients with COVID-19 at high risk of severe outcomes in outpatient clinics or their own home.
With the recent roll-out of nMABs and antivirals, there is an urgent need assess the coverage of these new treatments amongst these patients, such as factors of relevance in determining nMAB and antiviral treatment and the impact of nMAB and antiviral treatment in the community and hospital settings.
Using the OpenSAFELY platform we have developed and delivered a rapid, near real-time data-monitoring framework for the roll-out of antivirals and nMABs in England that can deliver detailed coverage reports in fine-grained clinical and demographic risk groups, using publicly auditable methods, using linked but pseudonymised patient-level NHS data in a highly secure Trusted Research Environment.
Full methods in code form can be found in the accompanying [antibody-and-antiviral-deployment repository](https://github.com/opensafely/antibody-and-antiviral-deployment) and are also described in our paper, linked above. [Brief methods](#methods) can be found at the end of the this report.
# Results <a name="results"></a>
### Overall coverage of COVID-19 treatment <a name="coverage"></a>
Between **`r format(report_stats$study_start, format = "%d-%b-%Y")`** and **`r format(report_stats$study_end, format = "%d-%b-%Y")`**, a total of `r format(report_stats$eligible_patients, big.mark = ",", scientific = FALSE)` non-hospitalised patients registered at a TPP practice in England were identified as potentially being eligible for receiving an antiviral or nMAB for treating COVID-19. Of the `r format(report_stats$eligible_patients, big.mark = ",", scientific = FALSE)` potentially eligible patients, (`r format(round(report_stats$high_risk_cohort_2plus/report_stats$eligible_patients*100, digits = 0), big.mark = ",", scientific = FALSE)`%) were classified into more than one high risk cohort (high risk cohort count range `r report_stats$high_risk_cohort_lower` - `r report_stats$high_risk_cohort_upper`). The number of patients potentially eligible in each high risk cohort is described in Figure 1 and Table 1 below.
Of the `r format(report_stats$eligible_patients, big.mark = ",", scientific = FALSE)` potentially eligible patients, `r format(report_stats$treated_patients, big.mark = ",", scientific = FALSE)` (**`r round(report_stats$treated_patients/report_stats$eligible_patients*100, digits = 0)`%**) received treatment from a CMDU (Table 1, Figure 2);
- Paxlovid: `r format(report_stats$treated_paxlovid, big.mark = ",", scientific = FALSE)`;
- Sotrovimab: `r format(report_stats$treated_sotrovimab, big.mark = ",", scientific = FALSE)`;
- Remdesivir: `r format(report_stats$treated_remdesivir, big.mark = ",", scientific = FALSE)`;
- Molnupiravir: `r format(report_stats$treated_molnupiravir, big.mark = ",", scientific = FALSE)`;
- Casirivimab: `r format(report_stats$treated_casirivimab, big.mark = ",", scientific = FALSE)`.
<br>
```{r, coverage plot, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Figure 1 Cumulative total of potentially eligible patients for receiving an antiviral or nMABs for treating COVID-19 since 11th December 2021, stratified by high risk cohort.** Patients are considered eligible on the date of their positive SARS-CoV-2 test. Note, patients can appear in more than one high risk group, and the overall number in each group is likely to be an overestimation due to including SARS-CoV-2 infection confirmed by either lateral flow or PCR test (where only PCR-confirmed infections should have been treated according to guidance in effect prior to 10th February 2022), and potentially including non-symptomatic patients; ", fig.topcaption=TRUE}
coverage_plot_data <- read_csv(here::here(input_dir_os, "table_cum_eligiblity_redacted.csv")) %>%
mutate(high_risk_cohort = case_when(
high_risk_cohort == "All" ~ "All",
high_risk_cohort == "downs_syndrome" ~ "Down's syndrome",
high_risk_cohort == "sickle_cell_disease" ~ "Sickle cell disease",
high_risk_cohort == "solid_cancer" ~ "Solid cancer",
high_risk_cohort == "haematological_disease" ~ "Haematological diseases and stem cell transplant recipients",
high_risk_cohort == "renal_disease" ~ "Renal disease",
high_risk_cohort == "liver_disease" ~ "Liver disease",
high_risk_cohort == "imid" ~ "Immune-mediated inflammatory disorders",
high_risk_cohort == "immunosupression" ~ "Immune deficiencies",
high_risk_cohort == "hiv_aids" ~ "Immunosuppression due to HIV or AIDS",
high_risk_cohort == "solid_organ_transplant" ~ "Solid organ transplant recipients",
high_risk_cohort == "rare_neurological_conditions" ~ "Rare neurological conditions",
TRUE ~ NA_character_))
coverage_plot_data$high_risk_cohort = unlist(lapply(strwrap(coverage_plot_data$high_risk_cohort, width=30, simplify=FALSE), paste,
collapse="\n"))
plot_order <- coverage_plot_data %>%
group_by(high_risk_cohort) %>%
mutate(order = max(cum_count_redacted, na.rm = T)) %>%
arrange(desc(order)) %>%
filter(cum_count_redacted == order) %>%
select(high_risk_cohort, order) %>%
distinct()
coverage_plot_data <- coverage_plot_data %>%
mutate(high_risk_cohort = factor(high_risk_cohort, levels = plot_order$high_risk_cohort))
coverage_plot <- coverage_plot_data %>%
filter(elig_start <= end_date) %>%
ggplot(aes(x = elig_start, y = cum_count_redacted, colour = high_risk_cohort, group = high_risk_cohort)) +
geom_step(size = 1) +
theme_classic(base_size = 8) +
scale_x_date(date_breaks = "2 week", date_labels = "%d %b %Y") +
#facet_wrap(~high_risk_cohort, scales = "free_y", labeller = labeller(groupwrap = label_wrap_gen(10))) +
labs(
x = "Positive SARS-CoV-2 test date",
y = "Number of patients eligible for receiving treatment",
colour = "High risk cohort",
title = "") +
theme(legend.position = "none") +
theme(
axis.text = element_text(size = 15),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.title = element_text(size = 20),
legend.text = element_text(size = 12),
legend.title=element_text(size=12, face = "bold"),
legend.position = c(0.15,0.65),
legend.background = element_rect(colour = "white"),
legend.box.background = element_rect(colour = "black"),
axis.line.x = element_line(colour = "black"),
panel.grid.minor.x = element_blank(),
legend.box.margin = margin(t = 1, l = 1, b = 1, r = 1)) +
scale_y_continuous(limits = c(0, 100000), labels = comma)
ggsave(
here::here(output_dir_rmd, "figures", "figure_cum_eligiblity.png"),
coverage_plot,
units = "cm", width = 35, height = 20
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_cum_eligiblity.png"))
```
<br>
```{r, elig treatment type plot, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Figure 2 Cumulative total of patients who received an antiviral or nMAB for treating COVID-19 since 11th December 2021, stratified by (a) treatment type and (b) high risk cohorts.** Shorter lines for Paxlovid and casirivimab reflect availability and guidance. Note, treated patients can appear in more than one high risk group.", fig.topcaption=TRUE}
treatment_plot_data <-
read_csv(here::here(input_dir_os, "table_cum_treatment_type_redacted.csv")) %>%
filter(!is.na(treatment_date),
treatment_date <= end_date,
cum_count_redacted > 0) %>%
mutate(treatment_type = case_when(treatment_type == "Casirivimab" ~ "Casirivimab/imdevimab",
TRUE ~ treatment_type))
plot_order <- treatment_plot_data %>%
group_by(treatment_type) %>%
mutate(order = max(cum_count_redacted, na.rm = T)) %>%
arrange(desc(order)) %>%
filter(cum_count_redacted == order) %>%
select(treatment_type, order) %>%
distinct()
treatment_plot_data <- treatment_plot_data %>%
mutate(treatment_type = factor(treatment_type, levels = plot_order$treatment_type))
treatment_type_plot <- treatment_plot_data %>%
ggplot(aes(x = treatment_date, y = cum_count_redacted, colour = treatment_type, group = treatment_type)) +
geom_step(size = 1) +
theme_classic(base_size = 8) +
scale_x_date(date_breaks = "1 week", date_labels = "%d %b %Y") +
scale_y_continuous(limits = c(0, 20000), labels = comma) +
labs(
x = "Treatment date",
y = "Number of patients receiving treatment",
colour = "Treatment type",
title = "(a)") +
theme(
axis.text = element_text(size = 15),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.title = element_text(size = 20),
legend.text = element_text(size = 12),
legend.title=element_text(size=12, face = "bold"),
legend.position = c(0.1,0.75),
legend.background = element_rect(colour = "white"),
legend.box.background = element_rect(colour = "black"),
axis.line.x = element_line(colour = "black"),
panel.grid.minor.x = element_blank(),
legend.box.margin = margin(t = 1, l = 1, b = 1, r = 1),
plot.title = element_text(size=20, face="bold"))
ggsave(
here::here(output_dir_rmd, "figures", "figure_cum_treatment_type.png"),
treatment_type_plot,
units = "cm", width = 35, height = 20
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_cum_treatment_type.png"))
```
<br>
```{r, elig treatment plot, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%'}
treatment_plot_data_therapeutics <- read_csv(here::here(input_dir_os, "table_cum_treatment_redacted.csv")) %>%
filter(!is.na(treatment_date),
treatment_date <= end_date) %>%
mutate(high_risk_cohort = case_when(
high_risk_cohort == "All" ~ "All",
high_risk_cohort == "downs_syndrome" ~ "Down's syndrome",
high_risk_cohort == "sickle_cell_disease" ~ "Sickle cell disease",
high_risk_cohort == "solid_cancer" ~ "Solid cancer",
high_risk_cohort == "haematological_disease" ~ "Haematological diseases and stem cell transplant recipients",
high_risk_cohort == "renal_disease" ~ "Renal disease",
high_risk_cohort == "liver_disease" ~ "Liver disease",
high_risk_cohort == "imid" ~ "Immune-mediated inflammatory disorders",
high_risk_cohort == "immunosupression" ~ "Immune deficiencies",
high_risk_cohort == "hiv_aids" ~ "Immunosuppression due to HIV or AIDS",
high_risk_cohort == "solid_organ_transplant" ~ "Solid organ transplant recipients",
high_risk_cohort == "rare_neurological_conditions" ~ "Rare neurological conditions",
TRUE ~ NA_character_))
plot_order <- treatment_plot_data_therapeutics %>%
group_by(high_risk_cohort) %>%
mutate(order = max(cum_count_redacted, na.rm = T)) %>%
arrange(desc(order)) %>%
filter(cum_count_redacted == order) %>%
select(high_risk_cohort, order) %>%
distinct()
treatment_plot_data_therapeutics <- treatment_plot_data_therapeutics %>%
mutate(high_risk_cohort = factor(high_risk_cohort, levels = plot_order$high_risk_cohort))
treatment_plot_therapeutics <- treatment_plot_data_therapeutics %>%
ggplot(aes(x = treatment_date, y = cum_count_redacted, colour = high_risk_cohort, group = high_risk_cohort)) +
geom_step(size = 1) +
theme_classic(base_size = 8) +
scale_x_date(date_breaks = "1 week", date_labels = "%d %b %Y") +
scale_y_continuous(limits = c(0, 20000), labels = comma) +
labs(
x = "Treatment date",
y = "Number of patients receiving treatment",
colour = "High risk cohort",
title = "(b)") +
theme(
axis.text = element_text(size = 15),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.title = element_text(size = 20),
legend.text = element_text(size = 12),
legend.title=element_text(size=12, face = "bold"),
legend.position = c(0.2,0.75),
legend.background = element_rect(colour = "white"),
legend.box.background = element_rect(colour = "black"),
axis.line.x = element_line(colour = "black"),
panel.grid.minor.x = element_blank(),
legend.box.margin = margin(t = 1, l = 1, b = 1, r = 1),
plot.title = element_text(size=20, face="bold"))
ggsave(
here::here(output_dir_rmd, "figures", "figure_cum_treatment_therapeutics.png"),
treatment_plot_therapeutics,
units = "cm", width = 35, height = 20
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_cum_treatment_therapeutics.png"))
```
<br>
```{r, eligible-treatment breakdown, echo=FALSE, message=FALSE, warning=FALSE, out.width = '90%'}
table_elig_treat_redacted <- read_csv(fs::path(input_dir_os, "table_elig_treat_redacted2.csv")) %>%
mutate(high_risk_cohort = case_when(
high_risk_cohort == "All" ~ "All",
high_risk_cohort == "downs_syndrome" ~ "Down's syndrome",
high_risk_cohort == "sickle_cell_disease" ~ "Sickle cell disease",
high_risk_cohort == "solid_cancer" ~ "Solid cancer",
high_risk_cohort == "haematological_disease" ~ "Haematological diseases and stem cell transplant recipients",
high_risk_cohort == "renal_disease" ~ "Renal disease",
high_risk_cohort == "liver_disease" ~ "Liver disease",
high_risk_cohort == "imid" ~ "Immune-mediated inflammatory disorders",
high_risk_cohort == "immunosupression" ~ "Primary immune deficiencies",
high_risk_cohort == "hiv_aids" ~ "Immunosuppression due to HIV or AIDS",
high_risk_cohort == "solid_organ_transplant" ~ "Solid organ transplant recipients",
high_risk_cohort == "rare_neurological_conditions" ~ "Rare neurological conditions",
high_risk_cohort == "high_risk_group_unknown" ~ "High risk cohort not known",
TRUE ~ NA_character_)) %>%
#mutate(order = Treated/Eligibile,
# order = ifelse(high_risk_cohort == "All", 1, order)) %>%
arrange(desc(Eligibile)) #%>%
#select(-order)
table_elig_treat_redacted <- table_elig_treat_redacted %>%
mutate(Treated_perc = paste(round(Treated/Eligibile*100, digits = 0), " (",
round((Treated/Eligibile - 1.96*sqrt((Treated/Eligibile)*(1-Treated/Eligibile)/Eligibile))*100, digits = 0),
"-",
round((Treated/Eligibile + 1.96*sqrt((Treated/Eligibile)*(1-Treated/Eligibile)/Eligibile))*100, digits = 0),
")",
sep = ""),
Paxlovid_perc = paste(round(Paxlovid/Treated*100, digits = 0), " (",
round((Paxlovid/Treated - 1.96*sqrt((Paxlovid/Treated)*(1-Paxlovid/Treated)/Treated))*100, digits = 0),
"-",
round((Paxlovid/Treated + 1.96*sqrt((Paxlovid/Treated)*(1-Paxlovid/Treated)/Treated))*100, digits = 0),
")",
sep = ""),
Sotrovimab_perc = paste(round(Sotrovimab/Treated*100, digits = 0), " (",
round((Sotrovimab/Treated - 1.96*sqrt((Sotrovimab/Treated)*(1-Sotrovimab/Treated)/Treated))*100,
digits = 0),
"-",
round((Sotrovimab/Treated + 1.96*sqrt((Sotrovimab/Treated)*(1-Sotrovimab/Treated)/Treated))*100,
digits = 0),
")",
sep = ""),
Remdesivir_perc = paste(round(Remdesivir/Treated*100, digits = 0), " (",
round((Remdesivir/Treated - 1.96*sqrt((Remdesivir/Treated)*(1-Remdesivir/Treated)/Treated))*100,
digits = 0),
"-",
round((Remdesivir/Treated + 1.96*sqrt((Remdesivir/Treated)*(1-Remdesivir/Treated)/Treated))*100,
digits = 0),
")",
sep = ""),
Molnupiravir_perc = paste(round(Molnupiravir/Treated*100, digits = 0), " (",
round((Molnupiravir/Treated - 1.96*sqrt((Molnupiravir/Treated)*(1-Molnupiravir/Treated)/Treated))*100,
digits = 0),
"-",
round((Molnupiravir/Treated + 1.96*sqrt((Molnupiravir/Treated)*(1-Molnupiravir/Treated)/Treated))*100,
digits = 0),
")",
sep = ""),
Casirivimab_perc = paste(round(Casirivimab/Treated*100, digits = 0), " (",
round((Casirivimab/Treated - 1.96*sqrt((Casirivimab/Treated)*(1-Casirivimab/Treated)/Treated))*100,
digits = 0),
"-",
round((Casirivimab/Treated + 1.96*sqrt((Casirivimab/Treated)*(1-Casirivimab/Treated)/Treated))*100,
digits = 0),
")",
sep = "")) %>%
select(high_risk_cohort, Eligibile, Treated, Treated_perc, Paxlovid, Paxlovid_perc, Sotrovimab, Sotrovimab_perc, Remdesivir,
Remdesivir_perc, Molnupiravir, Molnupiravir_perc, Casirivimab, Casirivimab_perc) %>%
mutate(Paxlovid = ifelse(is.na(Paxlovid), "<8", Paxlovid),
Paxlovid_perc = ifelse(Paxlovid_perc == "NA (NA-NA)", "--", Paxlovid_perc),
Remdesivir = ifelse(is.na(Remdesivir), "<8", Remdesivir),
Remdesivir_perc = ifelse(Remdesivir_perc == "NA (NA-NA)", "--", Remdesivir_perc),
Molnupiravir = ifelse(is.na(Molnupiravir), "<8", Molnupiravir),
Molnupiravir_perc = ifelse(Molnupiravir_perc == "NA (NA-NA)", "--", Molnupiravir_perc),
Casirivimab = ifelse(is.na(Casirivimab), "<8", Casirivimab),
Casirivimab_perc = ifelse(Casirivimab_perc == "NA (NA-NA)", "--", Casirivimab_perc))
colnames(table_elig_treat_redacted) <- c("High risk cohort", "Count", "Count", "%", "Count", "%",
"Count", "%", "Count", "%", "Count", "%",
"Count", "%")
table_elig_treat_redacted %>%
kable(row.names = FALSE,
align = c("l", rep("c", 13)),
booktabs=TRUE) %>%
kable_styling(position = "center", full_width = T, bootstrap_options = "striped", font_size = 13) %>%
#row_spec(1, bold = T) %>%
column_spec(1, bold = T, width = "10em") %>%
column_spec(2, width = "5em") %>%
column_spec(4, background = "lightgrey") %>%
add_header_above(., c(" ", "Eligible", "All" = 2, "Paxlovid" = 2, "Sotrovimab" = 2, "Remdesivir" = 2,
"Molnupiravir" = 2, "Casirivimab/imdevimab" = 2)) %>%
add_header_above(., c(" ", "", "Treated" = 12)) %>%
add_footnote(c("High risk cohorts are arranged in descending order, according to number of potentially eligible patients",
"All percentages (%) are caluclated with 95% confidence intervals"),
notation = "symbol") %>%
save_kable(file = "tables/table_prop_eligible_high_risk_cohort.png",
zoom = 1.5)
write_csv(table_elig_treat_redacted, here::here(output_dir_rmd, "tables", "table_prop_eligible_high_risk_cohort.csv"))
```
```{r, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Table 1 Count and proportion of potentially eligible patients in OpenSAFELY-TPP who have received treatment for COVID-19 between 11th December 2021 - 28th April 2022, broken down by high risk cohort and treatment type.** Patient counts of 0-7 are shown as <8 with remaining counts rounded to the nearest 10; as a result percentages may not add up to 100%", fig.topcaption=TRUE}
include_graphics(fs::path(output_dir_rmd, "tables", "table_prop_eligible_high_risk_cohort.png"))
```
### High risk patient cohorts <a name="hrc"></a>
The proportion of potentially eligible patients receiving treatment varied over time and by high risk cohort (Figure 3).
```{r, prop treatment plot, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Figure 3 Weekly proportion of eligible patients receiving an antiviral or nMAB for treating COVID-19 since 11th December 2021, stratified by high risk cohort.** Proportions are rounded to 2 decimal places.", fig.topcaption=TRUE}
max_date <- max(read_csv(here::here(input_dir_os, "table_prop_treated_redacted.csv"))$elig_start)
weekly_treatment_proportion <- read_csv(here::here(input_dir_os, "table_prop_treated_redacted.csv")) %>%
filter(!is.na(prop_redacted)) %>%
#elig_start != max_date
mutate(prop_redacted = ifelse(prop_redacted == 1, 0.99, prop_redacted)) %>%
mutate(high_risk_cohort = case_when(
high_risk_cohort == "all" ~ "All",
high_risk_cohort == "downs_syndrome" ~ "Down's syndrome",
high_risk_cohort == "sickle_cell_disease" ~ "Sickle cell disease",
high_risk_cohort == "solid_cancer" ~ "Solid cancer",
high_risk_cohort == "haematological_disease" ~ "Haematological diseases and stem cell transplant recipients",
high_risk_cohort == "renal_disease" ~ "Renal disease",
high_risk_cohort == "liver_disease" ~ "Liver disease",
high_risk_cohort == "imid" ~ "Immune-mediated inflammatory disorders",
high_risk_cohort == "immunosupression" ~ "Primary immune deficiencies",
high_risk_cohort == "hiv_aids" ~ "Immunosuppression due to HIV or AIDS",
high_risk_cohort == "solid_organ_transplant" ~ "Solid organ transplant recipients",
high_risk_cohort == "rare_neurological_conditions" ~ "Rare neurological conditions",
TRUE ~ NA_character_),
high_risk_cohort = unlist(lapply(strwrap(high_risk_cohort, width=30, simplify=FALSE), paste,
collapse="\n")))
plot_order <- weekly_treatment_proportion %>%
group_by(high_risk_cohort) %>%
mutate(order = max(prop_redacted, na.rm = T)) %>%
arrange(desc(order)) %>%
filter(prop_redacted == order) %>%
mutate(order = ifelse(high_risk_cohort == "All", 1, order)) %>%
select(high_risk_cohort, order) %>%
distinct() %>%
arrange(desc(order))
weekly_treatment_proportion <- weekly_treatment_proportion %>%
mutate(high_risk_cohort = factor(high_risk_cohort, levels = plot_order$high_risk_cohort))
weekly_treatment_proportion_plot <- weekly_treatment_proportion %>%
ggplot(aes(x = elig_start, y = prop_redacted, colour = high_risk_cohort, group = high_risk_cohort)) +
geom_line(size = 1) +
facet_wrap(~high_risk_cohort, scales = "free_y") +
theme_classic(base_size = 8) +
scale_x_date(limit = c(ymd("20211211"), ymd("20220502")),
date_breaks = "2 week", date_labels = "%d %b %Y") +
labs(
x = "",
y = "Proportion of eligble patients receiving treatment",
colour = "Treatment type",
title = "") +
theme(legend.position = "none") +
theme(
axis.text = element_text(size = 15),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.title = element_text(size = 20),
legend.text = element_text(size = 12),
legend.title=element_text(size=12, face = "bold"),
strip.text = element_text(size=12))
ggsave(
here::here(output_dir_rmd, "figures", "figure_prop_treatment.png"),
weekly_treatment_proportion_plot,
units = "cm", width = 35, height = 20
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_prop_treatment.png"))
```
### Key demographic and clinical characteristics of treated patients <a name="demographic"></a>
Table 2 shows the count and proportion of potentially eligible patients who received treatment for COVID-19 by `r format(report_stats$study_end, format = "%d-%b-%Y")`, broken down by demographic and clinical categories and by treatment type. The proportion treated varied by ethnicity, NHS Regions and by rurality. There was also lower coverage among care home residents, those with dementia, those with sickle cell disease, unvaccinated patients and in the most socioeconomically deprived areas. Patients who were housebound, or who had a severe mental illness also had a slightly reduced chance of being treated.
```{r, echo=FALSE, warning=FALSE, message=FALSE, out.width = '100%'}
table_elig_treat_redacted_all <-
read_csv(fs::path(input_dir_os, "table_elig_treat_redacted2.csv")) %>%
filter(high_risk_cohort == "All") %>%
add_column(Variable = "-", .after = "high_risk_cohort") %>%
rename(Group = high_risk_cohort, Eligible = Eligibile)
table_demo_clinc_breakdown_redacted <-
read_csv(fs::path(input_dir_os, "table_demo_clinc_breakdown_redacted.csv")) %>%
rename(Eligible = All,
Remdesivir = Remedesivir)
table_demo_clinc_breakdown_redacted <-
table_demo_clinc_breakdown_redacted %>%
add_row(table_elig_treat_redacted_all, .before = 1)
table_demo_clinc_breakdown_redacted <-
table_demo_clinc_breakdown_redacted %>%
mutate(Group = factor(Group,
levels = c("All", "ageband", "sex", "ethnicity", "imd", "rural_urban", "region_nhs", "autism_nhsd", "care_home_primis",
"dementia_nhsd", "learning_disability_primis", "serious_mental_illness_nhsd",
"housebound_opensafely", "shielded_primis", "sickle_cell_disease_nhsd", "vaccination_status"),
labels = c("All", "Age band", "Sex", "Ethnicity", "IMD", "Rurality", "Region", "Autism", "Care home", "Dementia",
"Learning disability ", "Serious mental illness", "Housebound", "CEV", "Sickle cell disease",
"Vaccination status")),
Variable = factor(Variable,
levels = c("-", "12-29", "30-39", "40-49", "50-59", "60-69", "70-79", "80+",
"Female", "Male" ,
"White", "Asian or Asian British", "Black or Black British", "Mixed", "Other ethnic groups",
"1 most deprived", "2", "3", "4", "5 least deprived",
"Urban - conurbation" , "Urban - city and town", "Rural - town and fringe",
"Rural - village and dispersed",
"East Midlands", "East of England", "London", "North East", "North West", "South East",
"South West", "West Midlands", "Yorkshire and the Humber",
"autism_nhsd", "care_home_primis",
"dementia_nhsd", "learning_disability_primis", "serious_mental_illness_nhsd",
"housebound_opensafely", "shielded_primis", "sickle_cell_disease_nhsd",
"Un-vaccinated (declined)", "Un-vaccinated" , "One vaccination", "Two vaccinations",
"Three or more vaccinations", "Unknown"),
labels = c("-", "12-29", "30-39", "40-49", "50-59", "60-69", "70-79", "80+",
"Female", "Male" ,
"White", "Asian or Asian British", "Black or Black British", "Mixed", "Other ethnic groups",
"1 most deprived", "2", "3", "4", "5 least deprived",
"Urban - conurbation" , "Urban - city and town", "Rural - town and fringe",
"Rural - village and dispersed",
"East Midlands", "East of England", "London", "North East", "North West", "South East",
"South West", "West Midlands", "Yorkshire and the Humber",
"Autism", "Care home", "Dementia", "Learning disability ", "Serious mental illness",
"Housebound", "CEV", "Sickle cell disease",
"Un-vaccinated (declined)", "Un-vaccinated" , "One vaccination", "Two vaccinations",
"Three or more vaccinations", "Unknown"))) %>%
arrange(Group, Variable) %>%
filter(!is.na(Variable)) %>%
mutate(Treated_perc = paste(round(Treated/Eligible*100, digits = 0), " (",
round((Treated/Eligible - 1.96*sqrt((Treated/Eligible)*(1-Treated/Eligible)/Eligible))*100, digits = 0),
"-",
round((Treated/Eligible + 1.96*sqrt((Treated/Eligible)*(1-Treated/Eligible)/Eligible))*100, digits = 0),
")",
sep = ""),
Paxlovid_perc = paste(round(Paxlovid/Treated*100, digits = 0), " (",
round((Paxlovid/Treated - 1.96*sqrt((Paxlovid/Treated)*(1-Paxlovid/Treated)/Treated))*100, digits = 0),
"-",
round((Paxlovid/Treated + 1.96*sqrt((Paxlovid/Treated)*(1-Paxlovid/Treated)/Treated))*100, digits = 0),
")",
sep = ""),
Sotrovimab_perc = paste(round(Sotrovimab/Treated*100, digits = 0), " (",
round((Sotrovimab/Treated - 1.96*sqrt((Sotrovimab/Treated)*(1-Sotrovimab/Treated)/Treated))*100,
digits = 0),
"-",
round((Sotrovimab/Treated + 1.96*sqrt((Sotrovimab/Treated)*(1-Sotrovimab/Treated)/Treated))*100,
digits = 0),
")",
sep = ""),
Remdesivir_perc = paste(round(Remdesivir/Treated*100, digits = 0), " (",
round((Remdesivir/Treated - 1.96*sqrt((Remdesivir/Treated)*(1-Remdesivir/Treated)/Treated))*100,
digits = 0),
"-",
round((Remdesivir/Treated + 1.96*sqrt((Remdesivir/Treated)*(1-Remdesivir/Treated)/Treated))*100,
digits = 0),
")",
sep = ""),
Molnupiravir_perc = paste(round(Molnupiravir/Treated*100, digits = 0), " (",
round((Molnupiravir/Treated-1.96*sqrt((Molnupiravir/Treated)*(1-Molnupiravir/Treated)/Treated))*100,
digits = 0),
"-",
round((Molnupiravir/Treated + 1.96*sqrt((Molnupiravir/Treated)*(1-Molnupiravir/Treated)/Treated))*100,
digits = 0),
")",
sep = ""),
Casirivimab_perc = paste(round(Casirivimab/Treated*100, digits = 0), " (",
round((Casirivimab/Treated - 1.96*sqrt((Casirivimab/Treated)*(1-Casirivimab/Treated)/Treated))*100,
digits = 0),
"-",
round((Casirivimab/Treated + 1.96*sqrt((Casirivimab/Treated)*(1-Casirivimab/Treated)/Treated))*100,
digits = 0),
")",
sep = "")) %>%
select(Group, Variable, Eligible, Treated, Treated_perc, Paxlovid, Paxlovid_perc, Sotrovimab, Sotrovimab_perc, Remdesivir,
Remdesivir_perc, Molnupiravir, Molnupiravir_perc, Casirivimab, Casirivimab_perc) %>%
mutate(Eligible = ifelse(is.na(Eligible), "<8", Eligible),
Treated = ifelse(is.na(Treated), "<8", Treated),
Treated_perc = ifelse(Treated_perc == "NA (NA-NA)", "--", Treated_perc),
Paxlovid = ifelse(is.na(Paxlovid), "<8", Paxlovid),
Paxlovid_perc = ifelse(Paxlovid_perc == "NA (NA-NA)", "--", Paxlovid_perc),
Sotrovimab = ifelse(is.na(Sotrovimab), "<8", Sotrovimab),
Sotrovimab_perc = ifelse(Sotrovimab_perc == "NA (NA-NA)", "--", Sotrovimab_perc),
Remdesivir = ifelse(is.na(Remdesivir), "<8", Remdesivir),
Remdesivir_perc = ifelse(Remdesivir_perc == "NA (NA-NA)", "--", Remdesivir_perc),
Molnupiravir = ifelse(is.na(Molnupiravir), "<8", Molnupiravir),
Molnupiravir_perc = ifelse(Molnupiravir_perc == "NA (NA-NA)", "--", Molnupiravir_perc),
Casirivimab = ifelse(is.na(Casirivimab), "<8", Casirivimab),
Casirivimab_perc = ifelse(Casirivimab_perc == "NA (NA-NA)", "--", Casirivimab_perc))
colnames(table_demo_clinc_breakdown_redacted) <- c("Group", "Variable", "Count", "Count", "%", "Count", "%",
"Count", "%", "Count", "%", "Count", "%",
"Count", "%")
table_demo_clinc_breakdown_redacted %>%
kable(row.names = FALSE,
align = c("l", "l", rep("c", 11)),
booktabs=TRUE) %>%
kable_styling(position = "center", full_width = T, bootstrap_options = "striped", font_size = 13) %>%
column_spec(1, bold = T, width = "2em") %>%
column_spec(2, bold = T, width = "2em") %>%
column_spec(5, background = "lightgrey") %>%
add_header_above(., c(" ", "", "Eligible", "All" = 2, "Paxlovid" = 2, "Sotrovimab" = 2, "Remdesivir" = 2,
"Molnupiravir" = 2, "Casirivimab/imdevimab" = 2)) %>%
add_header_above(., c(" ", "", "", "Treated" = 12)) %>%
add_footnote(c("All percentages (%) are caluclated with 95% confidence intervals"),
notation = "symbol") %>%
save_kable(file = "tables/table_prop_eligible_clinc_demo.png",
zoom = 1.5)
write_csv(table_demo_clinc_breakdown_redacted, here::here(output_dir_rmd, "tables", "table_prop_eligible_clinc_demo.csv"))
```
```{r, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "***Table 2 Count and proportion of potentially eligible patients in OpenSAFELY-TPP who have received treatment for COVID-19 between 11th December 2021 and 28th April 2022, broken down by demographic and clinical categories and by treatment type.** Patient counts of 0-7 are shown as <8 with remaining counts rounded to the nearest 10; as a result percentages may not add up to 100%.", fig.topcaption=TRUE}
include_graphics(fs::path(output_dir_rmd, "tables", "table_prop_eligible_clinc_demo.png"))
```
### Consistency with guidance <a name="concordance"></a>
Of the `r format(report_stats$treated_patients, big.mark = ",", scientific = FALSE)` patients who received treatment for COVID-19 between `r format(report_stats$study_start, format = "%d-%b-%Y")` and `r format(report_stats$study_end, format = "%d-%b-%Y")`, `r format(as.numeric(flowchart_non_elig[1,2]), big.mark = ",", scientific = FALSE)` (`r round(as.numeric(flowchart_non_elig[1,2])/report_stats$treated_patients*100, digits = 0)`%) patients were missing records needed to confirm eligibility; `r round(as.numeric(subset(flowchart_non_elig, criteria == "c_no_positive_covid_test")$n)/report_stats$treated_patients*100, digits = 0)`% did not have evidence of a positive SARS-CoV-2 test, `r round(as.numeric(subset(flowchart_non_elig, criteria == "c_no_high_risk_group_nhsd")$n)/report_stats$treated_patients*100, digits = 0)`% did not have a high risk cohort identified from their GP records alone, and `r round(as.numeric(subset(flowchart_non_elig, criteria == "c_hosp_admission_and_not_discharged_on_or_before_pos_test")$n)/report_stats$treated_patients*100, digits = 0)`% were admitted to the hospital on or before their date of positive test but were not discharged on or before that date. There were also a small number of other potential inconsistencies with guidance for patients who received treatment, such as having a potential contraindication to the treatment given (Figure 3).
```{r non_elig, echo=FALSE, warning=FALSE, message=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Figure 3 Breakdown of possible inconsistencies with guidance on eligibility/exclusion criteria in treated COVID-19 patients.** Treatment eligibility window for Paxlovid, sotrovimab and molnupiravir was 5 days from positive SARS-CoV-2 test (used as a proxy for symptom onset date) and 7 days for remdesivir.", fig.topcaption=TRUE}
flowchart_non_elig_plot <- flowchart_non_elig[-c(1,8,9,10),] %>%
mutate(criteria2 = c("No positive SARS-CoV-2 test record",
"Positive SARS-CoV-2 test record in previous 30 days",
"Record of COVID-19-associated hospitalisation in previous 30 days",
"No high risk cohort identified within GP records",
"High risk cohort identified within GP records does not match clinician-assigned high risk group",
"Hospitalised on or before date of positive test and not discharged on or before that date",
"Non symptomatic positive SARS-CoV-2 test record",
"Treated with Paxlovid outside of treatment eligibility window",
"Treated with Paxlovid and in renal or liver high risk cohort",
"Treated with Paxlovid aged under 18",
"Treated with Paxlovid and pregnant",
"Treated with sotrovimab outside of treatment eligibility window",
"Treated with sotrovimab aged under 12",
"Treated with sotrovimab weight under 40kg",
"Treated with remdesivir outside of treatment eligibility window",
"Treated with remdesivir aged under 12",
"Treated with remdesivir weight under 40kg",
"Treated with molnupiravir outside of treatment eligibility window",
"Treated with molnupiravir and pregnant")) %>%
filter(n != 0) %>%
mutate(n = as.numeric(ifelse(n == "<8", 8, n))) %>%
filter(#criteria != "c_no_high_risk_group_match",
#criteria != "c_no_high_risk_group_nhsd",
criteria != "c_not_symptomatic_covid_test",
criteria != "c_pregnancy_molnupiravir",
criteria != "c_covid_hosp_admission_previous_30_days",
criteria != "c_any_covid_hospital_admission_last_30_days",
criteria != "c_positive_covid_test_previous_30_days",
criteria != "c_pregnancy_paxlovid",
criteria != "c_pregnancy_molnupiravir",
criteria != "c_pregnancy_paxlovid") %>%
#group_by(criteria3) %>%
#summarise(n = sum(n)) %>%
arrange(desc(n))
flowchart_non_elig_plot$criteria2 = unlist(lapply(strwrap(flowchart_non_elig_plot$criteria2, width=30, simplify=FALSE), paste,
collapse="\n"))
flowchart_non_elig_plot <- flowchart_non_elig_plot %>%
mutate(criteria2 = factor(criteria2, levels = unique(flowchart_non_elig_plot$criteria2)))
flowchart_non_elig_plot <- flowchart_non_elig_plot %>%
ggplot() +
geom_col(aes(x = criteria2, y = n, fill = criteria2)) +
theme_classic(base_size = 8) +
labs(x = "",
y = "Number of patients receiving treatment",
colour = "",
title = "") +
theme(legend.position = "none",
axis.text.x = element_text(angle = 60, hjust = 1),
axis.text = element_text(size = 12),
axis.title = element_text(size = 15),
strip.text = element_text(size=12))
ggsave(
here::here(output_dir_rmd, "figures", "figure_non_elig_breakdown.png"),
flowchart_non_elig_plot,
units = "cm", width = 30, height = 30
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_non_elig_breakdown.png"))
```
### Time to treatment <a name="time"></a>
```{r, echo=FALSE, warning=FALSE, message=FALSE, include=FALSE}
data_time_between <- read_csv(fs::path(input_dir_os, "table_time_to_treat_redacted.csv")) %>%
filter(treatment_type %in% c("Paxlovid", "Sotrovimab", "Molnupiravir"))
tbt_num <- data_time_between %>%
filter(high_risk_cohort == "All",
(tb >= 0 & tb <= 5 & treatment_type %in% c("Paxlovid", "Sotrovimab", "Molnupiravir")) |
(tb >= 0 & tb <= 7 & treatment_type %in% c("Remdesivir"))) %>%
summarise(n = sum(n, na.rm = T))
```
Overall, of the `r format(report_stats$treated_patients, big.mark = ",", scientific = FALSE)` patients who received treatment, `r round(tbt_num$n/report_stats$treated_patients*100, digits = 0)`% did so within the respective treatment-specific eligibility window as estimated from test date (as symptom date is not consistently available) (Figure 4).
```{r time to treatment, echo=FALSE, warning=FALSE, message=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Figure 4 Time (number of days) between positive SARS-CoV-2 test and treatment for COVID-19, broken down by (a) treatment type and (b) high risk cohort.** Treatment types are restricted to the three most commonly used treatments.", fig.topcaption=TRUE}
data_time_between$treatment_type = unlist(lapply(strwrap(data_time_between$treatment_type, width=20, simplify=FALSE), paste,
collapse="\n"))
data_time_between_plot <- data_time_between %>%
filter(high_risk_cohort == "All",
!is.na(tb),
!is.na(n)) %>%
mutate(tb = factor(tb, levels = -2:6, labels = c("-2 or less", -1, 0, 1, 2, 3, 4, 5, "6 or more"))) %>%
ggplot(aes(tb)) +
geom_col(aes(x = tb, y = n, fill = treatment_type, group = treatment_type), position = "dodge") +
theme_bw(base_size = 8) +
facet_wrap(~treatment_type, ncol = 4) +
theme(legend.position = "none") +
labs(x = "",
y = "Number of patients receiving treatment",
colour = "High risk cohort",
title = "(a)") +
theme(legend.position = "none",
legend.title = element_blank(),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.text = element_text(size = 15),
axis.title = element_text(size = 15),
strip.text = element_text(size=12),
plot.title = element_text(size=20, face="bold"))
ggsave(
here::here(output_dir_rmd, "figures", "figure_time_to_treatment_types.png"),
data_time_between_plot,
units = "cm", width = 30, height = 15
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_time_to_treatment_types.png"))
```
<br>
```{r time to treatment 2, echo=FALSE, warning=FALSE, message=FALSE, results='asis', fig.width=10, fig.height=8, out.width = '80%', fig.align='center'}
data_time_between <- read_csv(fs::path(input_dir_os, "table_time_to_treat_redacted.csv"))
time_groups <- data_time_between %>%
filter(!is.na(high_risk_cohort),
!is.na(n)) %>%
mutate(tb = factor(tb, levels = -2:6, labels = c("-2 or less", -1, 0, 1, 2, 3, 4, 5, "6 or more"))) %>%
mutate(high_risk_cohort = case_when(
high_risk_cohort == "All" ~ "All",
high_risk_cohort == "downs_syndrome" ~ "Down's syndrome",
high_risk_cohort == "sickle_cell_disease" ~ "Sickle cell disease",
high_risk_cohort == "solid_cancer" ~ "Solid cancer",
high_risk_cohort == "haematological_disease" ~ "Haematological diseases and stem cell transplant recipients",
high_risk_cohort == "renal_disease" ~ "Renal disease",
high_risk_cohort == "liver_disease" ~ "Liver disease",
high_risk_cohort == "imid" ~ "Immune-mediated inflammatory disorders",
high_risk_cohort == "immunosupression" ~ "Immune deficiencies",
high_risk_cohort == "hiv_aids" ~ "Immunosuppression due to HIV or AIDS",
high_risk_cohort == "solid_organ_transplant" ~ "Solid organ transplant recipients",
high_risk_cohort == "rare_neurological_conditions" ~ "Rare neurological conditions",
TRUE ~ NA_character_)) %>%
mutate(high_risk_cohort = unlist(lapply(strwrap(high_risk_cohort, width=30, simplify=FALSE), paste, collapse="\n")))
plot_order <- time_groups %>%
group_by(high_risk_cohort) %>%
mutate(order = max(n, na.rm = T)) %>%
arrange(desc(order)) %>%
filter(n == order) %>%
select(high_risk_cohort, order) %>%
distinct()
time_groups <- time_groups %>%
mutate(high_risk_cohort = factor(high_risk_cohort, levels = plot_order$high_risk_cohort))
data_time_between_plot <- time_groups %>%
arrange(high_risk_cohort, tb) %>%
ggplot(aes(tb)) +
geom_col(aes(x = tb, y = n, fill = high_risk_cohort, group = high_risk_cohort), position = "dodge") +
theme_bw(base_size = 8) +
facet_wrap(~high_risk_cohort, scales = "free_y", ncol = 3) +
theme(legend.position = "none") +
labs(x = "Time between positive SARS-CoV-2 test and treatment for COVID-19 (days)",
y = "Number of patients receiving treatment",
colour = "High risk cohort") +
theme(legend.position = "none",
axis.text = element_text(size = 15),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.title = element_text(size = 20),
strip.text = element_text(size=12),
plot.title = element_text(size=20, face="bold")) +
scale_y_continuous(labels = comma)
ggsave(
here::here(output_dir_rmd, "figures", "figure_time_to_treatment_cohort.png"),
data_time_between_plot,
units = "cm", width = 30, height = 30
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_time_to_treatment_cohort.png"))
```
<br>
### COVID-19 Medicines Delivery Units <a name="stp"></a>
Details of all COVID-19 Medicines Delivery Units (CMDUs) can be found on the . As data on CMDU was not available, Sustainability and Transformation Plan (STP), which has almost a 1:1 mapping, was used as a proxy.
Details of all CMDUs can be found on the [national website](https://digital.nhs.uk/coronavirus/covid-medicine-delivery-unit-directory?key=h58vqkRUup40o27K04xOrtfh7ZXqwRQoOLhXTkGWlbOrVSkwzfTeetw39uGFlc28). As data on CMDU was not available, Sustainability and Transformation Plan (STP), which has almost a 1:1 mapping, was used as a proxy to identify any variation in the proportion of patients treated between CMDUs. Note, the subset of the population covered by TPP in each STP may not be representative of the whole STP and STPs were only included if they had greater than 10% population coverage in TPP practices. Practice-STP mappings, used to calculate the coverage, were calculated as of March 2020 and it is likely that since then some borders and population sizes may have changed.
<br>
```{r, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%', fig.cap = "**Figure 5 Weekly proportion of eligible patients receiving an antiviral or nMAB for treating COVID-19 since 11th December 2021, stratified by STP decile.**", fig.topcaption=TRUE}
proportion_stp_decile <- read_csv(here::here(input_dir_os, "stp_decile_values_weekly.csv"))
# maximum over time in first decile
proportion_stp_decile %>%
filter(decile == 0.1) %>%
summarise(max(decile_value))
# maximum over time in ninth decile
proportion_stp_decile %>%
filter(decile == 0.9) %>%
summarise(max(decile_value))
proportion_stp_decile <-
proportion_stp_decile %>%
mutate(line = ifelse(decile == "0.5", "Median", "Decile")) %>% # median different line type
ggplot(aes(x = week, y = decile_value, group = decile)) +
geom_line(aes(colour = line, linetype = line)) +
scale_color_manual(values = c("Decile" = "blue", "Median" = "blue")) +
scale_linetype_manual(values = c("Decile" = "dashed", "Median" = "solid")) +
theme_classic(base_size = 8) +
scale_x_date(limit = c(ymd("20211211"), ymd("20220502")),
date_breaks = "2 week", date_labels = "%d %b %Y") +
labs(
x = "Week",
y = "Decile value of proportion of eligible patients who received treatment",
title = "") +
theme(legend.position = "bottom",
legend.title = element_blank()) +
theme(
axis.text = element_text(size = 10),
axis.text.x = element_text(angle = 60, hjust = 1),
axis.title = element_text(size = 10),
axis.line.x = element_line(colour = "black"),
panel.grid.minor.x = element_blank()) +
scale_y_continuous(labels = comma)
ggsave(
here::here(output_dir_rmd, "figures", "figure_proportion_stp_decile.jpg"),
proportion_stp_decile,
units = "cm", width = 30, height = 15
)
include_graphics(fs::path(output_dir_rmd, "figures", "figure_proportion_stp_decile.png"))
```
<!-- **Table 3 Count and proportion of potentially eligible patients in OpenSAFELY-TPP who have received treatment for COVID-19 since 11th December 2021, broken down by STP decile and treatment type.** Counts <8 have been redacted and counts >7 are rounded to the nearest 10; as a result percentages may not add up to 100%." -->
<!-- ```{r, echo=FALSE, message=FALSE, warning=FALSE, results='asis', fig.width=10, out.width = '100%'} -->
<!-- table_elig_treat_redacted <- read_csv(here::here(input_dir_os, "table_stp.csv")) -->
<!-- colnames(table_elig_treat_redacted) <- c("STP Decile", "Count", "Count", "%", "Count", "%", -->
<!-- "Count", "%", "Count", "%", "Count", "%", -->
<!-- "Count", "%") -->
<!-- table_elig_treat_redacted %>% -->
<!-- kable(row.names = FALSE, -->
<!-- align = c("l", rep("c", 13)), -->
<!-- booktabs=TRUE) %>% -->
<!-- kable_styling(position = "center", full_width = T, bootstrap_options = "striped", font_size = 10) %>% -->
<!-- #row_spec(1, bold = T) %>% -->
<!-- column_spec(1, bold = T, width = "10em") %>% -->
<!-- column_spec(2, width = "5em") %>% -->
<!-- column_spec(4, background = "lightgrey") %>% -->
<!-- add_header_above(., c(" ", "Eligible", "All" = 2, "Paxlovid" = 2, "Sotrovimab" = 2, "Remdesivir" = 2, -->
<!-- "Molnupiravir" = 2, "Casirivimab" = 2)) %>% -->
<!-- add_header_above(., c(" ", "", "Treated" = 12)) %>% -->
<!-- add_footnote(c("All percentages (%) are caluclated with 95% confidence intervals"), -->
<!-- notation = "symbol") -->
<!-- ``` -->
<br>
# Methods <a name="methods"></a>
Full methods in code form can be found in the accompanying [antibody-and-antiviral-deployment repository](https://github.com/opensafely/antibody-and-antiviral-deployment) and are also described in our paper, linked above. Brief methods are given below.
### Data sources
All data were analysed securely through OpenSAFELY-TPP [https://opensafely.org](https://opensafely.org) which contains the full pseudonymised primary care records for all patients currently registered with general practices using TPP SystmOne software (approximately 23.4 million, 40% of the English population). Data were linked with accident and emergency (A&E) attendance and in-patient records from NHS Digital; national coronavirus testing records from the Second Generation Surveillance System (SGSS); and the “COVID-19 therapeutics dataset”, a patient-level dataset on antiviral and nMAB treatments from NHS England, derived from software used to notify NHS England of COVID-19 treatments.
### Study population
##### Base population
- Patients with either a positive SARS-CoV-2 test on or after 11th December 2021 (this is the earliest date that a patient could have tested positive and still been eligible for receiving treatment when they became available from CMDUs from 11th December 2021) or with a treatment record on or after 11th December 2021, who were also registered at the time of their test/treatment.
- Patients aged under 12 or with an unknown date of birth were excluded.
##### Eligible patients
Where possible eligibility criteria were applied as per the Interim Clinical Commissioning Policy for non-hospitalised COVID-19 patients (NHSE, 28/01/2022) this included:
- SARS-CoV-2 infection confirmed by a PCR or lateral flow test
- being a member of a high risk cohort (determined by applying the detailed codelists and logic from NHS Digital as far as possible)
There were two main differences to the official criteria in our implementation. Firstly, prior to 10th February 2022, infection should have been confirmed by a PCR test, however this was then relaxed to include lateral flow tests. We were not able to always distinguish between lateral flow and PCR tests in all test records, and therefore included all positive SARS-CoV-2 test results. Secondly, having symptomatic COVID-19 was also an eligibility criteria: however due to difficulties in determining symptom status (i.e. it was only possible to determine whether a patient’s positive test had a “symptomatic” flag at the time of the test, but not whether symptoms developed later) we did not implement this requirement in our analysis; however we do address this in a separate sensitivity analysis, where we restricted the potentially eligible population to only those with a “symptomatic” flag associated with their positive SARS-CoV-2 test to determine its use as an indicator of being potentially asymptomatic.We also included patients in the eligible population if they were in the Treated cohort below.
##### Treated patients
- Treatments and the date they were given were identified in the COVID-19 therapeutics dataset, restricted to those treated in the community (“non_hospitalised”)
- Patients issued more than one treatment within two weeks of one another, or with an implausible treatment date (e.g. far in the future) were excluded
### Key demographic and clinical characteristics
We classified treated patients by age group, sex, NHS region of their general practice and other key demographics including ethnicity and the level of deprivation. Deprivation was measured by Index of Multiple Deprivation (IMD), in quintiles, derived from the patient’s postcode at lower super output area level for a high degree of precision. Ethnicity was ascertained using 270 clinical codes grouped into broad categories White, Black or Black British, Asian or Asian British, Mixed, Other, and Unknown. Individuals with missing sex, ethnicity, IMD or region were included as “Unknown”. Treated patients were described according to whether they were in other groups of interest who are sometimes subject to variation in care, including autism, dementia, learning disability, serious mental illness, care home residents, and housebound. In addition we classified treated patients by their COVID-19 vaccination status (unvaccinated, unvaccinated with a record of declining vaccination, one vaccination, two vaccinations, or three or more).
### Consistency with guidance
For patients who received treatment but who were not otherwise identified as potentially being eligible for treatment, we report which eligibility or exclusion criteria were not met according to the data available (i.e. no positive SARS-CoV-2 test result, or not identified as part of a high risk group). Where possible within available data, we also report other potential inconsistencies with guidance for patients who received treatment, such as where the high risk cohort identified within their records did not match the high risk cohort associated with their treatment.
We also assess consistency with treatment-specific criteria, such as patients having a recorded contraindication to the specific treatment given (e.g. adolescents treated with sotrovimab/remdesivir with weight under 40kg, Table S2), or patients treated outside the prescribed timescale, 5-7 days from symptom onset, depending on the treatment. As symptom onset date was not available, here we used positive SARS-CoV-2 test as a proxy to estimate the extent to which patients may or may not have been treated outside the guidance time window.
### Descriptive statistics
We generated charts showing the cumulative number of potentially eligible and treated patients per week, stratified by high risk group, and also stratified by treatment type for treated patients. We used simple descriptive statistics to summarise the counts and proportions of potentially eligible patients treated, stratified by treatment type and either high risk cohort or clinical and demographic groups, and to describe potential inconsistencies with guidelines. Charts and results not presented in this manuscript are available online for inspection in the associated Github [antibody-and-antiviral-deployment](https://github.com/opensafely/antibody-and-antiviral-deployment) repository. Patient counts of 0-7 are shown as “<8” with remaining counts rounded to the nearest 10 to protect against small number differences in our routinely updating data. All percentages (%) are calculated with 95% confidence intervals (CI).
### Codelists
Detailed information on compilation and sources for every individual codelist are available at https://www.opencodelists.org/.