BOSTON — Massachusetts lawmakers are weighing a final, compromise version of a bill overhauling the oversight of compounding pharmacies.

The bill stemmed from a nationwide meningitis outbreak that authorities blamed on a tainted steroid produced by the now-closed New England Compounding Center in Framingham. The outbreak resulted in 64 deaths and hundreds of illnesses.

The bill reorganizes the board that oversees the pharmacies and requires it to participate in any national reporting systems on pharmacies, pharmacists and technicians. It also requires board inspectors be trained in sterile compounding and non-sterile compounding practices. Compounding pharmacies typically custom-mix medications.

The legislation authorizes the board to levy fines against a pharmacy of up to $25,000 per violation, and up to $1,000 for each day that a violation continues after the date it should have been corrected.

Under the legislation, the state would create four new specialty licenses: a retail sterile compounding specialty license; a retail complex non-sterile compounding specialty license; an institutional pharmacy specialty license, which applies to hospitals; and an out-of-state pharmacy licenses for out-of-state pharmacies doing business in Massachusetts.

The bill also requires compounding pharmacies to notify patients whether a drug is a sterile or non-sterile compounded drug.

Rep. Jeffrey Sanchez, a Boston Democrat who co-chairs the Legislature's public health committee, said lawmakers and regulators owe it to the public to ensure that compounded drugs are safe.

"If not compounded properly, these drugs can prove dangerous and as we've seen and experienced with the New England Compounding Center, even fatal," Sanchez said Monday, adding that the bill "holds pharmacies to the industry's highest standards."

The bill also lets the board suspend the licenses of pharmacies or pharmacists if regulators have "reasonable concern for the health, safety or welfare of the public."

Gov. Deval Patrick, who must sign the bill before it becomes law, said Monday that he was pleased with the final version of the legislation, saying it improved on the original.

Last year, Congress passed and President Barack Obama signed into law legislation designed to sort out the legal gray area that allowed the New England Compounding Center and similar operations to skirt both state and federal regulations.

Under the new federal law, large-volume compounding pharmacies can register with the Food and Drug Administration and submit to federal inspections and quality standards much like drug manufacturers. Smaller businesses that choose to remain traditional pharmacies — generally filling a small number of prescriptions each week — will continue to be regulated by state boards of pharmacy.

The new system allows the FDA to track what the registered pharmacies are making, receive reports about problems with any of the compounded drugs and conduct safety inspections.