People seeking reproductive and gender-related health care in Massachusetts – and the medical professionals who provide that care – are a step closer to gaining another layer of protections under state law.

The Massachusetts House voted 136-23 Wednesday on a bill aimed at shielding patient and provider data from out-of-state actors.

The House vote follows the June 26 passage of a similar bill in the state Senate. Lawmakers have pitched it as a response to shifting federal policies around abortion and transgender care, and other states’ restrictions on those services.

The new bill builds on a 2022 law that shields patients and providers from out-of-state investigations into health care that’s legally provided here.

“We put up the first Shield Act, and now we’ve found that they’ve got different tributaries they’re trying to carve out to get at the data and get at our residents,” Rep. Mike Day, the House chair of the Judiciary Committee, told reporters. “We’re not going to allow it, so whatever they throw up, we’ll be ready to stand up against.”

Both the House and Senate bills propose new privacy safeguards for patient and provider data connected to reproductive and gender-affirming care, including limits on sharing electronic medical records.

They would both bar state agencies from assisting with investigations launched by the federal government or other states into care provided legally here, and they would protect providers from facing professional discipline for offering those services.

After the Trump administration revoked federal guidance requiring hospitals to provide emergency abortions if necessary to save a patient’s life, the legislation would enshrine that requirement in state law.

“This bill is fundamentally about protecting our state from those outside who wish to decide how we in Massachusetts choose to deliver health care and the values we decide should drive that care,” Sen. Cindy Friedman, an Arlington Democrat, said when the Senate passed its bill. “And whether you agree with the specific services referred to in this bill, nobody outside Massachusetts should be able to decide what care we provide, regardless of the specific services being targeted.”

The House and Senate will next need to iron out any differences between their two bills so they can send a finalized version to Gov. Maura Healey.