get_atc_code: Get ATC codes (DrecNos or MPIs)

View source: R/get_atc_code.R

get_atc_codeR Documentation

Get ATC codes (DrecNos or MPIs)

Description

[Stable] Collect Drug Record Numbers or MedicinalProd_Ids associated to one or more ATC classes.

Usage

get_atc_code(atc_sel, mp, thg_data, vigilyze = TRUE)

Arguments

atc_sel

A named list of ATC codes. See Details.

mp

A modified MP data.table. See mp_

thg_data

A data.table. Correspondence between ATC codes and MedicinalProd_Id (usually, it is thg)

vigilyze

A logical. Should ATC classes be retrieved using the vigilyze style? See details

Details

get_atc_code() is an ID collector function. Provide atc_sel in the same way as d_sel in add_drug(), but remember to specify its method arg as MedicinalProd_Id if vigilyze is set to FALSE. Vigilyze style means all conditioning of drugs will be retrieved after requesting an ATC class (i.e., drugs are identified with their DrecNos), even if a specific conditioning is not present in the ATC class. This is the default behavior in vigilyze.

Value

A named list of integers. DrecNos if vigilyze is set to TRUE, or MedicinalProd_Ids if vigilyze is set to FALSE.

See Also

mp_, thg_, add_drug(), get_drecno()

Examples

# ## Find codes associated with one or more atc classes

# First, define which atc you want to use

atc_sel <-
     rlang::list2(l03_j01 = c("L03AA", "J01CA"),
                  c09aa = c("C09AA")
     )

# You can get DrecNos for you ATCs (if vigilyze is TRUE)

atc_drecno <-
  get_atc_code(atc_sel = atc_sel,
               mp = mp_,
               thg_data = thg_,
               vigilyze = TRUE)

# Or you can get MedicinalProd_Ids (if vigilyze is FALSE)

atc_mpi <-
  get_atc_code(atc_sel = atc_sel,
               mp = mp_,
               thg_data = thg_,
               vigilyze = FALSE)

vigicaen documentation built on April 3, 2025, 8:55 p.m.