SAN JOSE — A Stage 4 cancer patient angry that Bay Area doctors allegedly treated him like a “laboratory monkey” is suspected of setting out to kill three of them, armed with two handguns and Google maps of directions to their homes, according to authorities.

Yue Chen, 58, also planned to kill himself after he carried out what he considered a revenge mission, but he failed to find any of the doctors, got lost and may have been on his way back to his Visalia home when he was arrested May 31 on Highway 101 in San Jose.

According to a police report, Yue told police that he called his wife and told her he was scared. She cried and said, “Come back, come back, don’t kill yourself.”

Inside his rental car, officers found two loaded semiautomatic weapons, a white rubber mask and a notebook with the names and addresses of several doctors, according to a Palo Alto police report. One of the guns had a 32-round magazine and the other 16 rounds.

Police also found a typed note entitled “why do I kill,” which listed reasons including revenge and to serve as a reminder that “this is possible if you treat people like an animal.”

The Santa Clara County District Attorney’s Office has charged Chen with three felony counts of premeditated attempted murder. Once arrested, Chen told authorities he was diagnosed with Stage 4 cancer and didn’t have long to live, according to a police report.

“This was great joint cooperation, and really prevented a huge tragedy by someone who has nothing to lose,” said Santa Clara County prosecutor Charles Huang.

On May 31, Palo Alto police dispatchers received a call from Visalia police who warned them Chen may be driving to the Bay Area to kill three of his doctors. A family member reported Chen missing to the Visalia police that morning, and when officers went to his home they found a typed note left behind by Chen which stated he “had to kill these doctors today because they are evil,” according to the police report.

Chen, a Chinese immigrant who lived in New York before moving to California, said he drove from Visalia to San Francisco, and went to a hospital, according to the report. The names of the hospitals in the police report were redacted, but prosecutors said one of the doctors worked at UCSF Medical Center. Another UCSF physician and at least one Stanford Health Care doctor also were targeted, the report said.

Both UCSF and Stanford Health Care released statements Tuesday saying the physicians involved were notified immediately and all precautions were put in place to secure their safety and the safety of their employees.

After leaving UCSF, he went to another location, because he thought one of the doctors lived there.

After his arrest, Chen told detectives he believes he was being used as a tool for research. He detailed several complaints regarding his medical treatment, beginning in 2008, including his belief that doctors were “damaging his spine so they can use him to train new students,” according to the police report.

“They only hurt me,” Chen reportedly told detectives. “They hurt me both hospitals. They really screw my life, or the doctors lie to me. Hospitals, they all cover for each other.”

One of the targeted doctors either worked or lived in Palo Alto. Police there were aware that Chen might be headed in their city and “were in position to prevent him from getting there,” Palo Alto police Lt. James Reifschneider said.

“We have to give credit to Visalia for taking the threat as serious,” Reifschneider said. “They went out on a missing persons case. Because they were thorough, they were able to identify there was much more to the story.”

Get top headlines in your inbox every afternoon.

Sign up for the free PM Report newsletter.

Visalia police contacted police agencies across the Bay Area that had jurisdiction over the work locations of the targeted doctors, as well as other doctors who treated Chen. Visalia also broadcast a bulletin to police agencies throughout the state to be on the lookout for Chen.

The CHP eventually located Chen’s probable location and route by pinging his cell phone, according to the police report. CHP officers flooded the area of southbound Highway 101 in South San Jose and conducted a high-risk stop of his rented red 2017 Nissan Rogue near Hellyer Road.

Chen complained of pain and was taken to a local hospital. There, detectives interviewed Chen.

The subject of workplace violence against health care workers in the U.S. was addressed in 2016 by Dr. James Phillips of Harvard Medical School and Beth Israel Deaconess Medical Center in Boston.

In an article he wrote for the New England Journal of Medicine last April, Phillips noted the murder in January 2015 of a surgeon at Brigham and Women’s Hospital in Boston who was shot and killed at work by the son of a deceased patient. Just days before the killing, he wrote, a Veterans Affairs psychologist was killed in his clinic by a patient in El Paso, Texas. And in March 2016, a urologist in New Orleans was shot and killed in his office by a former patient, who then committed suicide.

Although the murder of a health care worker is rare, he wrote, episodes of work-place violence against medical providers happen daily across the country.

“Health care workplace violence is an under reported, ubiquitous, and persistent problem that has been tolerated and largely ignored,” Phillips wrote.