Description Usage Arguments Value Examples
This function determines periods of persistent use of the drug of interest based on the gaps between prescriptions. Gaps which exceed the selected allowable gap length result in discontinuation points, and the function returns patient ID's and periods of exposure that are over the selected minimum length.
1 2 3 | refill_gap(df, drug, gap, threshold = 0, summary = FALSE,
patient_id_col = "patient_id", drug_id_col = "drug_id",
presc_date_col = "presc_date_x", date_format)
|
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 |
gap |
a number, the length of the allowable gap in days between two prescriptions before the patient is considered to have discontinued use of the drug |
threshold |
a number, the minimum length of period of exposure, in days, to be included in the results |
summary |
a logical, if true the function will return a summary of all exposure periods instead of the individual periods |
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 and corresponding periods of exposure (consisting of first and last prescriptions, number of prescriptions and lengths of exposure) which match the chosen refill gap and minimum length
1 2 3 4 5 6 | refill_gap(synth_presc, drug = "SIMVASTATIN", gap = 30,
drug_id_col = "approved_name", presc_date_col = "presc_date",
date_format = "%d/%m/%Y")
refill_gap(synth_presc, drug = "103050", gap = 30, threshold = 60, summary = TRUE,
drug_id_col = "bnf_paragraph", presc_date_col = "presc_date",
date_format = "%d/%m/%Y")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.