After a long battle, lawmakers and medical professionals in Texas say they have finally reached an agreement on legislation that will make the practice of telemedicine, where doctors see patients via remote technology, easier.

State Senator Charles Schwertner, R-Georgetown, sat down with doctors and medical and industry leaders this week hoping to resolve the longstanding fight over rules to allow doctors to see patients electronically. Schwertner confirmed the meeting was a success and says he plans to file a compromise bill next week.

“We brought everybody to the table, and we discussed the concerns about standard care, about what establishes a patient-physician relationship and had just a frank discussion of where we need to be,” Schwertner said. “We do need this technology. We need innovation and advancement to access especially in rural parts of Texas, but we need to do it in the right way.”

Schwertner, who is also the chairman of the Senate Health and Human Services Committee and a longtime orthopedic surgeon, said expanding telemedicine in Texas would give millions of Texans living in rural areas easier access to a primary doctor.

“As an orthopedic surgeon I can tell you there are not tons of orthopedic surgeons in rural areas. And so to have access through telemedicine would be incredible for those patients,” Schwertner said. “But at the same time we want to make sure we have patient protections in place to make sure the standard care is being met and that an adequate patient-physician relationship has been established.”

Telemedicine has been booming nationally for years, but in Texas it has faced a few hurdles.

“People would have to come hundreds of miles to see a specialist, especially my type of specialty which is dealing with children with diabetes,” Dr. Stephen Ponder, a pediatric endocrinologist at Baylor Scott and White Health Mclane Children said. “And we realized through the technologies that were becoming available at the time, that we could actually see people into their homes with me being in the office, but them being in the home.”

The state adopted a rule in 2015 saying doctors can’t video-chat with their patients unless they have previously met in person. This means millions of Texans living in rural towns are forced to drive hundreds of miles in some cases to see a specialist.

Dr. Ponder has been visiting with patients electronically for 10 years, but under the state’s current rules he is not able to expand his patient reach unless that patient schedules a face-to-face visit first.

“I did not see patients new on telemedicine,” Dr. Ponder said. “They had to be people that I knew, that I had seen for a face to face visit, and that they agreed as well as I agreed that it was a good prospect to do remote health—telehealth.”

Schwertner says if his legislation passes it could help reduce health care costs of taxpayer funded programs. Money aside, Schwertner says there is also a shortage of primary care doctors in Texas.

According to a Merrit Hawkins study in 2015, of the 254 counties in Texas, 80 counties had just 5 or less physicians, and 35 counties had none.

Several virtual health bills have been introduced in the Texas legislature in previous years, but none of those bills passed.