compute_DDDs | R Documentation |
Compute Defined Daily Doses (DDDs) for a drug prescription
or administration record using the World Health Organisation Anatomical
Therapeutic Chemical (ATC) classification \insertCiteWHO-ATC2020Ramses.
This function includes modified source code by
atc_online_property()
.
compute_DDDs(ATC_code, ATC_administration, dose, unit, silent = FALSE)
ATC_code |
a character vector of ATC codes (can be easily obtained from
the |
ATC_administration |
a character vector indicating the ATC route of administration (see Details) |
dose |
a numeric vector indicating the total dose for the drug serving as the ATC DDD basis of strength. For prescriptions, provide the total dose to be given in one day, rather than per administration. |
unit |
a character vector coercible to a |
silent |
if |
This function queries the WHO ATC website for the most up-to-date reference values of the DDDs.
The 'administration' parameter must be one of the following values:
'Implant'
for implants
'Inhal'
for inhalation (eg: nebuliser or inhalers)
'Instill'
for instillation (eg: topical drops)
'N'
for nasal administration
'O'
for oral administration or administration via
percutaneous endoscopic gastrostomy tube
'P'
for parenteral administration (eg intravenous
bolus/infusion injections, intramuscular injections)
'R'
for rectal administration
'SL'
for sublingual/buccal/oromucosal administration
'TD'
for transdermal administration (eg: patch)
'V'
for vaginal administration
a numeric vector containing the DDDs
With thanks to the AMR package authors. \insertAllCited
# Three tablets of amoxicillin 500mg
compute_DDDs("J01CA04", "O", 3 * 500, "mg")
# Three tablets of co-amoxiclav 625mg (containing 500mg amoxicillin each)
compute_DDDs("J01CR02", "O", 3 * 500, "mg")
# This function may also be used with `dplyr`
library(dplyr)
library(magrittr)
library(AMR)
Ramses::drug_prescriptions %>%
head() %>%
transmute(rxsummary,
tr_DESC,
route,
dose,
units,
daily_frequency = case_when(
frequency == "BD" ~ 2,
frequency == "TDS" ~ 3,
frequency == "6H" ~ 4
)) %>%
mutate(DDD = compute_DDDs(
ATC_code = AMR::ab_atc(tr_DESC, only_first = TRUE),
ATC_administration = if_else(route == "ORAL", "O", "P"),
dose = dose * daily_frequency,
unit = units))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.