A RAPE victim has welcomed a landmark legal ruling which allows complainers to challenge moves to reveal their medical history in court.

Sarah Scott was raped in 2010 and endured a painful cross-examination about previous mental health problems during her attacker's trial.

The 22-year-old, who was quizzed in court about episodes of self-harming when she was a child, said she was "blindsided" by the line of questioning.

Following a judicial review, Scottish victims of domestic and sexual assaults can now formally object to their private records being disclosed.

Ms Scott, from Aberdeen, said she was "delighted" with the verdict from the Court of Session which will mean other abuse survivors will now have a route to block their exposure in court.

The legal milestone has significant implications for the Scottish justice system - including the Scottish Legal Aid Board (SLAB) who will likely be required to fund courtroom representation for victims who decide to challenge the disclosure of medical records.

Rape Crisis Scotland, which has campaigned to secure the latest ruling, claimed medical records were often exploited for legal advance in courtroom battles and their public scrutiny can dissuade some victims from coming forward.

Sandy Brindley, national coordinator for the charity, said: "This is a very significant step in improving the protection of complainers' rights to privacy within the Scottish justice system.

"Rape Crisis Scotland has serious concerns about the use of complainers' medical records in sexual offence trials. Frequently these records are being sought to look for mental health issues.

"The prospect of having their personal or private lives subject to scrutiny acts as a direct deterrent to complainers reporting what has happened to them to the police.

"Where they do report it, it can add considerably to the trauma and sense of violation experienced by them."

The judgment passed at the Court of Session centred on a domestic abuse case in which access had been sought to seven years of medical records belonging to the complainer.

Prior to yesterday, there was no mechanism for victims to receive legal aid and employ a lawyer to argue against the demand.

Scottish ministers were originally asked to approve legal aid but refused.

Lawyers for the victim - who cannot be named for legal reasons - pursued a judicial review and Judge Lord Glennie eventually found in her favour.

The matter has now been returned to Scottish ministers who will reconsider the application for legal aid.

Rape Crisis Scotland, who gave evidence to the judicial review, said they intervened because the situation was a "serious breach of human rights".

The charity's Sarah Brindley insisted the government had "got it wrong" in this case and urged the introduction of clear rules to protect access to sensitive records.

She said: "A complainer must be told when an application is made for her records, and informed that she has a right to oppose this, to seek legal advice and be represented at any hearing where this is decided upon.

"Legal aid should automatically be made available to complainers in these circumstances, on a non-means tested basis."

The watershed decision has been broadly welcomed by the legal profession.

Solicitor advocate Liam Ewing, who was involved in the judicial review, said the judgment will result in significant changes to both legal aid provision and court rules.

He said: "The courts and the Crown are already conscious of their duties towards complainers. However this decision provides guidance on what that duty entails when access is sought to medical records."

Advocate Claire Mitchell, who was also involved, added: "This is a landmark decision in the protection of complainers' human rights in the court process."

However, advocate Thomas Ross argued that little difference will be made in future cases because access to medical records is already restricted.

He claims that under current procedures, lawyers can petition the court for certain information from the records but are not simply handed over everything.

The request is passed to an independent third party who cherrypicks which sections may be relevant and should be disclosed.

Mr Ross said: "It's pretty difficult to get access to records. You've got to find something specific and relevant and then you might be able to get access to that part of the record.

"It's certainly not the case that you get everything and can trawl through it looking for something."

A Scottish Government spokeswoman said: "Scottish Ministers are currently considering the outcome of the judicial review and what steps it might take to address the points raised in the decision."