From b8d7c8af7fa0236cad585dc77ed2537696b04fc4 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Thu, 15 May 2025 13:07:47 +0200 Subject: [PATCH] (v2.1.1.9277) mdro fix --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/mdro.R | 31 +++++++++++++++++-------------- man/mdro.Rd | 12 ++++++------ 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1a3daa0e4..cd955d89a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 2.1.1.9276 +Version: 2.1.1.9277 Date: 2025-05-15 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index 28539fc53..96842ff12 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.1.1.9276 +# AMR 2.1.1.9277 *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://amr-for-r.org/#get-this-package).)* diff --git a/R/mdro.R b/R/mdro.R index 34b5d3a96..5ac62f2e7 100755 --- a/R/mdro.R +++ b/R/mdro.R @@ -56,19 +56,19 @@ #' #' Currently supported guidelines are (case-insensitive): #' -#' * `guideline = "CMI2012"` (default) +#' * `guideline = "CMI 2012"` (default) #' #' Magiorakos AP, Srinivasan A *et al.* "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (\doi{10.1111/j.1469-0691.2011.03570.x}) #' -#' * `guideline = "EUCAST3.3"` (or simply `guideline = "EUCAST"`) +#' * `guideline = "EUCAST 3.3"` (or simply `guideline = "EUCAST"`) #' #' The European international guideline - EUCAST Expert Rules Version 3.3 "Intrinsic Resistance and Unusual Phenotypes" ([link](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2021/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.3_20211018.pdf)) #' -#' * `guideline = "EUCAST3.2"` +#' * `guideline = "EUCAST 3.2"` #' #' The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" ([link](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf)) #' -#' * `guideline = "EUCAST3.1"` +#' * `guideline = "EUCAST 3.1"` #' #' The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" ([link](https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf)) #' @@ -80,7 +80,7 @@ #' #' The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7; \doi{10.1186/s13756-015-0047-6} #' -#' * `guideline = "BRMO"` +#' * `guideline = "BRMO 2024"` (or simply `guideline = "BRMO"`) #' #' The Dutch national guideline - Samenwerkingverband Richtlijnen Infectiepreventie (SRI) (2024) "Bijzonder Resistente Micro-Organismen (BRMO)" ([link](https://www.sri-richtlijnen.nl/brmo)) #' @@ -183,7 +183,7 @@ #' } #' } mdro <- function(x = NULL, - guideline = "CMI2012", + guideline = "CMI 2012", col_mo = NULL, esbl = NA, carbapenemase = NA, @@ -220,8 +220,10 @@ mdro <- function(x = NULL, meet_criteria(only_sir_columns, allow_class = "logical", has_length = 1) - if (!isTRUE(only_sir_columns) && (!any(is.sir(x)) || !any(is_sir_eligible(x)))) { - stop_("There were no possible SIR columns found in the data set. Transform columns with `as.sir()` for valid antimicrobial interpretations.") + if (isTRUE(only_sir_columns) && !any(is.sir(x))) { + stop_("There were no SIR columns found in the data set, despite `only_sir_columns` being `TRUE`. Transform columns with `as.sir()` for valid antimicrobial interpretations.") + } else if (!isTRUE(only_sir_columns) && !any(is.sir(x)) && !any(is_sir_eligible(x))) { + stop_("There were no eligible SIR columns found in the data set. Transform columns with `as.sir()` for valid antimicrobial interpretations.") } # get gene values as TRUE/FALSE @@ -382,14 +384,15 @@ mdro <- function(x = NULL, # turn into latest EUCAST guideline guideline <- "eucast3.3" } - if (guideline == "nl") { - guideline <- "brmo" + if (guideline %in% c("nl", "brmo")) { + # turn into latest BRMO guideline + guideline <- "brmo2024" } if (guideline == "de") { guideline <- "mrgn" } stop_ifnot( - guideline %in% c("brmo", "mrgn", "eucast3.1", "eucast3.2", "eucast3.3", "tb", "cmi2012"), + guideline %in% c("brmo2017", "brmo2024", "mrgn", "eucast3.1", "eucast3.2", "eucast3.3", "tb", "cmi2012"), "invalid guideline: ", guideline.bak ) guideline <- list(code = guideline) @@ -447,7 +450,7 @@ mdro <- function(x = NULL, guideline$version <- NA_character_ guideline$source_url <- paste0("Antimicrobial Resistance and Infection Control 4:7, 2015; ", font_url("https://doi.org/10.1186/s13756-015-0047-6", "doi: 10.1186/s13756-015-0047-6")) guideline$type <- "MRGNs" - } else if (guideline$code == "brmo") { + } else if (guideline$code == "brmo2024") { combine_SI <- TRUE # I must not be considered resistant guideline$name <- "Bijzonder Resistente Micro-organismen (BRMO)" guideline$author <- "Samenwerkingsverband Richtlijnen Infectiepreventie (SRI)" @@ -1520,7 +1523,7 @@ mdro <- function(x = NULL, x[which(x$MDRO == 3), "reason"] <- "4MRGN" } - if (guideline$code == "brmo") { + if (guideline$code == "brmo2024") { # Netherlands 2024 -------------------------------------------------------- aminoglycosides <- c(GEN, TOB, AMK) # note 4: gentamicin or tobramycin or amikacin aminoglycosides_serratia_marcescens <- GEN # note 4: TOB and AMK do not count towards S. marcescens @@ -2189,7 +2192,7 @@ mdr_cmi2012 <- function(x = NULL, only_sir_columns = any(is.sir(x)), verbose = F "guideline" %in% names(list(...)), "argument `guideline` must not be set since this is a guideline-specific function" ) - mdro(x = x, only_sir_columns = only_sir_columns, verbose = verbose, guideline = "CMI2012", ...) + mdro(x = x, only_sir_columns = only_sir_columns, verbose = verbose, guideline = "CMI 2012", ...) } #' @rdname mdro diff --git a/man/mdro.Rd b/man/mdro.Rd index d0f31b13f..c5c09e54f 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -19,7 +19,7 @@ See the supported guidelines above for the \link{list} of publications used for this function. } \usage{ -mdro(x = NULL, guideline = "CMI2012", col_mo = NULL, esbl = NA, +mdro(x = NULL, guideline = "CMI 2012", col_mo = NULL, esbl = NA, carbapenemase = NA, mecA = NA, mecC = NA, vanA = NA, vanB = NA, info = interactive(), pct_required_classes = 0.5, combine_SI = TRUE, verbose = FALSE, only_sir_columns = any(is.sir(x)), ...) @@ -100,16 +100,16 @@ For the \code{pct_required_classes} argument, values above 1 will be divided by Currently supported guidelines are (case-insensitive): \itemize{ -\item \code{guideline = "CMI2012"} (default) +\item \code{guideline = "CMI 2012"} (default) Magiorakos AP, Srinivasan A \emph{et al.} "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (\doi{10.1111/j.1469-0691.2011.03570.x}) -\item \code{guideline = "EUCAST3.3"} (or simply \code{guideline = "EUCAST"}) +\item \code{guideline = "EUCAST 3.3"} (or simply \code{guideline = "EUCAST"}) The European international guideline - EUCAST Expert Rules Version 3.3 "Intrinsic Resistance and Unusual Phenotypes" (\href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2021/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.3_20211018.pdf}{link}) -\item \code{guideline = "EUCAST3.2"} +\item \code{guideline = "EUCAST 3.2"} The European international guideline - EUCAST Expert Rules Version 3.2 "Intrinsic Resistance and Unusual Phenotypes" (\href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/2020/Intrinsic_Resistance_and_Unusual_Phenotypes_Tables_v3.2_20200225.pdf}{link}) -\item \code{guideline = "EUCAST3.1"} +\item \code{guideline = "EUCAST 3.1"} The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{https://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link}) \item \code{guideline = "TB"} @@ -118,7 +118,7 @@ The international guideline for multi-drug resistant tuberculosis - World Health \item \code{guideline = "MRGN"} The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7; \doi{10.1186/s13756-015-0047-6} -\item \code{guideline = "BRMO"} +\item \code{guideline = "BRMO 2024"} (or simply \code{guideline = "BRMO"}) The Dutch national guideline - Samenwerkingverband Richtlijnen Infectiepreventie (SRI) (2024) "Bijzonder Resistente Micro-Organismen (BRMO)" (\href{https://www.sri-richtlijnen.nl/brmo}{link})