Scottish government plans to share data from a central NHS database with other public bodies have narrowly survived a Holyrood vote.

The proposals put forward by the SNP government were voted through by 65 to 60, helped by MSP Aileen Campbell who took time out from maternity leave especially to vote.

As reported by EHI News in February, the SNP said it wants to share non-medical data from the NHS central register, which holds details of everyone born or registered with a GP in Scotland, with the HMRC and other public bodies.

This is mainly in order to keep track of taxpayers from April 2016, when the country is set to implement its own rate of income tax.

However, critics – including all the other major political parties in Scotland – have criticised the plans, which would also make the data available to 120 public bodies, including Glasgow Airport, Scottish Canals, Quality Meat Scotland and the Royal Botanical Gardens.

The vote was called by Scottish Liberal Democrat leader Willie Rennie who described the SNP’s plan as creating a "super ID database".

Ahead of the vote he told MSPs: "This matters because the current diffuse storage of information has an inbuilt protection from crime and misuse that would be lost with one super database shared across the public sector.

"We know the problem with putting all your eggs in one basket or putting all your savings in the one bank or business. We should be cautious when the government asks us to do the same now."

A consultation period for the plans closed on 25 February, taking in views from organisations and individuals concerned with the SNP’s proposals.

Deputy first minister John Swinney told MSPs at the vote that the government will consider all submissions to the consultation and that no decision has yet been taken.

“Decisions will also only be taken after there has been full parliamentary scrutiny of any proposals that we advance,” he said.

The SNP’s plans were struck a major blow at the beginning of March when Ken Macdonald, assistant commissioner for Scotland and Northern Ireland at the Information Commissioner's Office, came out against the plans claiming they could be in breach of European rules.

"The ICO has concerns as to whether there is a sufficient public interest justification," Mr Macdonald said. "We do advocate against the creeping use of such unique identifiers to the extent that they could become the national identity number by default.

"If we are to have a national identity number, this should be the subject of proper debate and be accompanied by suitable safeguards. It should not just happen by default."

The medical community has also come out against the plans. Speaking to EHI News a spokesperson from BMA Scotland said: “Given that there is such a strong public interest in maintaining patients’ trust in a confidential health service, the Scottish government must consider other means, outside of the health service, to identify tax payers.”

Dr Miles Mack, chair of the Royal College of General Practitioners (Scotland), had similar views: “RCGP Scotland cannot accept the proposal that GPs, or the other health professionals GPs refer patients to, should be used as information collection services for government.

"The only use for any information collected should be towards the medical care of the patient.”