compute_DDDs: Compute Defined Daily Doses (DDDs)

View source: R/metadata.R

compute_DDDsR Documentation

Compute Defined Daily Doses (DDDs)

Description

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().

Usage

compute_DDDs(ATC_code, ATC_administration, dose, unit, silent = FALSE)

Arguments

ATC_code

a character vector of ATC codes (can be easily obtained from the ab_atc() function)

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 units object with as_units().

silent

if TRUE, the progress bar will be hidden. The default is FALSE.

Details

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

Value

a numeric vector containing the DDDs

References

With thanks to the AMR package authors. \insertAllCited

Examples

# 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))

ramses-antibiotics/ramses-package documentation built on Feb. 13, 2024, 1:01 p.m.