propagate_date {adheRenceRX}R Documentation

Adjust Overlapping Fill Dates


When assessing pharmaceutical adherence, one should adjust overlapping dates forward for a specified group (e.g. patient ids or medication classes) so that there is no overlap in days supply. For example, if a patient receives a 30 days supply on January 1st, and another 15 days later, the next fill date should be moved up 15 days. This function is modeled after recommendations from Canfield SL, Zuckerman A, Anguiano RH, Jolly JA, DeClercq J. Navigating the wild west of medication adherence reporting in specialty pharmacy. J Manag Care Spec Pharm. 2019;25(10):1073-77.


propagate_date(.data, .date_var = NULL, .days_supply_var = NULL)



Data to be piped into the function


Date, column indicating the date of a given fill


Integer, column indicating the days supply of a given fill


The initial claims data frame with an appended column, adjusted_date


This function relies on anydate to parse the users date variable into a date class. So, for most columns passed to .date_var, this function will run without warning or error. For example, anydate(30) will return "1970-01-31" even though 30 is most likely a days supply. If strange results are produced, double check that the date variable being specified is indeed a fill date.



toy_claims %>% 
  filter(ID == "D") %>% 
  propagate_date(.date_var = date, .days_supply_var = days_supply)

[Package adheRenceRX version 1.0.0 Index]