Vulnerable patients have been sent letters by the NHS with their door codes and key-safe combination numbers printed on the envelopes.

Elderly and other at-risk people found the code numbers – used by carers visiting the patients at their homes – were printed above their addresses, raising fears for their personal safety.

The letters were sent out after the codes were entered into address fields in the Personal Demographics Service data system run by NHS Connecting for Health. By yesterday, 216 cases had been identified.

The Department for Health has launched an investigation to determine the extent of the problem but said there have so far been no reports of intruders getting into people's homes because of the lapse.

Dr Trefor Roscoe, a Sheffield GP, told Pulse magazine: "This is what happens when people who don't know what they are doing are allowed to alter details on the computer. It's the sort of thing that we predicted to happen to all these medical GP systems."