Skip to contents

Since the classification date is based on the second instance of an inclusion criteria, we need to keep the earliest two events per PNR per inclusion "stream".

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.

Usage

keep_two_earliest_events(data)

Arguments

data

Data including at least a date and pnr column.

Value

The same type as the input data.