getDrugIngredientCodes: Get descendant codes for drug ingredients

View source: R/drugCodes.R

getDrugIngredientCodesR Documentation

Get descendant codes for drug ingredients

Description

Get descendant codes for drug ingredients

Usage

getDrugIngredientCodes(
  cdm,
  name = NULL,
  doseForm = NULL,
  ingredientRange = c(1, Inf),
  withConceptDetails = FALSE
)

Arguments

cdm

cdm_reference via CDMConnector

name

Names of ingredients of interest. For example, c("acetaminophen", "codeine"), would result in a list of length two with the descendant concepts for these two particular drug ingredients.

doseForm

Only descendants codes with the specified dose form will be returned. If NULL, descendant codes will be returned regardless of dose form.

ingredientRange

Used to restrict descendant codes to those associated with a specific number of ingredients. Must be a vector of length two with the first element the minimum number of ingredients allowed and the second the maximum. A value of c(2, 2) would restrict to only concepts associated with two ingredients.

withConceptDetails

If FALSE, each item in the list of results (one per ingredient) will contain a vector of concept IDs for each ingredient. If TRUE each item in the list of results will contain a tibble with additional information on the identified concepts.

Value

A named list, with each item containing a vector of descendant concepts of an ingredient (if withConceptDetails was set as FALSE) or a tibble with the descendant concepts along with additional details about them (if withConceptDetails was set as TRUE).

Examples

## Not run: 
cdm <- mockVocabRef()
getDrugIngredientCodes(cdm = cdm, name = "Adalimumab")
CDMConnector::cdmDisconnect(cdm)

## End(Not run)

oxford-pharmacoepi/CodelistGenerator documentation built on April 12, 2024, 9:30 a.m.