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

(v1.7.1.9026) updated DDDs

This commit is contained in:
2021-08-19 23:43:02 +02:00
parent 1b62bab007
commit 2ab21b7af3
26 changed files with 266 additions and 219 deletions

View File

@ -92,7 +92,7 @@ trimethoprims(only_rsi_columns = FALSE, ...)
ureidopenicillins(only_rsi_columns = FALSE, ...)
}
\arguments{
\item{ab_class}{an antimicrobial class, such as \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
\item{ab_class}{an antimicrobial class or a part of it, such as \code{"carba"} and \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
\item{only_rsi_columns}{a \link{logical} to indicate whether only columns of class \verb{<rsi>} must be selected (defaults to \code{FALSE}), see \code{\link[=as.rsi]{as.rsi()}}}
@ -113,7 +113,7 @@ These functions can be used in data set calls for selecting columns and filterin
All columns in the data in which these functions are called will be searched for known antibiotic names, abbreviations, brand names, and codes (ATC, EARS-Net, WHO, etc.) according to the \link{antibiotics} data set. This means that a selector such as \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
The \code{\link[=ab_class]{ab_class()}} function can be used to filter/select on a manually defined antibiotic class. It searches for results in the \link{antibiotics} data set within the columns \code{name}, \code{atc_group1} and \code{atc_group2}.
The \code{\link[=ab_class]{ab_class()}} function can be used to filter/select on a manually defined antibiotic class. It searches for results in the \link{antibiotics} data set within the columns \code{group}, \code{atc_group1} and \code{atc_group2}.
The \code{\link[=ab_selector]{ab_selector()}} function can be used to internally filter the \link{antibiotics} data set on any results, see \emph{Examples}. It allows for filtering on a (part of) a certain name, and/or a group name or even a minimum of DDDs for oral treatment. This function yields the highest flexibility, but is also the least user-friendly, since it requires a hard-coded filter to set.
@ -204,6 +204,10 @@ example_isolates[any(carbapenems() == "R"), penicillins()]
# and erythromycin is not a penicillin:
example_isolates[, penicillins() & administrable_per_os()]
# ab_selector() applies a filter in the `antibiotics` data set and is thus very
# flexible. For instance, to select antibiotic columns with an oral DDD of at
# least 1 gram:
example_isolates[, ab_selector(oral_ddd > 1 & oral_units == "g")]
# dplyr -------------------------------------------------------------------
\donttest{

View File

@ -4,7 +4,7 @@
\name{antibiotics}
\alias{antibiotics}
\alias{antivirals}
\title{Data Sets with 558 Antimicrobials}
\title{Data Sets with 558 Antimicrobial Drugs}
\format{
\subsection{For the \link{antibiotics} data set: a \link{data.frame} with 456 observations and 14 variables:}{
\itemize{
@ -17,9 +17,9 @@
\item \code{atc_group2}\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"}
\item \code{abbr}\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)
\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment
\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment, currently available for 170 drugs
\item \code{oral_units}\cr Units of \code{oral_ddd}
\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral treatment
\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral (intravenous) treatment, currently available for 145 drugs
\item \code{iv_units}\cr Units of \code{iv_ddd}
\item \code{loinc}\cr All LOINC codes (Logical Observation Identifiers Names and Codes) associated with the name of the antimicrobial agent. Use \code{\link[=ab_loinc]{ab_loinc()}} to retrieve them quickly, see \code{\link[=ab_property]{ab_property()}}.
}
@ -59,7 +59,7 @@ Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{
\details{
Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}.
Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
Synonyms (i.e. trade names) were derived from the Compound ID (\code{cid}) and consequently only available where a CID is available.
\subsection{Direct download}{
These data sets are available as 'flat files' for use even without \R - you can find the files here:

View File

@ -4,6 +4,7 @@
\alias{atc_online_property}
\alias{atc_online_groups}
\alias{atc_online_ddd}
\alias{atc_online_ddd_units}
\title{Get ATC Properties from WHOCC Website}
\source{
\url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/}
@ -20,9 +21,11 @@ atc_online_property(
atc_online_groups(atc_code, ...)
atc_online_ddd(atc_code, ...)
atc_online_ddd_units(atc_code, ...)
}
\arguments{
\item{atc_code}{a \link{character} or \link{character} vector with ATC code(s) of antibiotic(s)}
\item{atc_code}{a \link{character} (vector) with ATC code(s) of antibiotics, will be coerced with \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_atc]{ab_atc()}} internally if not a valid ATC code}
\item{property}{property of an ATC code. Valid values are \code{"ATC"}, \code{"Name"}, \code{"DDD"}, \code{"U"} (\code{"unit"}), \code{"Adm.R"}, \code{"Note"} and \code{groups}. For this last option, all hierarchical groups of an ATC code will be returned, see \emph{Examples}.}
@ -35,7 +38,7 @@ atc_online_ddd(atc_code, ...)
\item{...}{arguments to pass on to \code{atc_property}}
}
\description{
Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit.
Gets data from the WHOCC website to determine properties of an Anatomical Therapeutic Chemical (ATC) (e.g. an antibiotic), such as the name, defined daily dose (DDD) or standard unit.
}
\details{
Options for argument \code{administration}:
@ -84,6 +87,7 @@ On our website \url{https://msberends.github.io/AMR/} you can find \href{https:/
if (requireNamespace("curl") && requireNamespace("rvest") && requireNamespace("xml2")) {
# oral DDD (Defined Daily Dose) of amoxicillin
atc_online_property("J01CA04", "DDD", "O")
atc_online_ddd(ab_atc("amox"))
# parenteral DDD (Defined Daily Dose) of amoxicillin
atc_online_property("J01CA04", "DDD", "P")