collapseDose | R Documentation |
Splits drug data and calls makeDose
to collapse at the note and date level.
collapseDose(x, noteMetaData, naFreq = "most", ...)
x |
data.frame containing the output of |
noteMetaData |
data.frame containing identifying meta data for each note, including patient ID, date of the note, and note ID. Column names should be set to ‘filename’, ‘pid’, ‘date’, ‘note’. Date should have format YYYY-MM-DD. |
naFreq |
Expression used to replace missing frequencies with, or by default use the most common. |
... |
drug formulations to split by |
If different formulations of the drug (e.g., extended release) exist, they can be
separated using a regular expression (e.g., ‘xr|er’). This function will call
makeDose
on parsed and paired medication data to calculate dose intake
and daily dose and remove redundancies at the note and date level.
See EHR Vignette for Extract-Med and Pro-Med-NLP as well as Dose Building Using Example Vanderbilt EHR Data for details.
A list containing two dataframes, one with the note level and one with the date level collapsed data.
data(lam_mxr_parsed) data(lam_metadata) lam_build_out <- buildDose(lam_mxr_parsed) lam_collapsed <- collapseDose(lam_build_out, lam_metadata, naFreq = 'most', 'xr|er') lam_collapsed$note # Note level collapsing lam_collapsed$date # Date level collapsing
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.