1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 19:01:50 +02:00

completely updated antibiotics

This commit is contained in:
2022-10-30 14:31:45 +01:00
parent 3d9faf89cf
commit d40e0ef20b
60 changed files with 102028 additions and 95116 deletions

View File

@ -27,12 +27,12 @@
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
# last updated: 20 January 2020 - Loinc_2.67
# last updated: 30 October 2022 - Loinc_2.73
# Steps to reproduce:
# 1. Create a fake account at https://loinc.org (sad you have to create one...)
# 2. Download the CSV from https://loinc.org/download/loinc-table-file-csv/ (Loinc_2.67_Text_2.67.zip)
# 3. Read Loinc.csv that's in this zip file
# 2. Download the CSV from https://loinc.org/download/loinc-complete/ (Loinc_2.67_Text_2.67.zip)
# 3. Read Loinc.csv that's in zip folder LoincTable
loinc_df <- read.csv("data-raw/Loinc.csv",
row.names = NULL,
stringsAsFactors = FALSE
@ -51,6 +51,7 @@ ab_names <- antibiotics %>%
antibiotics$loinc <- as.list(rep(NA_character_, nrow(antibiotics)))
for (i in seq_len(nrow(antibiotics))) {
message(i)
loinc_ab <- loinc_df %>%
filter(COMPONENT %like% paste0("^", antibiotics$name[i])) %>%
pull(LOINC_NUM)
@ -64,6 +65,8 @@ for (i in 1:nrow(antibiotics)) {
antibiotics[i, "loinc"][[1]] <- ifelse(length(syn[!syn == ""]) == 0, list(""), list(loinc))
}
# remember to update R/aa_globals.R for the documentation
dim(antibiotics) # for R/data.R
usethis::use_data(antibiotics, overwrite = TRUE)
rm(antibiotics)