1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 18:46:11 +01:00
This commit is contained in:
dr. M.S. (Matthijs) Berends 2018-02-26 15:53:09 +01:00
parent 915d4db23b
commit 8a603876d2
No known key found for this signature in database
GPG Key ID: AE86720DBCDA4567
9 changed files with 29 additions and 28 deletions

View File

@ -45,10 +45,10 @@
#' stringsAsFactors = FALSE)
#' a
#'
#' b <- EUCAST_rules(a)
#' b <- EUCAST_rules(a, "bactid")
#' b
EUCAST_rules <- function(tbl,
col_bactcode = 'bactid',
col_bactcode,
info = TRUE,
amcl = 'amcl',
amik = 'amik',

View File

@ -128,7 +128,7 @@ atc_property <- function(atc_code,
#' 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}}.
#' @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 textbetween text to put between multiple returned texts
#' @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"))
#' # "amoxicillin and enzyme inhibitor" "gentamicin"
#'
#' abname("AMCL", to = "trivial")
#' abname("AMCL", to = "trivial_nl")
#' # "Amoxicilline/clavulaanzuur"
#'
#' abname("AMCL", to = "atc")
@ -210,7 +210,7 @@ abname <- function(abcode, from = 'umcg', to = 'official', textbetween = ' + ',
select(to) %>%
slice(1) %>%
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()
}
}

View File

@ -26,7 +26,7 @@
#' \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_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_units}}{Units of \code{ddd_units}}
#' \item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}

View File

@ -254,7 +254,8 @@ rsi <- function(ab1, ab2 = NA, interpretation = 'IR', minimum = 30, percent = FA
#' @examples
#' \dontrun{
#' # 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:
#' library(dplyr)

Binary file not shown.

View File

@ -13,22 +13,21 @@ EUCAST Expert Rules Version 2.0: \cr
\url{http://www.eucast.org/expert_rules_and_intrinsic_resistance}
}
\usage{
EUCAST_rules(tbl, col_bactcode = "bactid", info = TRUE, amcl = "amcl",
amik = "amik", amox = "amox", ampi = "ampi", azit = "azit",
aztr = "aztr", cefa = "cefa", cfra = "cfra", cfep = "cfep",
cfot = "cfot", cfox = "cfox", cfta = "cfta", cftr = "cftr",
cfur = "cfur", chlo = "chlo", cipr = "cipr", clar = "clar",
clin = "clin", clox = "clox", coli = "coli", czol = "czol",
dapt = "dapt", doxy = "doxy", erta = "erta", eryt = "eryt",
fosf = "fosf", fusi = "fusi", gent = "gent", imip = "imip",
kana = "kana", levo = "levo", linc = "linc", line = "line",
mero = "mero", mino = "mino", moxi = "moxi", nali = "nali",
neom = "neom", neti = "neti", nitr = "nitr", novo = "novo",
norf = "norf", oflo = "oflo", peni = "peni", pita = "pita",
poly = "poly", qida = "qida", rifa = "rifa", roxi = "roxi",
siso = "siso", teic = "teic", tetr = "tetr", tica = "tica",
tige = "tige", tobr = "tobr", trim = "trim", trsu = "trsu",
vanc = "vanc")
EUCAST_rules(tbl, col_bactcode, info = TRUE, amcl = "amcl", amik = "amik",
amox = "amox", ampi = "ampi", azit = "azit", aztr = "aztr",
cefa = "cefa", cfra = "cfra", cfep = "cfep", cfot = "cfot",
cfox = "cfox", cfta = "cfta", cftr = "cftr", cfur = "cfur",
chlo = "chlo", cipr = "cipr", clar = "clar", clin = "clin",
clox = "clox", coli = "coli", czol = "czol", dapt = "dapt",
doxy = "doxy", erta = "erta", eryt = "eryt", fosf = "fosf",
fusi = "fusi", gent = "gent", imip = "imip", kana = "kana",
levo = "levo", linc = "linc", line = "line", mero = "mero",
mino = "mino", moxi = "moxi", nali = "nali", neom = "neom",
neti = "neti", nitr = "nitr", novo = "novo", norf = "norf",
oflo = "oflo", peni = "peni", pita = "pita", poly = "poly",
qida = "qida", rifa = "rifa", roxi = "roxi", siso = "siso",
teic = "teic", tetr = "tetr", tica = "tica", tige = "tige",
tobr = "tobr", trim = "trim", trsu = "trsu", vanc = "vanc")
interpretive_reading(...)
}
@ -59,6 +58,6 @@ a <- data.frame(bactid = c("STAAUR", "ESCCOL", "KLEPNE", "PSEAER"),
stringsAsFactors = FALSE)
a
b <- EUCAST_rules(a)
b <- EUCAST_rules(a, "bactid")
b
}

View File

@ -11,7 +11,7 @@
\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_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_units}}{Units of \code{ddd_units}}
\item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}

View File

@ -11,7 +11,7 @@ abname(abcode, from = "umcg", to = "official", textbetween = " + ",
tolower = FALSE)
}
\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.}
@ -32,7 +32,7 @@ abname("AMCL+GENT")
abname(c("AMCL", "GENT"))
# "amoxicillin and enzyme inhibitor" "gentamicin"
abname("AMCL", to = "trivial")
abname("AMCL", to = "trivial_nl")
# "Amoxicilline/clavulaanzuur"
abname("AMCL", to = "atc")

View File

@ -37,7 +37,8 @@ Create a prediction model to predict antimicrobial resistance for the next years
\examples{
\dontrun{
# 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:
library(dplyr)