This is a core function for checking if start dates are duplicated or earlier than last visit's (possible datetime data entry error), can be used in separate checks for each domain

dtc_dupl_early(dts, vars, groupby, dtc, ...)

Arguments

dts

dataset, e.g. EX

vars

variables in a form c("USUBJID", "EXTRT", "VISITNUM", "VISIT", "EXSTDTC")

groupby

variables used for grouping and visit.order derivation

dtc

the date variable

...

variables used for ordering before visit.order derivation

Value

dataframe with records of duplicated or earlier than last visit date

Author

James Zhang