Andrew Temple, 53, preyed on the victim from the age of eight and even committed a sex crime against her during a ward visit.
Temple, formerly of George Terrace, Loanhead in Midlothian, had earlier denied a string of charges during a trial at the High Court in Edinburgh.
But a jury convicted him of the seven offences he faced, including two charges of rape and three of indecent behaviour towards the girl, and two further offences of indecency against boys who were aged six and between six and seven.
A judge told Temple that he had taken advantage of young children for his own sexual gratification.
Judge Robert Weir QC said the offences of which Temple was convicted, particularly those against the girl, were “plainly very serious”
He told Temple that as a result of the jail sentence he was imposing he would remain on the sex offenders’ register indefinitely.
Temple’s offending against the girl began in 1996 and took place at addresses in Easthouses and Dalkeith, in Midlothian, and in Fort William, including at the Highland town’s Belford Hospital, where the victim was being treated and went on up to 2004. The boys were targets for his abuse between 1996 and 1999.
The female victim, now aged 31, first spoke to police in 2003 but told the court that she was informed that there was not enough evidence to charge her abuser.
She later contacted police again in 2010 when she was feeling “really suicidal”. She said she had three overdoses and added: “I just thought ‘enough is enough’. Something needs to be done.”
She made a further contact with police in England in 2014 which eventually led to Temple being charged.
At one stage she handed a letter to officers in which she detailed some of the abuse that she suffered at the hands of Temple.
She wrote: “He started touching me, getting me to do things to him and having full sex with him.”
She said she remembered Temple offering her cider and she drank glass after glass until she was feeling “funny and sick”.
She recalled him raping her and wanting him to stop but he did not.
Afterwards Temple returned and asked her if she liked it and she told him “yes” because she felt really frightened. He told her not to tell anyone about it.
Defence solicitor advocate Chris Fyffe told the court that Temple continued to maintain his innocence, but realised that a custodial sentence was inevitable because of the seriousness of the convictions.
He said the supermarket worker had stopped drinking in 2006 after a problem with alcohol during much of his adult life.
Mr Fyffe said: “He has recognised that alcohol played a very negative role in his life. It impacted negatively on relationships and on his working life.”
“He was not the person he is now and that was as a result of his alcoholism,” said the defence lawyer.
Sign up to our newsletter: enter your email in the box at the top of this article to get daily updates straight to your inbox.