CHICAGO -- Moments before her ex-fiance fatally shot her in the parking lot of the hospital where she worked, a Chicago doctor called 911 to report that she had spotted the man and feared for her life. As investigators tried to piece together the events that ended with the deaths of the doctor, a police officer, a hospital employee and the gunman, they were able to fill in details about the attack Monday at Mercy Hospital on the city's South Side.

Dr. Tamara O'Neal had recently called off her engagement to Juan Lopez so when she saw him, she called for help. She also told an acquaintance in the parking lot that she was afraid before that person retreated to the hospital to call 911 as well.

When Lopez confronted her, the former couple argued about O'Neal calling off the engagement, and Lopez demanded that she return the engagement ring. Then, police said, people inside and around the hospital heard gunfire.

Dr. Tamara O'Neal was fatally shot by her ex-fiance as she was walking to work at Mercy Hospital. CBS Chicago

O'Neal fell to the ground. Witness James Gray looked out of the hospital window to see where the gunshots had come from and watched as Lopez "stood over her and shot her three more times," he told reporters.

Get Breaking News Delivered to Your Inbox

As a squad car pulled up, Lopez turned his Glock semi-automatic handgun on police, striking the vehicle multiple times before he ran into the hospital. Officers gave chase.

Once inside the medical center, he kept firing at officers and at one point turned and fired at Dayna Less, a first-year resident in the hospital's pharmacy, when the doors of the elevator she was on opened.

Officer Samuel Jimenez was struck in the neck, just above the bulletproof vest he was wearing, and soon died. Jimenez had been delivering his station's mail to the post office when he turned and followed other squad cars racing to the hospital.

There were indications that Lopez wanted to shoot even more people, including an account from one witness, Jennifer Eldridge, who was hiding in the pharmacy, when she heard the gunfire and the sound of the gunman jiggling the handle of the locked door, an apparent effort to get in.

During the exchange of gunfire, Lopez was shot once in the abdomen. It was then that Lopez, who fired a total of more than 30 shots and had reloaded his weapon, put the gun to his head and killed himself, police spokesman Anthony Guglielmi said Tuesday.

Investigators said they found nothing to indicate that Lopez had a criminal record. At the time of his death, he was an employee with the Chicago Housing Authority, and officials there said there had been no reports of any problems in his nine months on the job.

But there were other signs of trouble in recent years.

In 2014, Lopez was kicked out of the city's firefighting academy after threatening a female cadet. When the fire department learned of the threats, Lopez was told he would be disciplined. But instead of returning to the academy to meet with department officials, Lopez went AWOL and was fired, fire department spokesman Larry Merritt said Tuesday.

Records from that same year indicate that a girlfriend of Lopez sought an order of protection against him because he was incessantly texting her. When she reported the texts to police, officers told her to change her phone number and seek an order of protection. Records show that she sought the order but not whether she ultimately received one, Guglielmi said.

Juan Lopez CBS Chicago

CBS Chicago reports the requested protection order claimed Lopez "slept with a pistol under his pillow" and that she feared her safety was in jeopardy.

Lopez had a permit to possess a concealed firearm, and it was unclear if officials knew about the 2014 complaint when the permit was granted, said Guglielmi, who said Lopez had legally purchased four guns in the last five years. It was also unclear whether an order of protection, if granted, would have forbidden Lopez from owning weapons.

When it was over, the Chicago Police Department was grieving just days before Thanksgiving for the second officer in less than a year to be killed in the line of duty. Cmdr. Paul Bauer was fatally shot in February while pursuing a suspect in the Loop business district.

Police Superintendent Eddie Johnson wanted the city to know just how heroic Jimenez and the other officers who chased Lopez were.

"They saved a lot of lives because we just don't know how much damage he was prepared to do," Johnson said late Monday.

Mayor Rahm Emanuel, speaking at the same news conference at the hospital, reminded the city of what had been lost.

The three victims were "all going about their day, all doing what they loved," he said. "This just tears at the soul of our city. It is the face and a consequence of evil."