NewYork-Presbyterian Hospital has agreed to pay a $2.2 million penalty to federal regulators for allowing television crews to film two patients without their consent – one who was dying, the other in significant distress. Regulators said Thursday that the hospital allowed filming to continue even after a medical professional asked that it stop.

At the same time, regulators clarified the rules regarding the filming of patients, prohibiting health providers from inviting crews into treatment areas without permission from all patients who are present. That could end popular television shows that capture emergencies and traumas in progress, only getting permission from patients afterward.

“It is not sufficient for a health care provider to request or require media personnel to mask the identities of patients (using techniques such as blurring, pixelation, or voice alteration software) for whom an authorization was not obtained,” the Office for Civil Rights within the U.S. Department of Health and Human Services said in an online post.

The Office for Civil Rights oversees the federal patient privacy law known as HIPAA. Privacy rules for enforcing the law do not allow media access to patients’ health information without authorization, the post said.

Joel Geiderman, co-chair of the emergency medicine department at Cedars-Sinai Medical Center in Los Angeles and chairman of the ethics committee of the American College of Emergency Physicians, said the decision may finally end real-life shows taped in hospitals.

When a Patient’s Death is Broadcast Without Permission The ABC television show “NY Med” filmed Mark Chanko’s final moments without the approval of his family. Even though his face was blurred, his wife recognized him. “I saw my husband die before my eyes.” Read the story.

“I think this will have a chilling effect on hospitals going forward,” he said. “Any hospital legal counsel worth his salt or any PR director would be committing malpractice in order to allow it to occur. It’s now embodied in a federal directive.”

The federal fine involves the case of Mark Chanko, who was hit by a garbage truck in 2011 and taken to NewYork-Presbyterian Hospital/Weill Cornell Medical Center. A crew from ABC’s hit show NY Med filmed as doctors unsuccessfully sought to save his life. Chanko’s widow, Anita, recognized her husband while watching the show the following year, though his face was blurred and his voice was muffled.

The family’s story was chronicled last year by ProPublica, in collaboration with the New York Times. Chanko's son, Kenneth, filed a complaint in January 2013, but it took more than three years to resolve.

The Office for Civil Rights called the disclosures “egregious.” It did not identify the patients by name.

“This case sends an important message that OCR will not permit covered entities to compromise their patients’ privacy by allowing news or television crews to film the patients without their authorization,” said Jocelyn Samuels, the office’s director, in a written statement.

Kenneth Chanko said the family was “very grateful, happy, relieved” by the news. “I’m almost at a loss of words because we’re just so grateful that action was taken and this will have a national impact on hospitals,” he said.

In resolving the case, NewYork-Presbyterian did not admit wrongdoing or that it violated the Health Insurance Portability and Accountability Act. In addition to paying the fine, it agreed to update its privacy policies and provide additional training to staff. The government will monitor its compliance for the next two years.

In a statement, the hospital said it does not believe it violated HIPAA’s privacy rules.

“Our participation in the ABC News documentary program NY Med was intended to educate the public and provide insight into the complexities of medical care and the daily challenges faced by our dedicated and compassionate medical professionals,” the statement said. “This program, and the others that preceded it, garnered critical acclaim, and raised the public’s consciousness of important public health issues, including organ transplantation and donation. It also vividly depicted how our emergency department medical team works tirelessly every day to save patients’ lives.”

Earlier this month, New York’s highest court revived a lawsuit filed by the Chanko family.

In a unanimous decision, with one justice not taking part, the New York Court of Appeals allowed the suit to proceed against NewYork-Presbyterian Hospital and its former chief surgical resident Sebastian Schubl. The suit alleges breach of the doctor-patient confidentiality owed to Chanko.

But the high court did not allow the family to pursue its claim of intentional infliction of emotional distress against the hospital, doctor and ABC, which aired “NY Med.”The conduct alleged, while “offensive,” was not outrageous enough to justify damages on that count, the judges found.

Legislation has been proposed by New York lawmakers that would make it a crime to film patients without consent (with certain exceptions). And last summer, the trade group representing hospitals in New York City said its members would voluntarily agree to allow filming of their patients only with prior consent.

Clarification, April 22, 2016: A prior version of this story was not clear about who filed the complaint with federal regulators that led to a $2.2 million penalty against NewYork-Presbyterian Hospital. It was Mark Chanko’s son, Kenneth, not Anita Chanko.