LONDON — Martin Hardy was in his hospital gown, about to be wheeled into the operating room for knee surgery on Saturday morning at Royal London Hospital in East London, when, he said, his operation was abruptly canceled.

Mr. Hardy, 52, a caregiver for his father, said his surgeon told him the operation could not be carried out because the hospital’s computer system was not working and his condition was not life-threatening.

“I was in my hospital robe literally about to go in,” he said, wincing as he stood on crutches outside the hospital, waiting for a taxi home. “How can anyone in their right mind do such a thing?” he added, referring to the people behind the devastating cyberattack that affected organizations in nearly 100 countries and sent tremors across Britain’s National Health Service.

A day after one of the largest “ransomware” attacks on record, which left thousands of computers at companies in Europe, universities in Asia and hospitals in Britain still crippled or shut down on Saturday, Amber Rudd, the British home secretary, told the BBC that the N.H.S. needed to learn from what had happened and upgrade its information technology system.