GEMINI-Medicine / Rgemini

A custom R package that provides a variety of functions to perform data analyses with GEMINI data
https://gemini-medicine.github.io/Rgemini/
Other
3 stars 0 forks source link

Function deriving unique medications/encounter #137

Open loffleraSMH opened 1 month ago

loffleraSMH commented 1 month ago

New Feature Request

Some projects are interested in the number of unique medications a patient is prescribed. For example, this can be used to derive a "polypharmacy" flag, which is typically defined as the regular use of 5 or more medications at the same time. Pharmacy data are not fully mapped, so we need to use some approximation to derive the number of unique medications per patient.

Previous projects used the following approach:

  1. Impute missing med_id_generic_name_raw with med_id_brand_name_raw, med_id_hospital_code_raw, or order_description (whichever one is available).
  2. Count unique drug names based on the unique (imputed) entries in med_id_generic_name_raw. Since drug names are not standardized and occasionally contain additional text (e.g., dosage/route information), we may want to perform some additional pre-processing of drug names (e.g., ignore capitalization, ignore leading/trailing whitespace, only use first N characters etc.) - however, given that drug names tend to be consistent within hospitals/time periods, this may not make a big difference

Note that this approach will only provide an approximation of the unique medications, and users should not rely on this method if they are interested in specific drugs (in that case, Rxnorm mapping would be required).

Function structure:

Please mention (if applicable), any research projects for which this functionality was needed: