2018-04-18 12:24:54 +02:00
|
|
|
context("mdro.R")
|
|
|
|
|
|
|
|
|
|
|
|
test_that("MDRO works", {
|
|
|
|
library(dplyr)
|
|
|
|
|
2018-04-25 15:33:58 +02:00
|
|
|
outcome <- MDRO(septic_patients, "EUCAST", info = FALSE)
|
|
|
|
# check class
|
|
|
|
expect_equal(outcome %>% class(), c('ordered', 'factor'))
|
|
|
|
|
|
|
|
outcome <- MDRO(septic_patients, "nl", info = FALSE)
|
2018-04-18 12:24:54 +02:00
|
|
|
# check class
|
|
|
|
expect_equal(outcome %>% class(), c('ordered', 'factor'))
|
|
|
|
|
|
|
|
# septic_patients should have these finding using Dutch guidelines
|
2018-07-01 21:40:37 +02:00
|
|
|
expect_equal(outcome %>% freq() %>% pull(count), c(3, 21))
|
2018-04-18 12:24:54 +02:00
|
|
|
|
|
|
|
expect_equal(BRMO(septic_patients, info = FALSE), MDRO(septic_patients, "nl", info = FALSE))
|
|
|
|
|
|
|
|
})
|