@@ -31,6 +31,8 @@ result <- purrr::map(csv_files, \(x){
31
31
omopgenerics::bind() |>
32
32
omopgenerics::newSummarisedResult()
33
33
34
+ result$additional_level <- gsub("&&&\\s+&&&", "&&& NULL &&&", result$additional_level)
35
+
34
36
resultList <- resultList |>
35
37
purrr::map(\(x) {
36
38
omopgenerics::settings(result) |>
@@ -115,9 +117,10 @@ outcome_counts <- data[["incidence"]] |>
115
117
estimate_value = as.numeric(estimate_value)
116
118
)
117
119
118
- ggplot2::ggplot(outcome_counts, ggplot2::aes(x = outcome_cohort_name , y = estimate_value, fill = outcome_cohort_name )) +
120
+ ggplot2::ggplot(outcome_counts, ggplot2::aes(x = cdm_name , y = estimate_value, fill = cdm_name )) +
119
121
ggplot2::geom_bar(stat = "identity", colour = "black") +
120
- ggplot2::facet_wrap(~ cdm_name, scales = "free") +
122
+ paletteer::scale_fill_paletteer_d("vapoRwave::vapoRwave") +
123
+ ggplot2::facet_wrap(~ outcome_cohort_name, scales = "free") +
121
124
ggplot2::theme(axis.text.x = ggplot2::element_blank())
122
125
```
123
126
@@ -139,23 +142,90 @@ char_3 <- data[["summarise_characteristics"]] |>
139
142
estimate_value = as.numeric(estimate_value)
140
143
) |>
141
144
dplyr::filter(estimate_name == "percentage",
142
- estimate_value >= 10 )
145
+ estimate_value >= 5 )
143
146
144
147
ggplot2::ggplot(char_3, ggplot2::aes(x = variable_level, y = estimate_value, fill = variable_level)) +
145
148
ggplot2::geom_bar(stat = "identity", colour = "black") +
149
+ paletteer::scale_fill_paletteer_d("vapoRwave::vapoRwave") +
146
150
ggplot2::facet_wrap(~ cdm_name + group_level, scales = "free") +
147
151
ggplot2::theme(axis.text.x = ggplot2::element_blank())
148
152
```
149
153
154
+
155
+ ``` {r prior use 2, echo=FALSE, message = FALSE, warning = FALSE}
156
+ char_3 <- data[["summarise_characteristics"]] |>
157
+ dplyr::filter(variable_name == "Antibiotics (-14 to -1)",
158
+ strata_level == "overall") |>
159
+ dplyr::mutate(cdm_name = dplyr::case_when(
160
+ cdm_name == "IDRIL_1" ~ "Lancs",
161
+ cdm_name == "LTHT" ~ "Leeds",
162
+ cdm_name == "Barts Health" ~ "Barts",
163
+ .default = cdm_name
164
+ ),
165
+ group_level = stringr::str_replace(group_level, "^\\d+_", ""),
166
+ group_level = stringr::str_to_sentence(group_level), # capitalize first letter
167
+ variable_level = stringr::str_replace(variable_level, "^\\d+ ", ""), # remove leading digits and underscore
168
+ variable_level = stringr::str_to_sentence(variable_level), # capitalize first letter
169
+ estimate_value = as.numeric(estimate_value)
170
+ ) |>
171
+ dplyr::filter(estimate_name == "percentage",
172
+ !is.na(estimate_value),
173
+ estimate_value >= 5)
174
+
175
+ ggplot2::ggplot(char_3, ggplot2::aes(x = cdm_name, y = estimate_value, fill = variable_level)) +
176
+ ggplot2::geom_bar(stat = "identity", colour = "black") +
177
+ ggplot2::facet_wrap(~ group_level, scales = "free") +
178
+ ggplot2::theme(
179
+ axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1)
180
+ ) +
181
+ ggplot2::ggtitle("Prior use of access antibiotics (-14 to -1)") +
182
+ ggplot2::xlab("Database") +
183
+ ggplot2::ylab("Percentage of Records") +
184
+ ggplot2::labs(fill = "Access antibiotics") +
185
+ paletteer::scale_fill_paletteer_d("vapoRwave::vapoRwave")
186
+ ```
187
+ ``` {r prior use 3, echo=FALSE, message = FALSE, warning = FALSE}
188
+ char_3 <- data[["summarise_characteristics"]] |>
189
+ dplyr::filter(variable_name == "Antibiotics (-14 to -1)",
190
+ strata_level == "overall") |>
191
+ dplyr::mutate(cdm_name = dplyr::case_when(
192
+ cdm_name == "IDRIL_1" ~ "Lancs",
193
+ cdm_name == "LTHT" ~ "Leeds",
194
+ cdm_name == "Barts Health" ~ "Barts",
195
+ .default = cdm_name
196
+ ),
197
+ group_level = stringr::str_replace(group_level, "^\\d+_", ""),
198
+ group_level = stringr::str_to_sentence(group_level), # capitalize first letter
199
+ variable_level = stringr::str_replace(variable_level, "^\\d+ ", ""), # remove leading digits and underscore
200
+ variable_level = stringr::str_to_sentence(variable_level), # capitalize first letter
201
+ estimate_value = as.numeric(estimate_value)
202
+ ) |>
203
+ dplyr::filter(estimate_name == "percentage",
204
+ !is.na(estimate_value),
205
+ estimate_value >= 5)
206
+
207
+ ggplot2::ggplot(char_3, ggplot2::aes(x = cdm_name, y = estimate_value, fill = variable_level)) +
208
+ ggplot2::geom_bar(stat = "identity", colour = "black", position = "dodge") +
209
+ ggplot2::facet_wrap(~ group_level, scales = "free") +
210
+ ggplot2::theme(
211
+ axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1)
212
+ ) +
213
+ ggplot2::ggtitle("Prior use of access antibiotics (-14 to -1)") +
214
+ ggplot2::xlab("Database") +
215
+ ggplot2::ylab("Percentage of Records") +
216
+ ggplot2::labs(fill = "Access antibiotics") +
217
+ paletteer::scale_fill_paletteer_d("vapoRwave::vapoRwave")
218
+ ```
150
219
## Figure 3 - Indications
151
220
152
221
``` {r indications, echo=FALSE, message = FALSE, warning = FALSE}
153
222
char_4 <- data[["summarise_characteristics"]] |>
154
223
dplyr::filter(variable_name == "Indication flag",
155
224
strata_level == "overall") |>
156
225
dplyr::mutate(cdm_name = dplyr::case_when(
157
- cdm_name == "IDRIL_1" ~ "Lancashire ",
226
+ cdm_name == "IDRIL_1" ~ "Lancs ",
158
227
cdm_name == "LTHT" ~ "Leeds",
228
+ cdm_name == "Barts Health" ~ "Barts",
159
229
.default = cdm_name
160
230
),
161
231
group_level = stringr::str_replace(group_level, "^\\d+_", ""), # remove leading digits and underscore
@@ -165,14 +235,51 @@ char_4 <- data[["summarise_characteristics"]] |>
165
235
estimate_value = as.numeric(estimate_value)
166
236
) |>
167
237
dplyr::filter(estimate_name == "percentage",
168
- estimate_value >= 10)
238
+ estimate_value >= 5)
239
+
240
+ ggplot2::ggplot(char_4, ggplot2::aes(x = cdm_name, y = estimate_value, fill = variable_level)) +
241
+ ggplot2::geom_bar(stat = "identity", colour = "black", position = "dodge") +
242
+ ggplot2::facet_wrap(~ group_level, scales = "free") +
243
+ ggplot2::theme(
244
+ axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1)
245
+ ) +
246
+ ggplot2::ggtitle("Indications of Use") +
247
+ ggplot2::xlab("Database") +
248
+ ggplot2::ylab("Percentage of Records") +
249
+ ggplot2::labs(fill = "Indications") +
250
+ paletteer::scale_fill_paletteer_d("MetBrewer::Signac")
251
+ ```
252
+ ``` {r indications 2, echo=FALSE, message = FALSE, warning = FALSE}
253
+ char_4 <- data[["summarise_characteristics"]] |>
254
+ dplyr::filter(variable_name == "Indication flag",
255
+ strata_level == "overall") |>
256
+ dplyr::mutate(cdm_name = dplyr::case_when(
257
+ cdm_name == "IDRIL_1" ~ "Lancs",
258
+ cdm_name == "LTHT" ~ "Leeds",
259
+ cdm_name == "Barts Health" ~ "Barts",
260
+ .default = cdm_name
261
+ ),
262
+ group_level = stringr::str_replace(group_level, "^\\d+_", ""), # remove leading digits and underscore
263
+ group_level = stringr::str_to_sentence(group_level), # capitalize first letter
264
+ variable_level = stringr::str_replace(variable_level, "^\\d+ ", ""), # remove leading digits and underscore
265
+ variable_level = stringr::str_to_sentence(variable_level), # capitalize first letter
266
+ estimate_value = as.numeric(estimate_value)
267
+ ) |>
268
+ dplyr::filter(estimate_name == "percentage",
269
+ estimate_value >= 5)
169
270
170
- ggplot2::ggplot(char_4, ggplot2::aes(x = group_level , y = estimate_value, fill = group_level )) +
271
+ ggplot2::ggplot(char_4, ggplot2::aes(x = cdm_name , y = estimate_value, fill = variable_level )) +
171
272
ggplot2::geom_bar(stat = "identity", colour = "black") +
172
- ggplot2::facet_wrap(~ cdm_name + variable_level, scales = "free") +
173
- ggplot2::theme(axis.text.x = ggplot2::element_blank())
273
+ ggplot2::facet_wrap(~ group_level, scales = "free") +
274
+ ggplot2::theme(
275
+ axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust = 1)
276
+ ) +
277
+ ggplot2::ggtitle("Indications of Use") +
278
+ ggplot2::xlab("Database") +
279
+ ggplot2::ylab("Percentage of Records") +
280
+ ggplot2::labs(fill = "Indications") +
281
+ paletteer::scale_fill_paletteer_d("MetBrewer::Signac")
174
282
```
175
-
176
283
## Figure 4 - Incidence of Ciprofloxacin Use
177
284
178
285
``` {r incidence, echo=FALSE, message = FALSE, warning = FALSE}
0 commit comments