An earlier proposal would have allowed marijuana dispensaries to conduct their own testing, but state officials said that to ensure the integrity of the tests, they opted to make Massachusetts the first to require outside screening. Connecticut is considering a similar requirement.

The provision is among dozens of changes made by the Department of Public Health to draft rules the agency released in March, ­after staff members reviewed hundreds of suggestions from advocates on all sides of the contentious issue.

The revisions will make it easier for families to get marijuana for sick children. They will also require marijuana dispensaries to carry liability insurance in case consumers are harmed, another provision unique to Massachusetts, state officials said.

Dr. Lauren Smith, the state’s interim public health commissioner, said that while the new rules take effect May 24,
it will take months for her department to review and ­license companies to sell marijuana, set licensing fees, and build an online system to register and track patients and dispensaries.

“This won’t happen overnight,” Smith said after the vote by the Public Health Council, an appointed body of academics and health advocates.

‘’

“I think the public wants to know we did the background steps,” she added. “I don’t think they want a fly-by-night operation.”

The Globe reported last month that few credible labs will test marijuana products for contaminants for fear of losing federal government contracts, because medical marijuana is not sanctioned by federal law, say researchers who study the medical marijuana industry.

The updated rules aim to address this concern by requiring staff at these independent labs to register with the state, thus giving them some measure of legal protection from possible federal prosecution. The rules also establish a framework of standards and independent accreditation for labs testing marijuana.

The Coalition for Responsible Patient Care, a trade association of the medical marijuana industry, applauded the independent lab testing requirement.

“If you are selling this as medicine, you need to test it to prove that it is what the dispensaries say it is and that it’s safe to consume,” said treasurer Dorian Des Lauriers.

A number of council members said they were uncomfortable with the official term for the dispensaries — medical marijuana treatment centers — because the facilities will be dispensing products and not offering medical treatment. They voted to change the official name to registered marijuana dispensaries.

Another key change is that dispensaries will be allowed to use organic pesticides on their products. Previously, all pesticides would have been prohibited, but that prompted an outcry from growers, who said it is almost impossible to run a large-scale agricultural operation without using some sort of pesticides.

Access to marijuana for children has been a testy issue, and the new rules propose a couple of significant changes.

Patients under age 18 with a debilitating medical condition would not have to also have a life-limiting illness to be eligible for medical marijuana, as ­required in the earlier version.

Now, written notice from two physicians will allow such patients to override that provision and use marijuana.

Also, the definition for a life-limiting illness has been changed, from one in which a young patient has just six months to live, to one in which a patient may be expected to live as long as two years.

The change, the Public Health Department said, was to align the rules with the definition used in palliative care, which treats patients who have life-threatening, though not necessarily terminal, illnesses.

Physicians at Boston Children’s Hospital and other child advocates had urged regulators to prohibit marijuana use for young patients, saying that there is scant evidence that it is safe or effective and that it may prove especially toxic to still-developing brains.

Other patient advocates ­argued that young patients suffering with debilitating illnesses such as cancer should not be denied relief of their symptoms, including pain.

The final rules retain a provision that would require marijuana dispensaries to use child-proof packaging on all products, especially marijuana-infused brownies, cookies, and candies, which are often used by patients who are unable or choose not to smoke.

Dr. Sharon Levy, a pediatrician at Boston Children’s Hospital, had urged the state to ­ensure child-proof packaging because, she said, such sweets would be particularly appealing to children.

“If you are 3 years old, you may not be able to read the warning label,” Levy said in an interview.

In Colorado, which legalized medical marijuana several years ago, there has been a spike in the number of calls to poison control centers about children inadvertently eating marijuana-laced products, said Dr. George Wang, senior toxicology fellow at the Rocky Mountain Poison and Drug Center.

“A lot of people think [medical marijuana] is benign, but we are seeing kids come to the hospital,” Wang said.

Most of these young ­patients were treated in the emergency room for extreme sedation, but a few had to be admitted for close observation, he said. None died.

Most businesses carry insur­ance to cover any harm to customers from their products, but some regulators worried that few insurers would be willing to offer coverage to marijuana dispensaries because the drug is not federally sanctioned.

But the state Public Health Department said staff members contacted insurers in ­other states that have approved medical marijuana sales and determined that access to coverage should not be a barrier. So the department’s new rules will require dispensaries to ­obtain general and product liability coverage.

Massachusetts would be the first state to have such an ­explicit requirement, state officials said.