Cynthia,
Thank you for this information. I have a current situation in which I need to find the out when a patient has filled their last prescription without a gap of 45 days or more. However, if that patient also has several refills prior to that gap (gap = date_dispensed - date_dispensed [prior] + days_supply [prior]) that were filled early, there is an excess supply problem. In other words if that patient had a gap of 46 days but actually had refilled their last prescription 3 days early, they would have the amount supplied plus the 3 days. This would then move their gap from 46 days to 43 and then they would not be counted in the group of discontinued patients.
What I am trying to do is find some code that will allow me to move forward and look backward to adjust the runout date (i.e. date_prescribed + days_supply) before moving on to the next row. Additionally, it would need to account for it being the last row as well as if the person only had one or two prescriptions filled.
I have tried a number of different loop approaches as well as processing each claim through an array but I am still having the same issues.
Any thoughts?
Thanks in advance.
jmsaluki
... View more