Wharton had tried to contact the woman on Instagram but after she did not respond a few days later he followed her from his Snapchat account, Greater Manchester Police said.
The nurse “coerced the woman into a relationship where he took advantage of her and began sexually assaulting and raping her,” the force said.
Detectives said he attacked her on the ward as well as away from it.
Wharton pleaded guilty to five counts of a care worker engaging in penetrative sexual activity with a mentally disordered female and two counts of care worker engaging in non-penetrative sexual activity with a mentally disordered female.
Det Con Chloe Stevens said: “I commend the victim for her bravery in reporting these offences to the police and trusting us to investigate.
“The suffering Wharton has inflicted on a young and vulnerable woman is utterly deplorable and I am pleased the sentence places him safely behind bars.
“He was in a position of care and abused that power for his own sexual gratification.”