mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 06:46:11 +01:00
export first_isolate
This commit is contained in:
parent
be51a95448
commit
d36a391747
@ -15,6 +15,7 @@ export(anti_join_bactlist)
|
||||
export(as.mic)
|
||||
export(as.rsi)
|
||||
export(atc_property)
|
||||
export(first_isolate)
|
||||
export(full_join_bactlist)
|
||||
export(inner_join_bactlist)
|
||||
export(interpretive_reading)
|
||||
|
@ -35,12 +35,11 @@
|
||||
#' @param output_logical return output as \code{logical} (will else the values \code{0} or \code{1})
|
||||
#' @param ignore_I ignore \code{"I"} as antimicrobial interpretation of key antibiotics (with \code{FALSE}, changes in antibiograms from S to I and I to R will be interpreted as difference)
|
||||
#' @param info print progress
|
||||
# @param ... parameters to pass through to \code{first_isolate}.
|
||||
#' @rdname first_isolate
|
||||
#' @details To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that is was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be selection bias.
|
||||
#'
|
||||
#' Use \code{col_testcode = NA} to \strong{not} exclude certain test codes (like test codes for screening). In that case \code{testcodes_exclude} will be ignored.
|
||||
#' @keywords isolate isolates first
|
||||
#' @export
|
||||
#' @importFrom dplyr arrange_at lag between row_number filter mutate arrange
|
||||
#' @return A vector to add to table, see Examples.
|
||||
#' @examples
|
||||
|
@ -14,7 +14,7 @@
|
||||
\item{\code{trivial}}{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, bij parenteral treatment}
|
||||
\item{\code{iv_ddd}}{Daily Defined Dose (DDD) according to the WHO, parenteral treatment}
|
||||
\item{\code{iv_units}}{Units of \code{iv_ddd}}
|
||||
\item{\code{atc_group1}}{ATC group in Dutch, like \code{"Macroliden, lincosamiden en streptograminen"}}
|
||||
\item{\code{atc_group2}}{Subgroup of \code{atc_group1} in Dutch, like \code{"Macroliden"}}
|
||||
|
@ -13,7 +13,7 @@
|
||||
\item{\code{species}}{Species name of microorganism, like \code{"coli"}}
|
||||
\item{\code{subspecies}}{Subspecies name of bio-/serovar of microorganism, like \code{"EHEC"}}
|
||||
\item{\code{fullname}}{Full name, like \code{"Echerichia coli (EHEC)"}}
|
||||
\item{\code{type}}{Type of microorganism, like \code{"Bacterie"} en \code{"Schimmel/gist"} (these are Dutch)}
|
||||
\item{\code{type}}{Type of microorganism in Dutch, like \code{"Bacterie"} and \code{"Schimmel/gist"}}
|
||||
\item{\code{gramstain}}{Gram of microorganism in Dutch, like \code{"Negatieve staven"}}
|
||||
\item{\code{aerobic}}{Type aerobe/anaerobe of bacteria}
|
||||
}}
|
||||
|
@ -4,12 +4,12 @@
|
||||
\alias{key_antibiotics}
|
||||
\title{Key antibiotics based on bacteria ID}
|
||||
\usage{
|
||||
key_antibiotics(tbl, col_bactcode = "bacteriecode", info = TRUE,
|
||||
amcl = "amcl", amox = "amox", cfot = "cfot", cfta = "cfta",
|
||||
cftr = "cftr", cfur = "cfur", cipr = "cipr", clar = "clar",
|
||||
clin = "clin", clox = "clox", doxy = "doxy", gent = "gent",
|
||||
line = "line", mero = "mero", peni = "peni", pita = "pita",
|
||||
rifa = "rifa", teic = "teic", trsu = "trsu", vanc = "vanc")
|
||||
key_antibiotics(tbl, col_bactcode = "bactid", info = TRUE, amcl = "amcl",
|
||||
amox = "amox", cfot = "cfot", cfta = "cfta", cftr = "cftr",
|
||||
cfur = "cfur", cipr = "cipr", clar = "clar", clin = "clin",
|
||||
clox = "clox", doxy = "doxy", gent = "gent", line = "line",
|
||||
mero = "mero", peni = "peni", pita = "pita", rifa = "rifa",
|
||||
teic = "teic", trsu = "trsu", vanc = "vanc")
|
||||
}
|
||||
\arguments{
|
||||
\item{tbl}{table with antibiotics coloms, like \code{amox} and \code{amcl}.}
|
||||
|
@ -4,7 +4,7 @@
|
||||
\alias{rsi_predict}
|
||||
\title{Predict antimicrobial resistance}
|
||||
\usage{
|
||||
rsi_predict(tbl, col_ab, col_date = "ontvangstdatum",
|
||||
rsi_predict(tbl, col_ab, col_date,
|
||||
year_max = as.integer(format(as.Date(Sys.Date()), "\%Y")) + 15,
|
||||
year_every = 1, model = "binomial", I_as_R = TRUE,
|
||||
preserve_measurements = TRUE, info = TRUE)
|
||||
@ -37,19 +37,20 @@ 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"),], "amcl")
|
||||
rsi_predict(tbl[which(first_isolate == TRUE & genus == "Haemophilus"),], col_ab = "amcl", coldate = "date")
|
||||
|
||||
# or with dplyr so you can actually read it:
|
||||
library(dplyr)
|
||||
tbl \%>\%
|
||||
filter(first_isolate == TRUE,
|
||||
genus == "Haemophilus") \%>\%
|
||||
rsi_predict("amcl")
|
||||
rsi_predict(col_ab = "amcl", coldate = "date")
|
||||
|
||||
tbl \%>\%
|
||||
filter(first_isolate_weighted == TRUE,
|
||||
genus == "Haemophilus") \%>\%
|
||||
rsi_predict(col_ab = "amcl",
|
||||
coldate = "date",
|
||||
year_max = 2050,
|
||||
year_every = 5)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user