1
0
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:
2019-01-29 00:06:50 +01:00
parent f6336fdd89
commit 6aae206320
83 changed files with 1428 additions and 633 deletions

View File

@ -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")
})

View File

@ -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()))

View File

@ -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")
})