One thing that I’ve learned in my surgical training over the years is that the surgeon is the captain of the operating room.

He or she is present to set the tone and collaborate with his or her team of nurses, anesthesiologists and consultants in bringing about the best possible care to the patient without doing any harm. And that is the mantra by which most surgeons operate.

So when I heard the latest allegation that Joan Rivers’ physician took a selfie in the procedure room— while the comedian was under anesthesia before a procedure on her vocal chords that ultimately led to complications and fatal cardiac arrest— I was at a loss for words.

In operating rooms across the country, social media technologies are creating a huge problem. Doctors in many operating rooms are texting, talking or taking pictures during surgery, and it is time for this behavior to stop.

Last year, a woman sued a Los Angeles hospital after her anesthesiologist placed false mustache and tear stickers on her face while a nurse took a photo. And at Medical City Dallas Hospital, an anesthesiologist admitted to texting and reading an iPad during procedures. In a lawsuit stemming from a patient’s death at the Dallas hospital, a surgeon testified that it’s routine for an anesthesiologist to check a cellphone.

In major hospital settings, activities like these are reported and dealt with by hospital leadership. But as many of you know, many surgeries today are done in ambulatory surgical centers, or outpatient clinics, where these types of behaviors may go unchecked.

If doctors want to stop getting beaten over the head about their behavior or lack of self-discipline, they better listen up. These instances are happening far too often, doctors and medical staff must leave their cellphones outside of the operating room.

Hospitals and clinics must have stricter policies in place to make sure that social media technologies do not become part of a routine habit in operating rooms.

And doctors, especially those who treat celebrity patients, must put aside their self-interested bragging about who they treat, in favor of prioritizing how they treat all of their patients.

Dr. Manny Alvarez serves as Fox News Channel's senior managing health editor. He also serves as chairman of the department of obstetrics/gynecology and reproductive science at Hackensack University Medical Center in New Jersey. Click here for more information on Dr. Manny's work with Hackensack University Medical Center. Visit AskDrManny.com for more.