ddediu / AdhereR

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

Consider hospitalizations during CMA computation #64

Closed Masswear closed 5 years ago

Masswear commented 5 years ago

In compute_event_durations, users can specify periods that are covered from supplies not recorded in the dataset (e.g. hospitalizations). These periods can be within treatment episodes, so there should be a possibility to account for these periods during CMA computation.

ddediu commented 5 years ago

Ok, how exactly?

Masswear commented 5 years ago

Potentially in the same ways currently implemented in compute_event_durations: continue (default, no change needed), discard (remaining supply is dropped at the beginning of the hospitalization), carry-over (the hospitalization period is counted as an additional supply for all or selected medications).

Maybe needs to be discussed in the team.

Masswear commented 5 years ago

I added a new function cover_special_periods that identifies special periods in proximity to already covered durations and adds additional events for the durations of the special periods. Planned release for 0.5.0

cover_special_periods(events.data = event_durations,
                      special.periods.data = event_durations_list$special_periods,
                      ID.colname = "ID",
                      disp.start.colname = "DISP.START",
                      duration.colname = "DURATION",
                      medication.class.colnames = "ATC.CODE",
                      days.before = 7,
                      days.after = 7,
                      date.format = "%Y-%m-%d")