mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 13:42:04 +02:00
mdro and 1st isolate improvements
This commit is contained in:
@ -119,11 +119,18 @@ test_that("first isolates work", {
|
||||
|
||||
# errors
|
||||
expect_error(first_isolate("date", "patient_id", col_mo = "mo"))
|
||||
expect_error(first_isolate(septic_patients))
|
||||
expect_error(first_isolate(septic_patients,
|
||||
col_date = "non-existing col",
|
||||
col_mo = "mo"))
|
||||
|
||||
# look for columns itself
|
||||
expect_message(first_isolate(septic_patients))
|
||||
expect_message(first_isolate(septic_patients %>%
|
||||
mutate(mo = as.character(mo)) %>%
|
||||
left_join_microorganisms(),
|
||||
col_genus = "genus",
|
||||
col_species = "species"))
|
||||
|
||||
# if mo is not an mo class, result should be the same
|
||||
expect_identical(septic_patients %>%
|
||||
mutate(mo = as.character(mo)) %>%
|
||||
|
@ -20,7 +20,7 @@ test_that("MDRO works", {
|
||||
|
||||
# septic_patients should have these finding using Dutch guidelines
|
||||
expect_equal(outcome %>% freq() %>% pull(count),
|
||||
c(2, 14)) # 2 unconfirmed, 14 positive
|
||||
c(1167, 817, 14, 2)) # 1167 not eval., 817 neg, 14 pos, 2 unconfirmed
|
||||
|
||||
expect_equal(BRMO(septic_patients, info = FALSE), MDRO(septic_patients, "nl", info = FALSE))
|
||||
|
||||
|
Reference in New Issue
Block a user