1
0
mirror of https://github.com/msberends/AMR.git synced 2026-02-10 00:33:05 +01:00

(v3.0.1.9020) unit test fixes

This commit is contained in:
2026-02-09 13:16:36 +01:00
parent ba4c159154
commit 499c830ee7
9 changed files with 42 additions and 30 deletions

View File

@@ -164,9 +164,9 @@ format_eucast_version_nr <- function(version, markdown = TRUE) {
#' eucast_dosage(c("tobra", "genta", "cipro"), "iv", version_breakpoints = 10)
interpretive_rules <- function(x,
col_mo = NULL,
guideline = getOption("AMR_guideline", "EUCAST"),
info = interactive(),
rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")),
guideline = getOption("AMR_guideline", "EUCAST"),
verbose = FALSE,
version_breakpoints = 15.0,
version_expected_phenotypes = 1.2,
@@ -190,6 +190,11 @@ interpretive_rules <- function(x,
meet_criteria(custom_rules, allow_class = "custom_eucast_rules", allow_NULL = TRUE)
meet_criteria(overwrite, allow_class = "logical", has_length = 1)
stop_if(
guideline == "CLSI",
"CLSI guideline is not yet supported."
)
stop_if(
!is.na(ampc_cephalosporin_resistance) && !any(c("expert", "all") %in% rules),
"For the `ampc_cephalosporin_resistance` argument to work, the `rules` argument must contain `\"expert\"` or `\"all\"`."
@@ -1103,20 +1108,24 @@ interpretive_rules <- function(x,
#' @rdname interpretive_rules
#' @export
eucast_rules <- function(x,
col_mo = NULL,
info = interactive(),
rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")),
...) {
if (!is.null(getOption("AMR_eucastrules", default = NULL))) {
warning_("The global option `AMR_eucastrules` that you have set is now invalid was ignored - set `AMR_interpretive_rules` instead. See `?AMR-options`.")
}
interpretive_rules(x = x, guideline = "EUCAST", rules = rules, ...)
interpretive_rules(x = x, col_mo = col_mo, info = info, rules = rules, guideline = "EUCAST", ...)
}
#' @rdname interpretive_rules
#' @export
clsi_rules <- function(x,
col_mo = NULL,
info = interactive(),
rules = getOption("AMR_interpretive_rules", default = c("breakpoints", "expected_phenotypes")),
...) {
interpretive_rules(x = x, guideline = "CLSI", rules = rules, ...)
interpretive_rules(x = x, col_mo = col_mo, info = info, rules = rules, guideline = "CLSI", ...)
}
# helper function for editing the table ----