NHS Digital agreed to share information with the Home Office earlier this year, which will enable immigration officials to use NHS patients’ personal details, including their addresses, to track down, arrest and deport undocumented migrants.
The British Medical Association said it had "significant concerns" about the deal.
A spokesperson said: "The BMA has significant concerns about the memorandum of understanding between the Home Office and NHS Digital, and the apparent lowering of the public interest threshold for sharing confidential patient information."
On Tuesday, the Government’s National Data Guardian, Dame Fiona Caldicott, highlighted the issue when she released a statement welcoming revised General Medical Council guidelines, which address ethical considerations around patient confidentiality, and come into force this week.
She said: "As patients, we take for granted that we can trust our doctors with the most personal information about ourselves. We understand that they may need this in order to know how best to treat us. We expect that they will treat this information with respect."
The BMA said Caldicott was reviewing the deal between NHS Digital and the Home Office and that it was awaiting her findings.
A charity has also launched a toolkit to help medical staff block officials from receiving data about patients.
Doctors of the World has launched its "Safe Surgeries" toolkit, which it said will give GPs and practice staff the means to keep patients’ addresses off NHS records.
Dr Lu Hiam, an NHS GP and Doctors of the World health advisor, said: "The importance of being able to trust your doctor doesn't just apply to migrant patients, it applies to all patients. We want to be able to treat the person in front of us, and be able to assure them of confidentiality."
In the charity’s toolkit are ways to register patients, such as using the address of their medical practice or a local organisation, rather than their home address and a poster for surgery reception areas which informs patients that they do not have to give their home address to medical staff.
The charity is also advising frontline staff not to ask for a passport or proof of identification when registering patients.
NHS Digital and the Home Office said the memorandum of understanding between the two parties - requiring the disclosure of names, gender, address and date of birth - had streamlined the process of gathering information and that nobody would be denied urgent treatment.
A Government spokesperson, speaking on behalf of NHS Digital and the Home Office, said: "We share non-clinical information between health agencies and the Home Office to locate individuals suspected of committing immigration offences. Access to this information is strictly controlled, with strong legal safeguards. No clinical information is shared, and before anything at all is shared there has to be a legal basis to do so. Immigration officials only contact the NHS when other reasonable attempts to locate people have been unsuccessful. This simply streamlines the existing process by which Home Office requests for data are considered. No additional NHS data is being provided to the Home Office and anyone in genuine need can always receive treatment from the NHS - urgent or necessary care is never withheld."
Click here to subscribe to the new FREE public sector bulletin to receive dedicated public sector news, features and comment straight to your inbox.