adheRenceRX (version 1.0.0)

identify_gaps: Identify Gaps in Therapy

Description

Compute gaps in a patient's therapy from the end of their prior fill to the beginning of the next. This function assumes that one has arranged the dates and grouped appropriately outside of the function. The length of any gap will be appended to the row after the gap has occurred.

Usage

identify_gaps(.data)

Arguments

.data

data frame

Value

A new claims tibble with an appended column, gap

Examples

Run this code
# NOT RUN {
library(adheRenceRX)
library(dplyr)

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


# }

Run the code above in your browser using DataLab