1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 18:41:58 +02:00

new MOs, cleanup

This commit is contained in:
2018-09-01 21:19:46 +02:00
parent 5965d3c794
commit 75fe4d401f
20 changed files with 166 additions and 179 deletions

View File

@ -20,7 +20,6 @@ test_that("EUCAST rules work", {
"ENTAER"), # Enterobacter aerogenes
amox = "R", # Amoxicillin
stringsAsFactors = FALSE)
expect_warning(EUCAST_rules(a, info = FALSE))
expect_identical(suppressWarnings(EUCAST_rules(a, info = FALSE)), b)
expect_identical(suppressWarnings(interpretive_reading(a, info = TRUE)), b)

View File

@ -124,10 +124,15 @@ test_that("first isolates work", {
col_date = "non-existing col",
col_mo = "mo"))
expect_warning(septic_patients %>%
# if mo is not an mo class, result should be the same
expect_identical(septic_patients %>%
mutate(mo = as.character(mo)) %>%
first_isolate(col_date = "date",
col_mo = "mo",
col_patient_id = "patient_id"))
col_patient_id = "patient_id"),
septic_patients %>%
first_isolate(col_date = "date",
col_mo = "mo",
col_patient_id = "patient_id"))
})

View File

@ -11,6 +11,7 @@ test_that("as.mo works", {
expect_equal(as.character(as.mo(" ESCCOL ")), "ESCCOL")
expect_equal(as.character(as.mo("klpn")), "KLEPNE")
expect_equal(as.character(as.mo("Klebsiella")), "KLE")
expect_equal(as.character(as.mo("K. pneu rhino")), "KLEPNERH") # K. pneumoniae subspp. rhinoscleromatis
expect_equal(as.character(as.mo("coagulase negative")), "STACNS")
expect_equal(as.character(as.mo("P. aer")), "PSEAER") # not Pasteurella aerogenes