Since the classification date is based on the second instance of an inclusion criteria, we only need to keep the earliest two events per PNR per inclusion "stream".
Value
The same type as the input data, default as a tibble::tibble()
.
Details
This function is applied to each "stream", diabetes_diagnoses
,
podiatrist_services
, and gld_hba1c_after_drop_steps
, in the
classify_diabetes()
function after the keep and drop steps, right before
they are joined.
Examples
if (FALSE) { # \dontrun{
data <- tibble::tribble(
~pnr, ~date,
1, "20200101",
1, "20200102",
1, "20200103",
2, "20200101"
)
keep_two_earliest_events(data)
} # }