mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 09:31:58 +02:00
WHONET/EARS-Net support
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
context("atc.R")
|
||||
|
||||
test_that("as.atc works", {
|
||||
expect_equal(suppressWarnings(as.character(guess_atc(c("J01FA01",
|
||||
expect_equal(suppressWarnings(as.character(as.atc(c("J01FA01",
|
||||
"Erythromycin",
|
||||
"eryt",
|
||||
"ERYT",
|
||||
@ -45,4 +45,8 @@ test_that("as.atc works", {
|
||||
expect_equal(as.character(as.atc(c("nitro", "cipro"))),
|
||||
c("J01XE01", "J01MA02"))
|
||||
|
||||
# EARS-Net
|
||||
expect_equal(as.character(as.atc("AMX")),
|
||||
"J01CA04")
|
||||
|
||||
})
|
||||
|
@ -160,7 +160,7 @@ test_that("first isolates work", {
|
||||
|
||||
# look for columns itself
|
||||
expect_message(first_isolate(septic_patients))
|
||||
expect_error(first_isolate(septic_patients %>%
|
||||
expect_message(first_isolate(septic_patients %>%
|
||||
mutate(mo = as.character(mo)) %>%
|
||||
left_join_microorganisms()))
|
||||
|
||||
|
@ -33,4 +33,13 @@ test_that("guess_ab_col works", {
|
||||
"tetr")
|
||||
expect_equal(guess_ab_col(septic_patients, "TETR"),
|
||||
"tetr")
|
||||
|
||||
df <- data.frame(AMP_ND10 = "R",
|
||||
AMC_ED20 = "S")
|
||||
expect_equal(guess_ab_col(df, "ampicillin"),
|
||||
"AMP_ND10")
|
||||
expect_equal(guess_ab_col(df, "J01CR02"),
|
||||
"AMC_ED20")
|
||||
expect_equal(guess_ab_col(df, as.atc("augmentin")),
|
||||
"AMC_ED20")
|
||||
})
|
||||
|
Reference in New Issue
Block a user