1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-27 09:26:11 +01:00
AMR/man/as.ab.Rd

106 lines
5.5 KiB
Plaintext
Raw Normal View History

2019-05-10 16:44:59 +02:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ab.R
\name{as.ab}
\alias{as.ab}
\alias{ab}
2019-05-16 21:20:00 +02:00
\alias{is.ab}
\title{Transform Input to an Antibiotic ID}
2019-05-10 16:44:59 +02:00
\usage{
as.ab(x, flag_multiple_results = TRUE, info = interactive(), ...)
2019-05-16 21:20:00 +02:00
is.ab(x)
2019-05-10 16:44:59 +02:00
}
\arguments{
2021-05-12 18:15:03 +02:00
\item{x}{a \link{character} vector to determine to antibiotic ID}
2019-10-04 15:36:12 +02:00
2022-11-13 13:44:25 +01:00
\item{flag_multiple_results}{a \link{logical} to indicate whether a note should be printed to the console that probably more than one antibiotic drug code or name can be retrieved from a single input value.}
\item{info}{a \link{logical} to indicate whether a progress bar should be printed - the default is \code{TRUE} only in interactive mode}
2019-10-04 15:36:12 +02:00
\item{...}{arguments passed on to internal functions}
2019-05-10 16:44:59 +02:00
}
\value{
A \link{character} \link{vector} with additional class \code{\link{ab}}
2019-05-10 16:44:59 +02:00
}
\description{
2022-11-13 13:44:25 +01:00
Use this function to determine the antibiotic drug code of one or more antibiotics. The data set \link{antibiotics} will be searched for abbreviations, official names and synonyms (brand names).
2019-05-10 16:44:59 +02:00
}
\details{
All entries in the \link{antibiotics} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. Not that some drugs contain multiple ATC codes.
2019-05-13 10:10:16 +02:00
2020-07-01 16:21:36 +02:00
All these properties will be searched for the user input. The \code{\link[=as.ab]{as.ab()}} can correct for different forms of misspelling:
\itemize{
2020-12-17 16:22:25 +01:00
\item Wrong spelling of drug names (such as "tobramicin" or "gentamycin"), which corrects for most audible similarities such as f/ph, x/ks, c/z/s, t/th, etc.
2020-07-01 16:21:36 +02:00
\item Too few or too many vowels or consonants
2020-12-17 16:22:25 +01:00
\item Switching two characters (such as "mreopenem", often the case in clinical data, when doctors typed too fast)
2020-07-01 16:21:36 +02:00
\item Digitalised paper records, leaving artefacts like 0/o/O (zero and O's), B/8, n/r, etc.
}
Use the \code{\link[=ab_property]{ab_*}} functions to get properties based on the returned antibiotic ID, see \emph{Examples}.
2020-12-17 16:22:25 +01:00
2022-11-13 13:44:25 +01:00
Note: the \code{\link[=as.ab]{as.ab()}} and \code{\link[=ab_property]{ab_*}} functions may use very long regular expression to match brand names of antimicrobial drugs. This may fail on some systems.
2022-10-10 20:20:39 +02:00
You can add your own manual codes to be considered by \code{\link[=as.ab]{as.ab()}} and all \code{\link[=ab_property]{ab_*}} functions, see \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}}.
2019-05-10 16:44:59 +02:00
}
\section{Source}{
2024-03-03 23:24:57 +01:00
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://atcddd.fhi.no/atc_ddd_index/}
2019-05-10 16:44:59 +02:00
2021-05-24 15:29:17 +02:00
European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}
2019-05-10 16:44:59 +02:00
}
\section{WHOCC}{
2024-03-03 23:24:57 +01:00
This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://atcddd.fhi.no}) and the Pharmaceuticals Community Register of the European Commission (\url{https://ec.europa.eu/health/documents/community-register/html/reg_hum_atc.htm}).
2019-05-10 16:44:59 +02:00
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
2024-03-03 23:24:57 +01:00
\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://atcddd.fhi.no/copyright_disclaimer/.}
2019-05-10 16:44:59 +02:00
}
\section{Reference Data Publicly Available}{
2020-08-21 11:40:13 +02:00
2023-01-21 23:47:20 +01:00
All data sets in this \code{AMR} package (about microorganisms, antibiotics, SIR interpretation, EUCAST rules, etc.) are publicly and freely available for download in the following formats: R, MS Excel, Apache Feather, Apache Parquet, SPSS, SAS, and Stata. We also provide tab-separated plain text files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please visit \href{https://msberends.github.io/AMR/articles/datasets.html}{our website for the download links}. The actual files are of course available on \href{https://github.com/msberends/AMR/tree/main/data-raw}{our GitHub repository}.
2020-08-21 11:40:13 +02:00
}
2019-05-10 16:44:59 +02:00
\examples{
# these examples all return "ERY", the ID of erythromycin:
2019-05-10 16:44:59 +02:00
as.ab("J01FA01")
as.ab("J 01 FA 01")
as.ab("Erythromycin")
as.ab("eryt")
as.ab(" eryt 123")
as.ab("ERYT")
as.ab("ERY")
2019-05-16 21:20:00 +02:00
as.ab("eritromicine") # spelled wrong, yet works
2022-08-28 10:31:50 +02:00
as.ab("Erythrocin") # trade name
as.ab("Romycin") # trade name
2019-05-10 16:44:59 +02:00
# spelling from different languages and dyslexia are no problem
ab_atc("ceftriaxon")
2022-08-28 10:31:50 +02:00
ab_atc("cephtriaxone") # small spelling error
ab_atc("cephthriaxone") # or a bit more severe
ab_atc("seephthriaaksone") # and even this works
# use ab_* functions to get a specific properties (see ?ab_property);
2019-05-10 16:44:59 +02:00
# they use as.ab() internally:
ab_name("J01FA01")
ab_name("eryt")
2022-10-19 11:47:57 +02:00
2021-05-24 09:00:11 +02:00
\donttest{
if (require("dplyr")) {
2023-01-21 23:47:20 +01:00
# you can quickly rename 'sir' columns using set_ab_names() with dplyr:
example_isolates \%>\%
2023-01-21 23:47:20 +01:00
set_ab_names(where(is.sir), property = "atc")
2021-05-24 09:00:11 +02:00
}
}
2019-05-10 16:44:59 +02:00
}
\seealso{
2020-06-25 17:34:50 +02:00
\itemize{
\item \link{antibiotics} for the \link{data.frame} that is being used to determine ATCs
2020-06-25 17:34:50 +02:00
\item \code{\link[=ab_from_text]{ab_from_text()}} for a function to retrieve antimicrobial drugs from clinical text (from health care records)
}
2019-05-10 16:44:59 +02:00
}