1
0
mirror of https://github.com/msberends/AMR.git synced 2025-09-16 22:29:43 +02:00

implement ecoffs

This commit is contained in:
2023-06-22 10:07:33 +02:00
parent 55b98ede4c
commit 3083828e15
11 changed files with 57 additions and 32 deletions

View File

@@ -166,15 +166,13 @@ expect_identical(mo_ref("Chlamydia psittaci"), "Garcia-Lopez et al., 2019")
expect_identical(mo_ref("Chlamydophila psittaci", keep_synonyms = TRUE), "Everett et al., 1999")
expect_true(112283007 %in% mo_snomed("Escherichia coli")[[1]])
# old codes must throw a warning in mo_* family
# expect_warning(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
# outcome of mo_fullname must always return the fullname from the data set
x <- data.frame(
mo = microorganisms$mo,
# fullname from the original data:
f1 = microorganisms$fullname,
# newly created fullname based on MO code:
f2 = mo_fullname(microorganisms$mo, language = "en"),
f2 = mo_fullname(microorganisms$mo, language = "en", keep_synonyms = TRUE),
stringsAsFactors = FALSE
)
expect_equal(nrow(subset(x, f1 != f2)), 0)

View File

@@ -142,6 +142,10 @@ expect_equal(
suppressMessages(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020")),
as.sir("S")
)
expect_equal(
suppressMessages(as.sir(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020", ecoff = TRUE)),
as.sir("S")
)
expect_equal(
suppressMessages(as.sir(as.mic(32), "E. coli", "ampicillin", guideline = "EUCAST 2020")),
as.sir("R")