Identification of factors associated with resilience in medical students through a cross-sectional census