identify_gaps: Identify Gaps in Therapy

Description Usage Arguments Value Note Examples

View source: R/Gaps.R

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

1

Arguments

.data

data frame

Value

A new claims tibble with an appended column, gap

Note

This function relies an adjusted_date column to identify gaps in therapy. So, if you don't want to use propagate_date() beforehand, you'll need to rename the date variable you wish to use to adjusted_date.

Examples

1
2
3
4
5
6
7
library(adheRenceRX)
library(dplyr)

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

btbeal/adheRenceRX documentation built on Dec. 4, 2020, 10:01 p.m.