1
0
mirror of https://github.com/msberends/AMR.git synced 2026-05-31 19:41:51 +02:00
This commit is contained in:
2026-05-01 19:05:14 +02:00
parent b6d80f9578
commit d805fece8c
4 changed files with 18 additions and 21 deletions

View File

@@ -200,6 +200,12 @@ interpretive_rules <- function(x,
add_MO_lookup_to_AMR_env()
if (guideline %like% "EUCAST") {
guideline <- "EUCAST"
} else if (guideline %like% "CLSI") {
guideline <- "CLSI"
}
if ("custom" %in% rules && is.null(custom_rules)) {
warning_("in {.help [{.fun interpretive_rules}](AMR::interpretive_rules)}: no custom rules were set with the {.arg custom_rules} argument",
immediate = TRUE
@@ -619,18 +625,9 @@ interpretive_rules <- function(x,
} else if (!is.null(list(...)$eucast_rules_df)) {
# deprecated parameter name kept for backward compatibility
interpretive_rules_df_total <- list(...)$eucast_rules_df
} else if (exists("INTERPRETIVE_RULES_DF", envir = asNamespace("AMR"), inherits = FALSE)) {
} else {
# internal data file, created in data-raw/_pre_commit_checks.R
interpretive_rules_df_total <- INTERPRETIVE_RULES_DF
} else {
# transitional fallback: sysdata.rda predates the rename from EUCAST_RULES_DF
# re-run data-raw/_pre_commit_checks.R to regenerate sysdata.rda
interpretive_rules_df_total <- EUCAST_RULES_DF
interpretive_rules_df_total$rule.provider <- "EUCAST"
interpretive_rules_df_total <- interpretive_rules_df_total[
, c("rule.provider", setdiff(colnames(interpretive_rules_df_total), "rule.provider")),
drop = FALSE
]
}
## filter on guideline provider and user-set guideline versions ----