On Shimura varieties of orthogonal type