Man accused of rape of a woman detained under a hospital order