Role of immune mechanisms in the pathogenesis of miscarriage