Association between thyroid dysfunction and dysglycaemia: a prospective cohort study