mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 19:41:49 +02:00
(v1.2.0.9022) as.ab() improvement
This commit is contained in:
@ -40,7 +40,7 @@ test_that("as.ab works", {
|
||||
expect_output(print(as.ab("amox")))
|
||||
expect_output(print(data.frame(a = as.ab("amox"))))
|
||||
|
||||
expect_warning(as.ab("Z00ZZ00")) # not yet available in data set
|
||||
expect_warning(as.ab("J00AA00")) # ATC not yet available in data set
|
||||
expect_warning(as.ab("UNKNOWN"))
|
||||
expect_warning(as.ab(""))
|
||||
|
||||
@ -55,8 +55,11 @@ test_that("as.ab works", {
|
||||
expect_equal(as.character(as.ab("Amoxy + clavulaanzuur")),
|
||||
"AMC")
|
||||
|
||||
expect_equal(as.character(as.ab(c("mreopenem", "co-maoxiclav"))),
|
||||
c("MEM", "AMC"))
|
||||
|
||||
expect_message(as.ab("cipro mero"))
|
||||
|
||||
|
||||
# assigning and subsetting
|
||||
x <- antibiotics$ab
|
||||
expect_s3_class(x[1], "ab")
|
||||
|
@ -28,7 +28,7 @@ test_that("ab_from_text works", {
|
||||
expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds", translate_ab = TRUE)[[1]],
|
||||
"Amoxicillin")
|
||||
expect_identical(ab_from_text("administered amoxi/clav and cipro", collapse = ", ")[[1]],
|
||||
"AMX, CIP")
|
||||
"AMC, CIP")
|
||||
|
||||
expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds", type = "dose")[[1]],
|
||||
500)
|
||||
|
Reference in New Issue
Block a user