This function repairs and standardizes visit
data after being read by
read_gsed_fixed()
to ensure that the visit
data is in a consistent
format.
Details
The function performs several operations:
Ensuring required columns are present
Repairing
subjid
according to ISO 3166-1 numeric codeDefining GSED cohort and cohort number
Removing duplicate visits based on unique identifiers
Sorting the data by
cohort
,subjid
,agedays
,vist_type
, andins
The function is to be run after read_gsed_fixed()
A unique visit identifier consists of: subjid
, agedays
, vist_type
, ins