ddediu / AdhereR

Computation of adherence to medications from Electronic Healthcare Data in R
26 stars 6 forks source link

CMA_per_episode for adherence threshold #56

Open Masswear opened 5 years ago

Masswear commented 5 years ago

An option to calculate episodes with CMA values at or over a certain threshold. This could be achieved inexpensively by:

CMA_per_episode(CMA="CMA1",
                data=med.events,
                maximum.permissible.gap = 0.8, #CMA threshold for episodes
                maximum.permissible.gap.unit = "CMA", #
                date.format="%m/%d/%Y")
  1. Calculate treatment episodes (compute.treatment.episodes) with maximum permissible gap of 1 day
  2. For each episode, check whether
  3. If no, combine current episode with next episode
  4. If yes, a) calculate b) set and end.episode.gap.days = end.episode.gap.days-permissible.gap.days
  5. Go to next episode