A man has been jailed for eight years after he sexually abused patients while working as a GP over a 15-year period.