********************************************************************************
* keep first ca per patient per entity (group)
********************************************************************************
bysort pat entity ( date_of_incidence tum_sequence tum ) : keep if ( _n == 1 )
isid pat entity
https://github.com/CancerRegistryOfNorway/nordcansurvival/blob/master/inst/stata/ado/extract_define_survival_data.ado#L289