A medical charity has launched a campaign against government guidance that “makes border guards of doctors” by allowing the Home Office to access details of undocumented migrants who seek NHS treatment.

Doctors of the World runs clinics for undocumented migrants, victims of trafficking and asylum seekers. It has assisted numerous patients, some pregnant and some with cancer, who are afraid of accessing NHS healthcare due to concerns that a visit to the doctor could lead to deportation.

The organisation has joined forces with the human rights charity Liberty and the National Aids Trust to launch a petition aimed at reversing a data-sharing policy between the NHS and the Home Office implemented this year. They want the government to “stop using NHS patients’ personal information to carry out immigration enforcement”.

Lu Hiam, a GP and Doctors of the World adviser, said: “Confidentiality is the cornerstone of the doctor-patient relationship. Deterring sick people from getting healthcare has serious consequences. Putting this data-sharing agreement in place without consulting doctors is nonsensical, given what a huge impact it has on our professional role.”

The government and NHS Digital, the body that stores patient information, published the agreement in January. The pact makes it clear that NHS Digital is legally required to hand over non-clinical patient details, including addresses and dates of birth, to the Home Office.

Use of NHS data has allowed immigration officials to locate, arrest and deport visa overstayers and undocumented migrants.

Doctors of the World has produced a “safe surgeries” toolkit that outlines practical methods doctors can use to keep patients’ addresses off NHS records, helping them circumvent the Home Office memorandum of understanding on data sharing.

The kit suggests ways to register patients using the address of the local GP practice and informs medical staff that they do not need to ask for a passport or proof of identity when registering patients. The pack also includes posters telling patients that they are not legally required to provide such information.

Martha Spurrier of Liberty says: ‘Fostering fear of the doctor is a whole new dangerous and irresponsible low.’ Photograph: David Levene/The Guardian

Prompted by similar unease, the National Union of Teachers this week passed a motion condemning the Department for Education’s requirement, introduced last September, that parents must supply details of pupils’ nationality and country of birth to schools. The DfE may subsequently pass on this information to the Home Office. The request also forms part of a drive by Theresa May to create a “hostile environment” for illegal immigrants.

Miriam Beeks, a GP at Lower Clapton Group Practice in east London, has put up posters telling patients they can register as “no fixed abode”.

“Doctors, in general, hate the idea that they are being used as immigration officers. Doctors should feel confident about standing against this. We are backed up by both NHS and GMC [General Medical Council] confidentiality rules – our interactions with our patients are confidential,” she said.

Figures released this year show the number of Home Office requests to NHS Digital has tripled since 2014. Department of Health data reveals the Home Office made 8,127 requests for patient details in the first 11 months of 2016, which led to 5,854 people being traced by immigration enforcement.

Martha Spurrier, the director of Liberty, said: “This government has made border guards of teachers, landlords, bank clerks and now even doctors, all as part of a misguided and counterproductive obsession with creating a ‘hostile environment’ for undocumented migrants.

“Fostering fear of the doctor in this way is a whole new dangerous and irresponsible low. It will put the health of the most vulnerable in society at risk, including children and victims of trafficking and torture.”

Deborah Gold, the chief executive of the National Aids Trust, said the decision must be reversed. “Without any consultation, NHS Digital have agreed to share important personal information with the Home Office. They have betrayed their responsibility to safeguard the confidentiality of NHS patients. They have also harmed public health as people are deterred from healthcare,” she said.

A government spokesperson said no clinical information would be shared. “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,” they said.

“Immigration officials only contact the NHS when other reasonable attempts to locate people have been unsuccessful. Anyone in genuine need can always receive treatment from the NHS – urgent or necessary care is never withheld.”

Doctors of the World said it recently helped a woman who visited its east London clinic in labour. She had avoided seeking antenatal care because she feared being reported to the Home Office and was concerned about the cost of treatment.

Doctors of the World also highlighted the case of a young Ugandan woman who was almost six months pregnant and had not sought antenatal care because she was too scared to visit the doctor. She has lived in the UK for five years, her partner is a UK citizen and they are in full-time work, but she does not have a visa.

“I feel trapped. I’m in a situation where I need to go to the hospital but I can’t, because I feel my information might not be confidential,” the woman said. “I can’t imagine being separated from my partner. Maybe they would make me go back without my baby too. I would be separated from one or even both of them.”

The organisation was also contacted by a woman from the Philippines who has lived here for several years without a visa. She found a lump on her breast last September and was concerned because of a family history of breast cancer.

The woman, who worked as a cleaner, received an appointment for a biopsy but did not attend, amid concerns that the hospital would share her details with the Home Office.

She said: “I felt like I was carrying the weight of the whole world. I was worried that if I went to the hospital and the immigration authorities know about it, they might get me and deport me. But if I didn’t go to hospital, then what about the lump?”

The woman said she forced herself to go to a second appointment and the lump was eventually removed. But she remains concerned about the risks of seeking medical help. “For years I had just tried to protect myself from getting sick, like by always wearing warm clothes, because I thought it wasn’t safe to go to the doctor,” she said.