mirror of
https://github.com/msberends/AMR.git
synced 2024-12-26 05:26:13 +01:00
misc
This commit is contained in:
parent
915d4db23b
commit
8a603876d2
@ -45,10 +45,10 @@
|
|||||||
#' stringsAsFactors = FALSE)
|
#' stringsAsFactors = FALSE)
|
||||||
#' a
|
#' a
|
||||||
#'
|
#'
|
||||||
#' b <- EUCAST_rules(a)
|
#' b <- EUCAST_rules(a, "bactid")
|
||||||
#' b
|
#' b
|
||||||
EUCAST_rules <- function(tbl,
|
EUCAST_rules <- function(tbl,
|
||||||
col_bactcode = 'bactid',
|
col_bactcode,
|
||||||
info = TRUE,
|
info = TRUE,
|
||||||
amcl = 'amcl',
|
amcl = 'amcl',
|
||||||
amik = 'amik',
|
amik = 'amik',
|
||||||
|
6
R/atc.R
6
R/atc.R
@ -128,7 +128,7 @@ atc_property <- function(atc_code,
|
|||||||
#' Name of an antibiotic
|
#' Name of an antibiotic
|
||||||
#'
|
#'
|
||||||
#' Convert antibiotic codes (from a laboratory information system like MOLIS or GLIMS) to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from \code{\link{ablist}}.
|
#' Convert antibiotic codes (from a laboratory information system like MOLIS or GLIMS) to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from \code{\link{ablist}}.
|
||||||
#' @param abcode a code or name, like \code{"amox"}, \code{"cftr"} or \code{"J01CA04"}
|
#' @param abcode a code or name, like \code{"AMOX"}, \code{"AMCL"} or \code{"J01CA04"}
|
||||||
#' @param from,to type to transform from and to. See \code{\link{ablist}} for its column names.
|
#' @param from,to type to transform from and to. See \code{\link{ablist}} for its column names.
|
||||||
#' @param textbetween text to put between multiple returned texts
|
#' @param textbetween text to put between multiple returned texts
|
||||||
#' @param tolower return output as lower case with function \code{\link{tolower}}.
|
#' @param tolower return output as lower case with function \code{\link{tolower}}.
|
||||||
@ -146,7 +146,7 @@ atc_property <- function(atc_code,
|
|||||||
#' abname(c("AMCL", "GENT"))
|
#' abname(c("AMCL", "GENT"))
|
||||||
#' # "amoxicillin and enzyme inhibitor" "gentamicin"
|
#' # "amoxicillin and enzyme inhibitor" "gentamicin"
|
||||||
#'
|
#'
|
||||||
#' abname("AMCL", to = "trivial")
|
#' abname("AMCL", to = "trivial_nl")
|
||||||
#' # "Amoxicilline/clavulaanzuur"
|
#' # "Amoxicilline/clavulaanzuur"
|
||||||
#'
|
#'
|
||||||
#' abname("AMCL", to = "atc")
|
#' abname("AMCL", to = "atc")
|
||||||
@ -210,7 +210,7 @@ abname <- function(abcode, from = 'umcg', to = 'official', textbetween = ' + ',
|
|||||||
select(to) %>%
|
select(to) %>%
|
||||||
slice(1) %>%
|
slice(1) %>%
|
||||||
as.character()
|
as.character()
|
||||||
if (j > 1 & to %in% c('official', 'trivial')) {
|
if (j > 1 & to %in% c('official', 'trivial_nl')) {
|
||||||
drug.group[j] <- drug.group[j] %>% tolower()
|
drug.group[j] <- drug.group[j] %>% tolower()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
R/data.R
2
R/data.R
@ -26,7 +26,7 @@
|
|||||||
#' \item{\code{umcg}}{UMCG code, like \code{AMCL}}
|
#' \item{\code{umcg}}{UMCG code, like \code{AMCL}}
|
||||||
#' \item{\code{official}}{Official name by the WHO, like \code{"amoxicillin and enzyme inhibitor"}}
|
#' \item{\code{official}}{Official name by the WHO, like \code{"amoxicillin and enzyme inhibitor"}}
|
||||||
#' \item{\code{official_nl}}{Official name in the Netherlands, like \code{"Amoxicilline met enzymremmer"}}
|
#' \item{\code{official_nl}}{Official name in the Netherlands, like \code{"Amoxicilline met enzymremmer"}}
|
||||||
#' \item{\code{trivial}}{Trivial name in Dutch, like \code{"Amoxicilline/clavulaanzuur"}}
|
#' \item{\code{trivial_nl}}{Trivial name in Dutch, like \code{"Amoxicilline/clavulaanzuur"}}
|
||||||
#' \item{\code{oral_ddd}}{Daily Defined Dose (DDD) according to the WHO, oral treatment}
|
#' \item{\code{oral_ddd}}{Daily Defined Dose (DDD) according to the WHO, oral treatment}
|
||||||
#' \item{\code{oral_units}}{Units of \code{ddd_units}}
|
#' \item{\code{oral_units}}{Units of \code{ddd_units}}
|
||||||
#' \item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}
|
#' \item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}
|
||||||
|
@ -254,7 +254,8 @@ rsi <- function(ab1, ab2 = NA, interpretation = 'IR', minimum = 30, percent = FA
|
|||||||
#' @examples
|
#' @examples
|
||||||
#' \dontrun{
|
#' \dontrun{
|
||||||
#' # use it directly:
|
#' # use it directly:
|
||||||
#' rsi_predict(tbl[which(first_isolate == TRUE & genus == "Haemophilus"),], col_ab = "amcl", coldate = "date")
|
#' rsi_predict(tbl = tbl[which(first_isolate == TRUE & genus == "Haemophilus"),],
|
||||||
|
#' col_ab = "amcl", coldate = "date")
|
||||||
#'
|
#'
|
||||||
#' # or with dplyr so you can actually read it:
|
#' # or with dplyr so you can actually read it:
|
||||||
#' library(dplyr)
|
#' library(dplyr)
|
||||||
|
BIN
data/ablist.rda
BIN
data/ablist.rda
Binary file not shown.
@ -13,22 +13,21 @@ EUCAST Expert Rules Version 2.0: \cr
|
|||||||
\url{http://www.eucast.org/expert_rules_and_intrinsic_resistance}
|
\url{http://www.eucast.org/expert_rules_and_intrinsic_resistance}
|
||||||
}
|
}
|
||||||
\usage{
|
\usage{
|
||||||
EUCAST_rules(tbl, col_bactcode = "bactid", info = TRUE, amcl = "amcl",
|
EUCAST_rules(tbl, col_bactcode, info = TRUE, amcl = "amcl", amik = "amik",
|
||||||
amik = "amik", amox = "amox", ampi = "ampi", azit = "azit",
|
amox = "amox", ampi = "ampi", azit = "azit", aztr = "aztr",
|
||||||
aztr = "aztr", cefa = "cefa", cfra = "cfra", cfep = "cfep",
|
cefa = "cefa", cfra = "cfra", cfep = "cfep", cfot = "cfot",
|
||||||
cfot = "cfot", cfox = "cfox", cfta = "cfta", cftr = "cftr",
|
cfox = "cfox", cfta = "cfta", cftr = "cftr", cfur = "cfur",
|
||||||
cfur = "cfur", chlo = "chlo", cipr = "cipr", clar = "clar",
|
chlo = "chlo", cipr = "cipr", clar = "clar", clin = "clin",
|
||||||
clin = "clin", clox = "clox", coli = "coli", czol = "czol",
|
clox = "clox", coli = "coli", czol = "czol", dapt = "dapt",
|
||||||
dapt = "dapt", doxy = "doxy", erta = "erta", eryt = "eryt",
|
doxy = "doxy", erta = "erta", eryt = "eryt", fosf = "fosf",
|
||||||
fosf = "fosf", fusi = "fusi", gent = "gent", imip = "imip",
|
fusi = "fusi", gent = "gent", imip = "imip", kana = "kana",
|
||||||
kana = "kana", levo = "levo", linc = "linc", line = "line",
|
levo = "levo", linc = "linc", line = "line", mero = "mero",
|
||||||
mero = "mero", mino = "mino", moxi = "moxi", nali = "nali",
|
mino = "mino", moxi = "moxi", nali = "nali", neom = "neom",
|
||||||
neom = "neom", neti = "neti", nitr = "nitr", novo = "novo",
|
neti = "neti", nitr = "nitr", novo = "novo", norf = "norf",
|
||||||
norf = "norf", oflo = "oflo", peni = "peni", pita = "pita",
|
oflo = "oflo", peni = "peni", pita = "pita", poly = "poly",
|
||||||
poly = "poly", qida = "qida", rifa = "rifa", roxi = "roxi",
|
qida = "qida", rifa = "rifa", roxi = "roxi", siso = "siso",
|
||||||
siso = "siso", teic = "teic", tetr = "tetr", tica = "tica",
|
teic = "teic", tetr = "tetr", tica = "tica", tige = "tige",
|
||||||
tige = "tige", tobr = "tobr", trim = "trim", trsu = "trsu",
|
tobr = "tobr", trim = "trim", trsu = "trsu", vanc = "vanc")
|
||||||
vanc = "vanc")
|
|
||||||
|
|
||||||
interpretive_reading(...)
|
interpretive_reading(...)
|
||||||
}
|
}
|
||||||
@ -59,6 +58,6 @@ a <- data.frame(bactid = c("STAAUR", "ESCCOL", "KLEPNE", "PSEAER"),
|
|||||||
stringsAsFactors = FALSE)
|
stringsAsFactors = FALSE)
|
||||||
a
|
a
|
||||||
|
|
||||||
b <- EUCAST_rules(a)
|
b <- EUCAST_rules(a, "bactid")
|
||||||
b
|
b
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
\item{\code{umcg}}{UMCG code, like \code{AMCL}}
|
\item{\code{umcg}}{UMCG code, like \code{AMCL}}
|
||||||
\item{\code{official}}{Official name by the WHO, like \code{"amoxicillin and enzyme inhibitor"}}
|
\item{\code{official}}{Official name by the WHO, like \code{"amoxicillin and enzyme inhibitor"}}
|
||||||
\item{\code{official_nl}}{Official name in the Netherlands, like \code{"Amoxicilline met enzymremmer"}}
|
\item{\code{official_nl}}{Official name in the Netherlands, like \code{"Amoxicilline met enzymremmer"}}
|
||||||
\item{\code{trivial}}{Trivial name in Dutch, like \code{"Amoxicilline/clavulaanzuur"}}
|
\item{\code{trivial_nl}}{Trivial name in Dutch, like \code{"Amoxicilline/clavulaanzuur"}}
|
||||||
\item{\code{oral_ddd}}{Daily Defined Dose (DDD) according to the WHO, oral treatment}
|
\item{\code{oral_ddd}}{Daily Defined Dose (DDD) according to the WHO, oral treatment}
|
||||||
\item{\code{oral_units}}{Units of \code{ddd_units}}
|
\item{\code{oral_units}}{Units of \code{ddd_units}}
|
||||||
\item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}
|
\item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}
|
||||||
|
@ -11,7 +11,7 @@ abname(abcode, from = "umcg", to = "official", textbetween = " + ",
|
|||||||
tolower = FALSE)
|
tolower = FALSE)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{abcode}{a code or name, like \code{"amox"}, \code{"cftr"} or \code{"J01CA04"}}
|
\item{abcode}{a code or name, like \code{"AMOX"}, \code{"AMCL"} or \code{"J01CA04"}}
|
||||||
|
|
||||||
\item{from, to}{type to transform from and to. See \code{\link{ablist}} for its column names.}
|
\item{from, to}{type to transform from and to. See \code{\link{ablist}} for its column names.}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ abname("AMCL+GENT")
|
|||||||
abname(c("AMCL", "GENT"))
|
abname(c("AMCL", "GENT"))
|
||||||
# "amoxicillin and enzyme inhibitor" "gentamicin"
|
# "amoxicillin and enzyme inhibitor" "gentamicin"
|
||||||
|
|
||||||
abname("AMCL", to = "trivial")
|
abname("AMCL", to = "trivial_nl")
|
||||||
# "Amoxicilline/clavulaanzuur"
|
# "Amoxicilline/clavulaanzuur"
|
||||||
|
|
||||||
abname("AMCL", to = "atc")
|
abname("AMCL", to = "atc")
|
||||||
|
@ -37,7 +37,8 @@ Create a prediction model to predict antimicrobial resistance for the next years
|
|||||||
\examples{
|
\examples{
|
||||||
\dontrun{
|
\dontrun{
|
||||||
# use it directly:
|
# use it directly:
|
||||||
rsi_predict(tbl[which(first_isolate == TRUE & genus == "Haemophilus"),], col_ab = "amcl", coldate = "date")
|
rsi_predict(tbl = tbl[which(first_isolate == TRUE & genus == "Haemophilus"),],
|
||||||
|
col_ab = "amcl", coldate = "date")
|
||||||
|
|
||||||
# or with dplyr so you can actually read it:
|
# or with dplyr so you can actually read it:
|
||||||
library(dplyr)
|
library(dplyr)
|
||||||
|
Loading…
Reference in New Issue
Block a user