The memorandum of understanding between NHS Digital, the DHSC and the Home Office has been condemned in a report by the House of Commons health and social care select committee - with MPs' criticism backed up by the RCGP, the BMA and the GMC.
RCGP chair Professor Helen Stokes-Lampard accused the Home Office of a 'blatant disregard for the trusted and vital GP-patient relationship'.
In a report published on Sunday, the select committee warned that healthcare data should be shared for law enforcement purposes only in the event of 'serious crime'. Sharing data for immigration tracing was 'entirely inappropriate', the committee warned, calling into question the judgment of senior staff at NHS Digital.
Committee chair and former GP Dr Sarah Wollaston said: 'There is a clear ethical principle that address data held for the purposes of health and care should only be shared for law enforcement purposes in the case of serious crime.
'NHS Digital's decision to routinely share information with the Home Office with a lower threshold is entirely inappropriate. This behaviour calls into question NHS Digital’s ability to robustly act on behalf of patients in the event of other data sharing requests including from other government departments in the future.
'It is absolutely crucial that the public have confidence that those at the top of NHS Digital have both an understanding of the ethical principles underpinning confidentiality and the determination to act in the best interests of patients.'
Professor Stokes-Lampard said: 'The Home Office is displaying a blatant disregard for the trusted and vital GP-patient relationship, and its casual approach to confidential patient data risks alienating highly vulnerable patients.
'It is treating GP patient data like the Yellow Pages, and we are calling on NHS Digital to take urgent measures to suspend the agreement that is allowing them to do so.'
The RCGP chair said the use of data from GP records for immigration purposes was happening on an 'increasingly alarming' scale.
GPonline revealed earlier this year that a GP practice had been asked by UK Visa and Immigration officials - part of the Home Office - to deliver a deportation notice to a patient.
BMA medical ethics committee chair Dr John Chisholm said: 'The BMA has been vocal in its opposition to this data sharing arrangement between NHS Digital, the Home Office and the DHSC, which risks undermining the very foundation of the doctor-patient relationship.
'As stated by the committee, most immigration offences clearly do not meet the high public interest threshold for releasing confidential data, which according to NHS England, the GMC and even NHS Digital’s own guidance, should be reserved for cases which involve ‘serious’ crime.
'We must therefore question NHS Digital’s ability to act as a trusted custodian for the data it holds and its assertation that it prioritises patients’ best interests when handling their data.'
He added: 'Further, the agreement and the government’s position that the public cannot have "a reasonable expectation" that their data will not be shared among state departments if they are using the NHS, set a dangerous precedent that opens up the possibility of patients’ data being passed on not just in immigration cases, but for other non-health-related purposes.'
GMC chief executive Charlie Massey said: ‘We have repeatedly expressed our own concerns to NHS Digital and the DHSC about its potential impact on patients’ trust in doctors. We have yet to be reassured that information will only be disclosed in cases where there is a clear public interest. Urgent action must be taken to address these concerns.’
NHS Digital chief executive Sarah Wilkinson said: 'We will consider the health select committee’s report carefully and will take into account any new evidence as it becomes available, but we have been through a rigorous process to assess the release of demographic data to the Home Office. This has established that there is a legal basis for the release and has assured us that it is in the public interest to share limited demographic data in very specific circumstances.'
A government spokesman responding on behalf of both the Home Office and the DHSC said: 'Non-clinical information is shared on occasion between health agencies and the Home Office to locate individuals suspected of committing immigration offences. This data is strictly controlled and only shared if there is a legal basis to do so.'
The government said it would respond fully to the select committee report 'in due course'.