mirror of
https://github.com/msberends/AMR.git
synced 2025-08-27 17:02:12 +02:00
new Norwegian link
This commit is contained in:
@@ -4,7 +4,7 @@ library(tidyr)
|
||||
library(AMR)
|
||||
# we need J01, J02 and J04 (J03 does not exist)
|
||||
|
||||
url <- "https://www.whocc.no/atc_ddd_index/?code={code}&showdescription=no"
|
||||
url <- "https://atcddd.fhi.no/atc_ddd_index/?code={code}&showdescription=no"
|
||||
complete_vector <- character(0)
|
||||
for (Jxx in c("J01", "J02", "J04")) {
|
||||
site <- gsub("{code}", Jxx, url, fixed = TRUE)
|
||||
|
@@ -761,9 +761,9 @@ updated_atc <- as.list(antibiotics$atc)
|
||||
|
||||
get_atcs <- function(ab_name, type = "human") {
|
||||
if (type == "human") {
|
||||
url <- "https://www.whocc.no/atc_ddd_index/"
|
||||
url <- "https://atcddd.fhi.no/atc_ddd_index/"
|
||||
} else if (type == "veterinary") {
|
||||
url <- "https://www.whocc.no/atcvet/atcvet_index/"
|
||||
url <- "https://atcddd.fhi.no/atcvet/atcvet_index/"
|
||||
} else {
|
||||
stop("invalid type")
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ library(rvest)
|
||||
# get all data from the WHOCC website
|
||||
get_atc_table <- function(atc_group) {
|
||||
# give as input J0XXX, like atc_group = "J05AB"
|
||||
downloaded <- read_html(paste0("https://www.whocc.no/atc_ddd_index/?code=", atc_group, "&showdescription=no"))
|
||||
downloaded <- read_html(paste0("https://atcddd.fhi.no/atc_ddd_index/?code=", atc_group, "&showdescription=no"))
|
||||
table_title <- downloaded %>%
|
||||
html_nodes(paste0('a[href^="./?code=', atc_group, '&"]')) %>%
|
||||
html_text()
|
||||
@@ -62,7 +62,7 @@ get_atc_table <- function(atc_group) {
|
||||
)
|
||||
}
|
||||
|
||||
# these are the relevant groups for input: https://www.whocc.no/atc_ddd_index/?code=J05A (J05 only contains J05A)
|
||||
# these are the relevant groups for input: https://atcddd.fhi.no/atc_ddd_index/?code=J05A (J05 only contains J05A)
|
||||
atc_groups <- c("J05AA", "J05AB", "J05AC", "J05AD", "J05AE", "J05AF", "J05AG", "J05AH", "J05AJ", "J05AP", "J05AR", "J05AX")
|
||||
|
||||
# get the first
|
||||
|
Reference in New Issue
Block a user