ddediu / AdhereR

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

Plot all intervals from initial event on same line #85

Open Masswear opened 5 years ago

Masswear commented 5 years ago

With compute_event_duration, it's possible to have multiple "secondary events" created from the same primary medication event, e.g. in case of dosage changes, treatment interruptions, or special intervals like hospitalizations etc (see #84 ). Secondary events never overlap. Therefore, it would be useful to plot all secondary events on the same line as the primary event.

The output of compute_event_duration provides a column with the primary event date (same for all secondary events) and another column with a start date and duration for each secondary event. Plotting could use the primary event date for the y-axis and secondary start dates and durations for the x-axis.