\item{col_genus}{column name of the genus of the microorganisms}
\item{col_species}{column name of the species of the microorganisms}
\item{col_testcode}{column name of the test codes, see Details}
\item{col_specimen}{column name of the specimen type or group}
\item{col_icu}{column name of the logicals (\code{TRUE}/\code{FALSE}) whether a ward or department is an Intensive Care Unit (ICU)}
\item{col_keyantibiotics}{column name of the key antibiotics to determine first \emph{weighted} isolates, see \code{\link{key_antibiotics}}.}
\item{episode_days}{episode in days after which a genus/species combination will be determined as 'first isolate' again}
\item{testcodes_exclude}{character vector with test codes that should be excluded (caseINsensitive)}
\item{icu_exclude}{logical whether ICU isolates should be excluded}
\item{filter_specimen}{specimen group or type that should be excluded}
\item{output_logical}{return output as \code{logical} (will else the values \code{0} or \code{1})}
\item{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)}
\item{info}{print progress}
}
\value{
A vector to add to table, see Examples.
}
\description{
Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type.
}
\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.