medication_lookup_by_disease: Medication lookups for selected categories

medication_lookup_by_diseaseR Documentation

Medication lookups for selected categories

Description

These functions are aliases for medication_lookup(), using hard-coded codes that have been pre-selected for each disease/medication class.

Usage

medication_statin(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_antiHLD(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_PDE5i(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_BB(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_ACEi(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_ARB(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_CCB(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_loopdiuretic(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_thiazide(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_antiHTN(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_insulin(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_oralhypoglycemic(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

medication_pulm_endothelin(
  data,
  after_instance = default_after_inst(),
  up_to_instance = default_up_to_inst(),
  medication_col = f.20003.0.0.Treatment_medication_code
)

Arguments

data

The primarydata frame.

Thisdata frame includes all necessary columns required to perform look-ups (e.g. ICD10 code columns, medication code columns, age, sex, etc.).

after_instance

An integer specifying an instance number, or the name of the column (using <data-masking> rules) containing instance numbers to use as the minimum instance (non-inclusive). Used to include alldata after but NOT including the specified instance number. Defaults to default_after_inst(), which is typically -1 (i.e., include instances 0 and later).

up_to_instance

An integer specifying an instance number, or the name of the column (using <data-masking> rules) containing instance numbers to use as the maximum instance (inclusive). Used to include alldata up to and including the specified instance number. Defaults to default_up_to_inst(), which as of this writing returns 3.

medication_col

Template column name for self-reported medication codes.
Default = f.20003.0.0.Treatment_medication_code.

Instancing

The UK Biobank records visits as separate "instances." As of this writing, there are 4 instances labeled 0 through 3. At each instance, various information can be recorded or re-recorded. For example, blood pressure is typically recorded at most in-person evaluations. Therefore, there may be 4 separate columns for blood pressure recordings (actually, there could be more because the blood pressure may be recorded multiple times at each instance). Almost all of the functions in this package will utilize instance numbers to specify from which time pointsdata should be retrieved. For example, we may want to know the state of ICD10 diagnoses before instance 2. In this case, we would specify up_to_instance = 1 (search up to instance 1, inclusive) in functions that take this as an argument.

Arguments like up_to_instance and after_instance can take a constant instance number as their value. But they can also take the name of a column that contains an instance number, so that different instance limits can be used for each participant. For example, some participants undergo MRI at instance 2, and others at instance 3. If we want to know the state of a diagnosis up to and including the time of MRI, we would want to assign up_to_instance to the name of the column that specifies which instance the MRI occurred at. This column typically has to be generated by the user and attached to thedata frame beforehand.

Column names

Most functions in this package will take column names (*_col) as optional arguments (otherwise a default column names are used) which are then used as templates to find all other columns with the same field number, but different instance and array numbers. These functions will automatically find all matching instances (and arrays within each instance) within the specified parameters. Internally, a set of expand_instance_*() helper functions, which themselves rely on the column_expansion_helper() function, perform the work of searching for matching columns.


adamleejohnson/R-ukbiobank documentation built on April 25, 2022, 2:11 a.m.