Biological determinants of spontaneous late preterm and early term birth: a retrospective cohort study