1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 09:41:49 +02:00

revert back to pre-antibiogram

This commit is contained in:
2023-02-09 13:07:39 +01:00
parent aa48c6bf53
commit 1a0dc4bf46
53 changed files with 984 additions and 1996 deletions

View File

@ -52,7 +52,7 @@ filter_first_isolate(
\item{col_patient_id}{column name of the unique IDs of the patients, defaults to the first column that starts with 'patient' or 'patid' (case insensitive)}
\item{col_mo}{column name of the names or codes of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.}
\item{col_testcode}{column name of the test codes. Use \code{col_testcode = NULL} to \strong{not} exclude certain test codes (such as test codes for screening). In that case \code{testcodes_exclude} will be ignored.}
@ -109,14 +109,17 @@ All mentioned methods are covered in the \code{\link[=first_isolate]{first_isola
\strong{Isolate-based} \tab \code{first_isolate(x, method = "isolate-based")} \cr
\emph{(= all isolates)} \tab \cr
\tab \cr
\tab \cr
\strong{Patient-based} \tab \code{first_isolate(x, method = "patient-based")} \cr
\emph{(= first isolate per patient)} \tab \cr
\tab \cr
\tab \cr
\strong{Episode-based} \tab \code{first_isolate(x, method = "episode-based")}, or: \cr
\emph{(= first isolate per episode)} \tab \cr
- 7-Day interval from initial isolate \tab - \code{first_isolate(x, method = "e", episode_days = 7)} \cr
- 30-Day interval from initial isolate \tab - \code{first_isolate(x, method = "e", episode_days = 30)} \cr
\tab \cr
\tab \cr
\strong{Phenotype-based} \tab \code{first_isolate(x, method = "phenotype-based")}, or: \cr
\emph{(= first isolate per phenotype)} \tab \cr
- Major difference in any antimicrobial result \tab - \code{first_isolate(x, type = "points")} \cr
@ -165,7 +168,7 @@ The default method is phenotype-based (using \code{type = "points"}) and episode
# `example_isolates` is a data set available in the AMR package.
# See ?example_isolates.
example_isolates[first_isolate(info = TRUE), ]
example_isolates[first_isolate(), ]
\donttest{
# get all first Gram-negatives
example_isolates[which(first_isolate(info = FALSE) & mo_is_gram_negative()), ]
@ -173,7 +176,7 @@ example_isolates[which(first_isolate(info = FALSE) & mo_is_gram_negative()), ]
if (require("dplyr")) {
# filter on first isolates using dplyr:
example_isolates \%>\%
filter(first_isolate(info = TRUE))
filter(first_isolate())
}
if (require("dplyr")) {
# short-hand version:
@ -184,7 +187,7 @@ if (require("dplyr")) {
# flag the first isolates per group:
example_isolates \%>\%
group_by(ward) \%>\%
mutate(first = first_isolate(info = FALSE)) \%>\%
mutate(first = first_isolate()) \%>\%
select(ward, date, patient, mo, first)
}
}