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

(v1.3.0.9034) eucast_rules summary fix

This commit is contained in:
2020-09-29 10:40:25 +02:00
parent 36ec8b0d81
commit 68e6e1e329
20 changed files with 83 additions and 44 deletions

View File

@ -0,0 +1,32 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
context("atc_online.R")
test_that("atc_online works", {
skip_on_cran()
skip_if_not(curl::has_internet())
expect_gte(length(atc_online_groups(ab_atc("AMX"))), 1)
expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "O"), 1.5)
expect_equal(atc_online_ddd(ab_atc("AMX"), administration = "P"), 3)
expect_warning(atc_online_ddd(ab_atc("Novobiocin"), administration = "P"))
})

View File

@ -97,6 +97,12 @@ test_that("mic2rsi works", {
guideline = "EUCAST")),
"I")
# cutoffs at MIC = 8
expect_equal(as.rsi(as.mic(2), "E. coli", "ampicillin", guideline = "EUCAST 2020"),
as.rsi("S"))
expect_equal(as.rsi(as.mic(32), "E. coli", "ampicillin", guideline = "EUCAST 2020"),
as.rsi("R"))
expect_true(example_isolates %>%
mutate(amox_mic = as.mic(2)) %>%
select(mo, amox_mic) %>%