mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 11:51:59 +02:00
(v1.2.0.9017) ab_from_text() improvement
This commit is contained in:
@ -54,6 +54,8 @@ test_that("as.ab works", {
|
||||
|
||||
expect_equal(as.character(as.ab("Amoxy + clavulaanzuur")),
|
||||
"AMC")
|
||||
|
||||
expect_message(as.ab("cipro mero"))
|
||||
|
||||
# assigning and subsetting
|
||||
x <- antibiotics$ab
|
||||
|
@ -23,10 +23,10 @@ context("ab_from_text.R")
|
||||
|
||||
test_that("ab_from_text works", {
|
||||
|
||||
expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds"),
|
||||
expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds")[[1]],
|
||||
as.ab("Amoxicillin"))
|
||||
expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds", translate_ab = TRUE)[[1]],
|
||||
"Amoxicillin")
|
||||
expect_identical(ab_from_text("28/03/2020 regular amoxicilliin 500mg po tds", translate_ab = FALSE),
|
||||
as.ab("AMX"))
|
||||
expect_identical(ab_from_text("administered amoxi/clav and cipro", collapse = ", "),
|
||||
"Amoxicillin, Ciprofloxacin")
|
||||
expect_identical(ab_from_text("administered amoxi/clav and cipro", collapse = ", ")[[1]],
|
||||
"AMX, CIP")
|
||||
})
|
||||
|
Reference in New Issue
Block a user