Description Usage Arguments Value Examples
Determines which patients within a data frame have been exposed to the drug of interest, based on having at least the desired number of prescriptions matching the drug identifier of interest, with option to also provide counts and dates of the first matching prescription.
1 2 3 4 |
df |
a data frame containing prescribing records to be analysed - records must contain at least a paitent ID, drug ID and a prescription date |
drug |
a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions |
flatten |
logical, if TRUE the function will only count one record/ prescription per drug ID per date |
threshold |
a number representing the minimum number of prescriptions that must be present for the patient to be considered exposed |
summary |
logical, if TRUE the corresponding prescription counts and first prescription dates will be returned alongside patient IDs |
return_all |
logical, if TRUE the output will contain all patients with a flag indicating if they were exposed or not, and if FALSE will only return data for patients who meet the exposure threshold |
patient_id_col |
a string, the name of the column in |
drug_id_col |
a string, the name of the column in |
presc_date_col |
a string, the name of the column in |
date_format |
a string, the format of the dates in |
a data frame containing patient IDs who match the selected criteria,
and if summary
is TRUE the corresponding prescription counts and
dates
1 2 3 4 5 | ever_use(synth_presc, drug = "CITALOPRAM", drug_id_col = "approved_name",
presc_date_col = "presc_date")
ever_use(synth_presc, drug = "212000", summary = TRUE, threshold = 10,
flatten = TRUE, drug_id_col = "bnf_paragraph",
presc_date_col = "presc_date", date_format = "%Y-%m-%d")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.