1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 21:22:01 +02:00
This commit is contained in:
2019-05-11 23:30:10 +02:00
parent 68cc7ef0d0
commit fcc77164e9
11 changed files with 223 additions and 324 deletions

View File

@ -26,7 +26,7 @@
#'
#' \code{system.file("translations.tsv", package = "AMR")}
#'
#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation suggestion}{by creating a new issue on our repository}.
#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}.
#'
#' The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
#' @inheritSection AMR Read more on our website!

View File

@ -321,15 +321,12 @@ mdro <- function(x,
& !ab_missing(CIP)
& !ab_missing(CAZ)
& !ab_missing(TZP) ) {
tbl_ <- tbl_ %>% mutate(
psae = 0,
psae = ifelse(MEM == "R" | IPM == "R", psae + 1, psae),
psae = ifelse(GEN == "R" & TOB == "R", psae + 1, psae),
psae = ifelse(CIP == "R", psae + 1, psae),
psae = ifelse(CAZ == "R", psae + 1, psae),
psae = ifelse(TZP == "R", psae + 1, psae),
psae = ifelse(is.na(psae), 0, psae)
)
tbl_$psae <- 0
tbl_[which(tbl_[, MEM] == "R" | tbl_[, IPM] == "R"), "psae"] <- 1 + tbl_[which(tbl_[, MEM] == "R" | tbl_[, IPM] == "R"), "psae"]
tbl_[which(tbl_[, GEN] == "R" & tbl_[, TOB] == "R"), "psae"] <- 1 + tbl_[which(tbl_[, GEN] == "R" & tbl_[, TOB] == "R"), "psae"]
tbl_[which(tbl_[, CIP] == "R"), "psae"] <- 1 + tbl_[which(tbl_[, CIP] == "R"), "psae"]
tbl_[which(tbl_[, CAZ] == "R"), "psae"] <- 1 + tbl_[which(tbl_[, CAZ] == "R"), "psae"]
tbl_[which(tbl_[, TZP] == "R"), "psae"] <- 1 + tbl_[which(tbl_[, TZP] == "R"), "psae"]
} else {
tbl_$psae <- 0
}

View File

@ -33,8 +33,8 @@
#' @name WHOCC
#' @rdname WHOCC
#' @examples
#' as.atc("meropenem")
#' atc_name("J01DH02")
#' as.ab("meropenem")
#' ab_name("J01DH02")
#'
#' atc_tradenames("flucloxacillin")
#' ab_tradenames("flucloxacillin")
NULL