A report to be published today by NHS Healthcare Improvement Scotland (HIS) demands that health boards are more open about incidents that lead to members of the public being injured or harmed.
Doctors and nursers will be told to take a consistent approach to reporting mistakes to cut the risk of errors being repeated.
The report defines an adverse event as any incident "that could have caused or did result in harm to people or groups of people". This is the first time there has been a national definition, covering every outcome from deaths to near misses where no-one is hurt.
HIS has been reporting on the management of such incidents in inspections of the management of adverse events in a programme intended to cover all Scottish health boards. The inspections were launched as a result of NHS Ayrshire and Arran's refusal to distribute the findings of more than 50 serious incidents to staff, with details only being exposed after a freedom of information battle by one of its nurses.
Files were ultimately published revealing incidents including one in Ayrshire and Arran, where a patient died after the oxygen supply she was being treated with ran out while she and four nurses were stuck in a lift. In Lothian, a patient died and a ward was evacuated after the patient on oxygen therapy lit a cigarette in the toilet, and an incident in Grampian saw a surgeon staple the wrong organs together during elective surgery.
NHS boards already aim to learn from such events, for example by ensuring spare oxygen cylinders are to hand when a patient is being transferred.
However the framework being published today aims to ensure consistency across NHS Scotland in managing such events, so that wherever a mistake occurs, the person affected gets the same response, staff are treated in a consistent way and events are reviewed in a similar way, so lessons about improving the way work is carried out can be learned and shared.
The guidelines cover hospitals, community health services, GPs clinics, dental practices, pharmacies and optometrists and independent contractors as well as NHS employees.
They have been backed by cabinet secretary for health and wellbeing Alex Neil, who urged boards to work with HIS to improve the safety of patients.
David Farquharson, medical director of NHS Lothian and co-chair of the Healthcare Improvement Scotland's Adverse Events Programme Board, said the publication was a sign of a new approach.
He added: "A national commitment to openness and transparency and learning from errors will ensure that NHS Scotland becomes an even safer environment for patients. The challenge now will be to embed the practices and principles within every NHS board."
HIS has completed inspections of 11 regional NHS boards and two special health boards. When all boards have been reviewed, the framework will be updated to include any changes necessary.