It was just before 10 one August morning in 2016 when Keller resident Brian Steinborn discovered his 4-year-old daughter Olivia in bed, her body cold, skin blue and vomit on her face.

He and his wife, Juli Treadwell, had managed only a few hours of sleep the night before.

At about 2 in the morning, the couple had taken their feverish child to be examined by a doctor at the nearest emergency room — a freestanding facility run by Excel ER, less than 1 mile away from their home. At that time, Olivia was alert and her fever had fallen from its 101-degree peak.

But her heart continued to beat rapidly and her breathing remained abnormal, so clinicians checked her vital signs and ordered labs. She was given fluids and discharged home with a prescription for an antibiotic to treat an ear infection.

But nearly five hours after returning home, they were headed back. Olivia’s condition had worsened. By the time she reached the facility for the second time, she was in full cardiopulmonary arrest.

And it was too late to save her life, claims a medical malpractice lawsuit filed Wednesday in Dallas County court that accuses the company and the doctor on duty that night of negligence.

The lawsuit claims the facility, among other things, failed to properly evaluate Olivia’s condition and improperly discharged her instead of immediately transferring her to a hospital.

An autopsy report from the Tarrant County medical examiner, done on Aug. 8, the day after the incident, found Olivia's primary cause of death was bacterial meningitis, a brain infection that can turn deadly in a matter of hours.

The emergency doctor failed to detect the serious condition, the lawsuit says.

Olivia Steinborn, 4, died Aug. 7, 2016, after being taken to Excel ER in Keller. Her parents are suing, arguing that her bacterial meningitis was misdiagnosed.

Diagnosis errors are a national problem considered a significant but under-recognized threat to patient safety. Clinicians struggle with the issue industrywide. In a recent survey, more than half of the respondents who had experienced a medical mistake said the provider said nothing was wrong, when there really was an issue that needed to be addressed.

But the attorneys on this case say the incident goes beyond a typical medical mistake. They say it raises questions about staffing, oversight and experience at Excel ER's freestanding facilities.

The lawsuit accuses the facility of failing to staff “appropriately qualified and experienced physicians” and says the chain of command did not do its role in elevating Olivia’s case when her physician did not.

The doctor who treated Olivia was a medical resident, still in training to become a board-certified emergency medicine specialist, and therefore should have been under supervision of an attending physician, the lawsuit says. Olivia’s parents were never notified of the doctor’s trainee status.

To Dallas-based medical malpractice attorney Les Weisbrod, who is representing the family, the situation constitutes gross negligence that boils down to bad economics.

“The ER was too cheap, and looking too much in the way of profits, to pay for a real physician who had finished training,” he said.

The family is seeking over $1 million in damages.

Excel ER and its attorney, Bryan Haynes of Dallas law firm Scheef and Stone, did not respond to requests for comment.

Two experts who reviewed Olivia’s health record and autopsy report at the request of the family's lawyers say the standard of care was not met and the diagnosis was missed.

Olivia’s symptoms upon entering the emergency room would have been “obvious (and frightening) to an emergency physician practicing the standard of care,” wrote Dr. Kenneth Corre, an emergency physician at Cedars-Sinai in Los Angeles, in statement that was filed with the lawsuit.

The experts noted symptoms that should have been clear red flags. They include fever, vomiting and diarrhea within the past 24 hours, and her persistent rapid heart rate and abnormal breathing.

The preschooler was also deaf, prone to ear infections and wore a cochlear implant in her right ear, which put her at increased risk for meningitis, a condition they say should have immediately been ruled out. “Inexplicably, none of this happened,” Corre wrote.

Her blood work also showed a “grossly abnormal white count and platelet count which were indicative of an overwhelming bacterial infection,” wrote Dr. Armando Correa, a pediatric infectious disease specialist at Baylor College of Medicine in Houston whose statements were also included with the lawsuit.

The clinical care the child received “proximately caused her cardiorespiratory arrest and subsequent demise,” he wrote.

Less clear is whether the staffing of a resident was key to the problem.

“Residents moonlight all the time, and many times it's without supervision,” said Dr. Cedric Dark, assistant professor of emergency medicine at Baylor College of Medicine. He did not review Olivia’s records and could not comment on her case.

However, he says the issue may be more indicative of the challenges facing emergency medicine, and not exclusively with freestanding emergency facilities.

A freestanding emergency room is a state-licensed facility that is not physically connected to a hospital and provides emergency care around the clock. Some of them are satellite emergency centers affiliated with a larger hospital network.

Others, like Excel ER, are completely independent from a hospital network.

Related: In dentistry's netherworld, pros take risks with drugs, and the government largely tolerates it

All freestanding facilities should be able to stabilize a patient in an emergency situation, and each is required to establish transfer agreements to send appropriate patients for a higher level of care. But there is no requirement that says an emergency medicine specialist must be be on staff.

“The problem is there is an ER doctor shortage in Texas. We don’t have enough emergency-trained specialists to staff every single shift 24 hours a day, 365 days a year,” Dark said.

Any type of physician who has finished at least one year of residency can apply for an independent license to practice and legally work in a Texas emergency room without having to be an emergency medicine specialist.

"The issue is that it's deceptive," said Weisbrod, who also represented the family of Dallas Ebola victim Thomas Eric Duncan. Consumers may expect to be treated by a resident at a teaching hospital, but they also expect those trainees to be supervised by an attending physician.

“I don’t know anyone that would suspect that if they went to an emergency room that is not a teaching hospital that they would get a resident in training. It’s not a best practice.”

The speciality of emergency medicine is relatively new, dating back about 50 years to the late 1960s, according to the Emergency Medicine Residents' Association.

In 2014, the American College of Emergency Physicians recommended that every emergency department be staffed by "appropriately qualified emergency physicians," but that recommendation has not been widely adopted, experts said.

“That, potentially, is an area where the legislatures can look to improve upon,” Dark said.

Texas' rules for freestanding facilities require that there be "adequate medical and nursing personnel qualified in emergency care." That includes at least one physician, someone qualified to initiate lifesaving measures, and at at least one nurse with advanced cardiac life support and pediatric advanced life support certification.

Excel ER operates six facilities in Texas. The one where Olivia was treated — on Heritage Trace in Keller — is no longer open. It is unclear whether Dr. Brandon Morshedi, who was in his third year of residency at UT Southwestern the night he treated Olivia, still works with the group.

Morshedi completed his residency program on June 30, the medical center confirmed.

Excel ER's website touts that its facilities have "the experience and skill needed to lead you to a comfortable outlook." And that if its physicians determine a patient needs a higher level of care, "we can immediately arrange a transfer."

Excel ER declined to comment on why that did not happen for Olivia, who was sent home with diagnoses that included dehydration, an ear infection and a nonspecific viral syndrome.