Description Usage Arguments Value Examples
Calculates the duration in days of individual prescriptions based on the number of daily doses dispensed. A multiplication factor is applied to allow for use in cases where, for example an assumption of less or more than 1 DDD per day is required
1 2 3 | dd_duration(df, drug, dd_factor = 1, patient_id_col = "patient_id",
drug_id_col = "drug_id", presc_date_col = "presc_date_x",
dd_disp_col = "dd_disp", date_format)
|
df |
a data frame containing prescribing records to be analysed - records must contain at least a paitent ID, drug ID, 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 |
dd_factor |
a number, a multiplication factor applied to the dd_disp field to calculate prescription duration |
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 |
dd_disp_col |
a string, the name of the column in |
date_format |
a string, the format of the dates in |
a modified version of df
with records for the drug of interest
with the duration
field added
1 2 3 | dd_duration(synth_presc, drug = "212000",
drug_id_col = "bnf_paragraph", presc_date_col = "presc_date",
dd_disp_col = "ddd_dispensed", date_format = "%Y-%m-%d")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.