The UK government has partially backed down from ordering the NHS to hand over patients' personal details to the Home Office so it can track down illegal immigrants.

The decision to force NHS Digital cough up non-clinical records came under fire from privacy and civil liberties campaigners, doctors, and Members of Parliament, who said it could stop migrants seeking medical treatment, drive them into already-stretched A&E departments, and damage public perception of the NHS's ability to protect folks' privacy. Critics also said the transfer of records was at odds with the NHS Code of Confidentiality, which only allows confidential data to be shared in the case of serious crime.

The government argued that non-clinical info – such as last known address or date of birth – was at the "lower end of the privacy spectrum," and flatly rejected calls from Sarah Wollaston, the chairwoman of Parliament's health select committee, to scrap the arrangement.

However, the Windrush scandal – in which people living in the UK for decades with a legal right to remain were facing expulsion as illegal immigrants – has since shone a brighter light on the British government's policy of fostering a rather "hostile environment" for illegal immigrants. Today, digital minister Margot James indicated that the handover agreement was going to be rejigged.

"We have also dealt, I hope effectively, with my honourable friend for Totnes [Wollaston]'s concerns about the sharing of data between the Department for Health and the Home Office," James told MPs during a debate in the House of Commons within the past few hours.

The Home Office said that, with immediate effect, immigration officials can only request personal information on patients it specifically intends to deport because they have been sent down for a year or more for committing other crimes. Also, if someone unlawfully in the UK is deemed a public danger, or has committed a "serious crime," then they too could have their non-clinical records extracted from the NHS by immigration officials.

“The changes mean that data will be requested to locate foreign national offenders we intend to deport who have been given a prison sentence of 12 months or more and others who present a risk to the public," a Home Office spokesman said.

This means, we note, that even if a person has yet to be convicted of a crime, if their presence is considered to be a risk to security, the Home Office could still pull up their contact details and other info from NHS databases.

This concession is in line with an amendment tabled by a large cross-party group of MPs including Wollaston, who welcomed the move:

Delighted to hear confirmation from @margot_james_mp that the threshold for data sharing of confidential patient address data with Home Office has been restored to serious crime. Thank you to all @CommonsHealth colleagues & campaigners — Sarah Wollaston MP (@sarahwollaston) May 9, 2018

However, Rita Chadha, of the Migrants Rights Network, which has launched a legal challenge against the data handover, was more cautious.

"We're reserving judgement until the full details are released," she said, adding that the group still wanted to see the whole thing completely scrapped because, for one thing, "serious crime" is too loosely defined. Thus, the Home Office could just seize an illegal immigrant's records anyway, even if they were not jailed for 12 months or more. She said even those who are suspected of a serious crime are entitled to healthcare.

The concession on health data came as MPs debated an exemption for immigrants that would effectively remove a person's rights as a data subject – for instance, their ability to access information stored about them, or ask how it is being used – if granting said rights would prejudice "effective immigration control."

This has been unsuccessfully challenged before in both the Lords and the Commons, and is expected to be voted on later this evening.

Earlier this year, it was revealed that the British government was planning to stop monitoring pupils' nationality in its school census, which activists have been campaigning against since 2016. ®