If the near-lethal police shooting of Alan Pean had occurred anywhere else, we could still be waiting for the official record of events.

But the August shooting that almost killed Pean when he was in the throes of a mental health episode happened at St. Joseph Medical Center in Houston. As a hospital, the facility receives funds from Medicare and Medicaid, and just days after it happened, federal investigators from the Department of Health and Family’s Centers for Medicaid and Medicare Services swooped in to make sure the hospital was in compliance with the guidelines for those federal health insurance programs.

The doctor said he took the drape off the patient and saw he was handcuffed. - CMS report

Now, only a month and change later, an official, legally valid 51-page report of the incident has been made public by the CMS, and the hospital has been found to be severely deficient in many of those guidelines. In a letter, the CMS has given the institution until Thursday to come up with a plan of complete compliance—or have all of its federal funding revoked on October 16th.

“[The report] determined that St Joseph Medical Center no longer meets the requirements for participation in the Medicare program because of deficiencies that represent immediate jeopardy to patient health and safety,” the letter read, emphasis by the CMS.

Among the investigation’s findings: the hospital “failed to ensure there were systems in place that protect the patient right to safe and appropriate care,” and that the hospital “failed to have systems in place to maintain the safety of confused patients and ensure they receive appropriate healthcare intervention when they exhibit aggressive behavior towards staff.” In the end, this lead to the unjustifiable shooting of a confused mentally ill patient, the report found.

The accounts given to federal investigators are harrowing.

Pean was suffering from a mental health episode when he drove himself to the hospital to get psychiatric help. Upon arrival, he crashed his car and was checked in for the injuries he sustained. The following morning while he was receiving treatment for the injuries, Pean walked naked into the hallway several times. By then, his family was on the scene, and they pleaded with doctors to give him a psychiatric evaluation.

After one of these instances, an unidentified nurse called security because “he repeatedly came out of his room naked and could not be redirected.”

A few minutes later, two hospital security guards who were moonlighting from their day jobs as officers of the Houston Police Department arrived. They asked nurses and doctors if there were any sharp objects in the room, to which everyone said “no.”

The two officers went into the room and shut the door.

“A few minutes later there was a loud scuffle, raised voices, and a scream was heard, then a loud ‘pop,'” found the report. One of the officers had been hit in the head with a lunch tray, and Pean had been shot in the chest after they repeatedly tasered him.

It gets worse. Some time later, after hearing from a page that a “Code Blue,” or an emergency situation happened in the room, Pean’s doctor rushed to the scene. “When he arrived on the scene he saw not less than twenty (20) uniformed police officers with handcuffs,” said the report.

Pean was lying on the floor bleeding, with a drape thrown over him. “The patient was quiet, his eyes were closed. The doctor said he took the drape off the patient and saw he was handcuffed,” the report said.

When he asked what happened, officers told him Pean had been tasered, which was strange to the doctor considering all the blood and all.

It was only when someone finally mentioned that he had been shot that the doctor began to assess the patient. With some help Pean was brought onto the hospital bed so he could start taking vitals. The doctor had to ask police to uncuff his patient so he could put in the proper restraints.

Throughout this process, even after being shot, Pean was “throwing punches that were not deliberate but was as result of his condition,” the report said.

Pean has been charged with two counts of aggravated assault against a peace officer.

Days after initial reporting of the incident was made public, thousands of doctors and other medical professionals wrote an open statement about the incident, stating that “Never, never, never is it appropriate for a patient seeking care, to have their life threatened in our arms.”

In statements given to federal investigators, however, senior hospital staff does not agree. The hospital’s CFO, who remains unnamed in the report, told investigators that as far as he understands it, when “police officer mode” comes into effect, it becomes a “criminal investigation,” which the hospital doesn’t have any jurisdiction over.

“When the police officers deployed their weapons they were acting as police officers and not as facility staff,” he told investigators.

The hospital’s Human Resources Officer told investigators that the officers received an orientation and some online training before getting jobs as hospital security.

They were never trained in Crisis Prevention Intervention tactics, she told investigators. Hospitals and some police department regularly use the specified training techniques to de-escalate potentially volatile situations with mentally ill individuals.

In the report, investigators specify that all security in the facility would have to have their training by tomorrow, otherwise “they will not be allowed to work until assigned education is completed.”

Since the incident happened, the report notes that the hospital has rephrased the job description of security officers, stating that their “primary function is to maintain the peace.” It’s not clear how the job description was previously worded.

Bob Moos, spokesperson for the CMS in Texas, told Fusion that threats to defund, or “terminate” Medicaid and Medicare contracts are “very rare.” In the past five years, only seven hospitals across the nation have been terminated from the program, he said.

A spokesperson from the St. Joseph’s Medical Center told Fusion that a corrective action plan has already been submitted to the CMS. An unannounced visit from the Texas Department of State Health Services will take place some time before October 16th, in order to verify the corrections have been enacted.

The Houston Police Department will not comment on the incident that its two off-duty officers were involved in, citing an ongoing internal investigation. The officers received three days of administrative leave following the incident, the department told Fusion last month.

In a statement provided to Fusion, Pean’s brother Christian said: “Many of the findings detailed in the report are new to us, and we are appalled by what took place following the gunshot that almost took our son and brother’s life. The wanton disregard for Alan’s life and well-being documented in the report horrify us.”

Both Christian and Pean’s father work in the medical profession, he said, and “as medical care providers ourselves, we strongly believe numerous measures could have been implemented to prevent this incident from occurring.” Nevertheless, the family is “overjoyed” to learn that some corrective measures are starting to be undertaken by the hospital, thanks to the CMS’ report.

His brother is currently being treated and is recovering in his parent’s hometown of McAllen, Texas.

“We are extremely grateful that Alan is alive and that no one else was more seriously harmed on that awful day. Above all else, we are dedicated to preventing something like this from happening again,” he said.