Audit Scotland's investigation exposed a culture that focused on hitting the Government's treatment times targets but not on how the results were being achieved.
The independent watchdog's trawl was conducted after deliberate manipulation of waiting list figures was exposed in NHS Lothian. It found some evidence that similar tactics may have been employed in other health board areas.
NHS Lothian marked patients as socially unavailable for treatment when they had refused to go to England to have a procedure at short notice. When patients were about to breach the waiting times target, their files were altered to mark them unavailable for treatment and prevent the breach happening.
Jillian Matthew, who managed the Audit Scotland investigation, said: "We cannot verify that all patients were treated appropriately. There was a considerable rise in the percentage of patients with social unavailability codes across Scotland between 2008 and 2011 and that was the code that was used to manipulate records in NHS Lothian.
"Then the code use started to reduce in most boards in late 2011. That was around the time concern was raised about NHS Lothian."
Health Secretary Alex Neil and his predecessor Nicola Sturgeon faced calls to apologise. Jackie Baillie, health spokeswoman for Labour, said almost one in four patients has been on a hidden waiting list.
She added: "This report makes clear that hidden waiting lists were widespread, not just in Lothian, and the SNP Government was aware there was a problem and did nothing. It preferred to believe its own spin and hype than concern itself with what was really going on in our hospitals.
"The system is broken. It needs fixed."
Audit Scotland said the proportion of people on the waiting list given a social unavailability code rose from 11% in 2008, when the system came in, to more than 30% at the end of June 2011.
Scottish Conservative health spokesman Jackson Carlaw said: "If you look at the trends presented here, it is difficult to reach any other conclusion than the deception used by NHS Lothian may well have been mirrored elsewhere."
Problems accessing old computer records, particularly in NHS Greater Glasgow and Clyde (NHSGGC), as well as NHS staff failing to state why they were marking patients as socially unavailable, has made it difficult for the auditors to draw firm conclusions about the trend.
The report highlights some data anomalies that raise questions about how carefully codes were being applied.
In NHS Grampian, 171 orthopaedic patients in June 2011 were marked as medically unavailable for treatment over a period of two hours, and the following month 180 over a period of one hour. These periods of medical unavailability were immediately followed by a period of social unavailability.
In NHSGGC 70% of patients – 900 people – waiting for orthopaedic treatment at the Western Infirmary were coded as socially unavailable for treatment at the beginning of 2011. The national average is 38%.
The Audit Scotland report says: "In our detailed fieldwork, we identified local practices that mean many patients may have waited considerably longer than the reported waiting time."
Figures for the end of June 2011 showed 3% of inpatients waiting more than nine weeks for treatment.
Including those who had periods of unavailability applied or their entire wait wiped out, the figure was 23%.
The watchdog is calling for robust monitoring of how waiting lists are managed, clear communication with patients about their rights to timely treatment and effective whistleblowing policies to ensure staff are not afraid to raise concerns.
Theresa Fyffe, director of the Royal College of Nursing Scotland, said the report "is a wake-up call to the Scottish Government to look again at the systems in place and whether health boards have enough staff and enough beds and resources to deliver waiting time targets".
Mr Neil welcomed the report. He said: "This report covers a time period which ended 14 months ago, and there have been changes to the system since then, so I am pleased to say that the majority of the recommendations in this report are already under way."
Meanwhile, the First Minister has defended the health service and his former health secretary Nicola Sturgeon after the SNP was accused of misleading patients over hospital waiting times.
Labour leader Johann Lamont mounted an attack on Ms Sturgeon after public spending watchdogs published a new report into how patient waiting times targets are approached by health boards in the wake of problems at NHS Lothian.
Labour said that showed almost one in four people had to wait more than nine weeks for an inpatient appointment, compared to the 3% the Scottish Government had said.
Ms Lamont blasted Ms Sturgeon, who was health secretary until a reshuffle last year.
"Someone should tell Nicola Sturgeon false statistics and public deceptions don't cure patients and they don't win referendums either," the Labour leader said
"It has been said that in politics there are two types of health ministers - failures and those who get out in time.
"Isn't the truth, laid bare today, that despite the spin, Nicola Sturgeon didn't get out in time?"
Alex Salmond hit back, claiming his rival's attack "wasn't about the health service, it's all about get Nicola Sturgeon from the Labour Party".
In heated exchanges at Holyrood, the First Minister said the NHS "isn't without failings, isn't without faults, but is an outstanding health service of which every one of us should be proud".
But he said Labour's attitude to it was "not about improving the service, not about being jointly proud of the greatest public service in our country", but instead to see it as something which they could use for political attacks on the Government.
Mr Salmond and Ms Lamont clashed at First Minister's Questions in the Scottish Parliament.
Their exchanges came after spending watchdogs Audit Scotland said public trust in NHS waiting times has been put at risk by falsified figures and must be restored by the Scottish Government and health boards.
Ms Lamont said that in June 2011 the Scottish Government had said only 3% of patients had to wait more than nine weeks for an inpatient appointment.
But she added: "The truth wasn't 3%, the truth was 23%. Not three out of 100 but one out of four patients waiting."
The Labour leader demanded: "Why did the Scottish Government mislead patients in need of hospital treatment this way?"
Mr Salmond explained there had always been people who were either socially or medically unavailable for treatment
But it was the SNP administration, he said, that had abolished so-called hidden waiting lists.
Previously, patients had been given an availability status code (ASC) when they are unable to attend a hospital appointment, resulting in them being excluded from the quarterly waiting times statistics.
The First Minister said: "One of the first acts of this Government was to abolish the availability status code under Labour. That represented 33% of inpatient waiting lists."
He said the 23% figure Ms Lamont quoted was "by definition 10% less than the figure that was inherited from the Labour Party".
He insisted his Government was "actually facing the issues as opposed to the position we inherited where people were dumped on the availability status code and left there ad infinitum".
The Labour leader, however, claimed that "far from abolishing hidden waiting lists, Nicola Sturgeon, for her own political reasons, reinvented and reinforced them".
In its report, Audit Scotland found that the use of "social unavailability" by health boards increased from 11% in 2008 to just over 30% in 2011.
The levels then dropped off around the time fiddled waiting figures were discovered at NHS Lothian.
Ms Lamont continued her attack and said: "In 2011 Nicola Sturgeon was given a set of figures which said that only 3% of patients waited more than nine weeks for hospital treatment when the truth was 23%.
"At the same time she was given figures which said that the number of people too busy to go to get the treatment they needed had tripled.
"She was told that one in three Scots on waiting lists said they were too busy to be cured.
"She knew what was happening. Did she not have the whit to notice that waiting lists were being falsified?"
Mr Salmond said that under the SNP figures for social unavailability are published, saying this meant "by definition they can't be hidden".
He also said examinations had found only a "small number of instances in which unavailability codes were used inappropriately".
He explained: "There are a variety of reasons why people won't have operations at particular times, they might have a medical condition which prevents them having an operation, they might have high blood pressure, or a heart condition, they could be pregnant, which would make a medical procedure inadvisable."
The First Minister said Audit Scotland had recognised that this medical unavailability had remained "relatively consistent at about 6%-8% over recent years".
He continued: "There's a range of reasons why people might not want to have an operation at a specific time, because they've got work reasons, because they are on holiday, there is range of reasons. That also is perfectly legitimate."
In its report, Audit Scotland also complained it had been hard to trace changes on patient records and identify reasons for the use of waiting time codes.
Mr Salmond said: "What the report points to is the IT systems are not robust enough to provide that examination."
But he told MSPs the IT systems were being "enhanced and improved".
The First Minister said: "If you have a problem with your information technology, isn't it a good idea to introduce a system to sort it out?
"Or would it be preferable to leave it alone as the Labour Party did, and not improve these things in the health service?"
He stated: "It's not just a tale of two governments, it's a tale of changing a system which was clearly a hidden waiting list affecting 33% of patients.
"It's of constant improvement to try to get the IT systems to a position where we can have robust figures, and it's a position now of making the changes that are required so that patients around Scotland can have confidence in these figures."
Liberal Democrat leader Willie Rennie asked if Mr Salmond regrets his Government issuing "50 press releases bragging about his waiting times initiative".
"He was telling us how good the system was at the same time as thousands were being sent to the waiting times equivalent of Siberia," said Mr Rennie.
"Has he got anything humble to say to those people?"
Mr Salmond said: "The availability status code that was abolished could be described, under a government of course which the Liberal Party were part of, as the health service equivalent of Siberia because you lost all rights in waiting times within the system.
"The whole purpose of the new system that was introduced was that you didn't lose these rights.
"The clock was reset and you still retained these rights in the health service."
He added: "There are proper reasons why people might not have a procedure in a set timescale, which is why of course the Audit Scotland conclusion of sampling of a vast number of patients found a small number of instances in which unavailability codes were used inappropriately.
"Given that that is the finding of Audit Scotland, that tends to back up the fact that when improvements are necessary, both in style and in terms of the computer systems that back it up to give it security, that this health service is performing substantially better than it was when the Liberal party were part of the Labour coalition, which did I'm afraid leave some patients in the health service equivalent of Siberia."