Open meerapatelmd opened 3 years ago
The proposed additions to the Drug Exposure table are related to the drug administration and frequency from the source data.
The drug administration attributes administration_dose
and
administration_unit
were designed to provide standardized and verified values
sourced from the quantity
and dose_unit_source_value
fields in the Drug
Exposures table, respectively. For solid formulations, the amount would be in
mass such as 'grams', while liquid preparations would be in measurements of
volume such as 'milliliters'. These fields are destined to be used alongside
the Drug Strength table to calculate the total mass of the RxNorm Ingredient
in a given administration, regardless of the original formulation. When this
calculation is used in conjunction with the daily frequency related to the
frequency_concept_id
, the total active ingredient administered can be returned
at a rate per day or an aggregate spanning the timeframe of the drug exposure record.
Solid formulations taken orally have a straightforward conversion because the
information required to calculate the active ingredient mass is a multiplier of
the number of tablets that were administered. Therefore, thequantity
field
suffices in providing this information.
$$
\text{quantity}_\text{de} \text{dose_unit_sourcevalue}\text{de}
\text{amountvalue}\text{ds} * \text{amountunit}\text{ds} =
\frac{\text{total active ingredient mass}}{\text{1 administration}}
$$
However, for all other formulations such as liquids reported as
concentrations (i.e. milligrams per milliliter), the volume
administered in the quantity
and dose_unit_source_value
fields require
additional conversions.
$$
\text{quantity}_\text{de} \text{dose_unit_sourcevalue}\text{de}
\frac{\text{numeratorvalue}\text{ds}}{\text{denominatorvalue}\text{ds}} *
\frac{\text{numeratorunit}\text{ds}}{\text{denominatorunit}\text{ds}} =
\frac{\text{total active ingredient mass}}{\text{1 administration}}
$$
In parallel to this, the frequency of drug administration is also carried over
from the source data and standardized to a concept id as frequency_concept_id
.
The frequency_concept_id
normalizes the amount of an active ingredient administered
to a rate of per day.
$$
\frac{\text{total active ingredient mass}}{\text{1 administration}}
\frac{\text{x administrations}_\text{de}}{\text{day}} =
\frac{\text{x * total active ingredient mass}}{\text{day}}
$$
Finally, the total active ingredient for a drug exposure record is calculated by deriving the timeframe of the drug exposure record in units of days, which is multiplied by the results above.
$$
(\text{drug_exposure_enddate}\text{de} - \text{drug_exposure_startdate}\text{de})
\frac{\text{x total active ingredient mass}}{\text{day}} =
\text{total active ingredient mass in drug exposure}
$$
The intent of the administration_dose
and administration_unit
fields is to
have a normalized and qa'd representation of the quantity
and
dose_unit_source_value
across all different types of drug formulations within the
Drug Exposures table.
$$
\text{administrationdose}\text{de*} \sim \text{quantity}_\text{de}
$$
$$
\text{administrationunit}\text{de*} \sim \text{dose_unit_sourcevalue}\text{de}
$$
Use Case
The most commonly seen medications with a non-null
administration_dose
field are first derived from the Drug Exposures table.For testing, the top 10 most frequently seen drugs in the Drug Exposure table are filtered.
The top 10 drugs are joined back with the Drug Exposures table to retrieve the
administration_dose
,administration_unit
, andfrequency_concept_id
fields.For easier visualization, the formatting of the concept attributes are merged into a single
drug
string, with theconcept_id
field now called thedrug_id
.This dataset is then joined to the
Drug Strength Staged
table to get the stagedvalue
andunit
fields for each drug.The resulting table tells the story of the drug exposure for a given record. The dose of the drug at each administration, the units of administration, the corresponding
ingredient_concept_id
from the Drug Strength table, and the stagedvalue
andunit
corresponding to the amount of the ingredient in 1 unit of the drug.The
value
field requires evaluation as a numeric value, which would require looping over almost 40,000 rows. Instead, each uniquevalue
is isolated, resulting in 9 rows. These 9 values are mapped to their corresponding numeric value.The resulting dataset is joined back with the original data.
Themes
Themes can be viewed at: https://bootswatch.com/3/.
Syntax Highlighting
Syntax Highlighting Styles can be viewed at https://www.garrickadenbuie.com/blog/pandoc-syntax-highlighting-examples/.
Dataframe
Dataframe printing options include
default
,kable
,tibble
, orpaged
.For paged dataframes, the chunk options include:
FALSE
turns off paged display for the chunkFALSE
turns off row names for the chunkFigure Captions