A Fort Worth, Texas, judge upheld a restraining order, keeping a 10-month-old girl suffering from a heart defect and lung problems on life support Friday.

Judge Sandee Bryan Marion’s Thursday decision comes after months of legal battles between Cook Children’s Medical Center and Tinslee Lewis’ family regarding whether the medical center could remove her from life support.

“We’re here to determine whether [cutting off life support] is unconstitutional,” Marion said during the court hearing on Thursday.

The Texas Health & Safety Code 166.046, also known as the Texas Advance Directives Act, allows doctors to remove patients from life support after they determine the patient’s condition won’t improve -- even if the family disagrees.

Tinslee was born prematurely in March with a heart defect called the Ebstein anomaly, a defect where the blood valve between the heart’s two right chambers doesn’t pump blood properly. It could result in blood leaking from the valve, leading to heart enlargement or failure.

Tinslee also suffers from chronic lung disease and severe chronic pulmonary hypertension. The conditions have required multiple complex surgeries.

Cook Children’s staff argue Tinslee is in near constant pain and requires a ventilator to breathe. The hospital said nothing more can be done for her, and doctors at 19 other hospitals Cook officials contacted agreed with their diagnosis and declined to care for the girl.

“She is in pain,” Dr. Jay Duncan said in testimony Thursday. “Changing a diaper causes pain. Suctioning her breathing tube causes pain. Being on the ventilator causes pain.”

Tinslee’s family has pushed back, saying the infant is conscious despite her sedation and responds to stimulation like any 10-month-old would. They also said she simply needs more time to get better and Boston Children’s Hospital has been reconsidering its decision against carring for Tinslee.

“I want to be able to make the decision for her,” Tinslee’s mother, Trinity Lewis, 20, said during the hearing. Lewis is currently expecting her second child, which is due in February.

“I wish they would keep that hopelessness out of their vocabulary,” said Linda Williams, Trinity’s grandmother. “There is hope for her. I don’t believe there is such thing as hopelessness.”