This function returns a data.frame with the relevant information on immunization for the study. An individual is considered immunized after the characteristic time for the immune response of the vaccine passes. This time is provided to the function by the parameter immunization_delay. By default, it is set to 0. The function searches for vaccine dates based on the end of the follow-up period of each individual defined by the censoring date (if provided), outcome delay (if present), and end of the study.
The function also works with vaccination information spread across several columns. If this is the case, the parameter vacc_date_col must be passed as a vector with the names of all the columns to use. The function uses by default the latest date found. However, it can also select the first date by setting take_first = TRUE.
The function returns a column with the immunization date (immunization) and a vaccine status column (vaccine_status) that is constructed based on immunization. For several vaccines, the function also returns the name of the column of the vaccine that was selected as immunizing (immunizing_dose). If different custom names (e.g., brands) are associated with each vaccine date, the function can return the custom name of the vaccine selected as immunizing. This information must be passed in the parameter vacc_name_col, as a vector in the same order as vacc_date_col.