calculate_pdd: Calculate Number of Prescribed Daily Doses Dispensed

Description Usage Arguments Value Examples

View source: R/daily_dose.R

Description

Calculates the number of Prescribed Daily Doses (PDDs) dispensed based on individual patient instructions on how many tablets should be taken per day, and the number of tablets dispensed, and adds this as a new column to the data frame.

Usage

1
2
calculate_pdd(df, drug, drug_id_col = "drug_id",
  qty_disp_col = "qty_disp", qty_per_day_col = "qty_per_day")

Arguments

df

a data frame containing prescribing records to be analysed - records must contain at least a paitent ID, drug ID, a quantity dispensed and a quantity per day instruction

drug

a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions

drug_id_col

a string, the name of the column in df containing the drug IDs

qty_disp_col

a string, the name of the column in df containing the quantity of drug dispensed

qty_per_day_col

a string, the name of the column in df containing the quantity of drug to be taken per day

Value

a modified version of df containing records for the drug of interest with the dd_disp field added

Examples

1
2
calculate_pdd(synth_presc, drug = "ATORVASTATIN",
drug_id_col = "approved_name", qty_disp_col = "qty_dispensed")

amarshall1/prescribeR documentation built on May 20, 2020, 2:34 p.m.