SPRINGFIELD, Mass. — Hospitals around the country should become new markets for farmers to provide healthy, often locally-produced food to comply with their legal requirements under the Affordable Care Act, a prominent health care consultant told the National Farmers Union at its annual convention here this week.

“Hospitals have to demonstrate to the Internal Revenue Service that they are investing dollars into the community that justifies their nonprofit status. This is a time to become engaged as a community advocate for food and what impact it has on the community,” said Marydale DeBor, a former Connecticut hospital executive who now runs a New Haven consulting business called Fresh Advantage.

“I am looking for opportunities for you to be the doctors to the world,” DeBor said.

The idea seemed to be of the most interest to farmers producing fruits, vegetables and meat for local consumption in high-population areas, but DeBor said that all farmers should be interested because the point is to make hospital food and the food that people eat after they leave the hospital “healthier.”

As popular as local and organic food has become, New England and other populous areas will never be able to produce food all the people living in big cities and their suburbs, she said.

The IRS requirement that hospitals prove they are benefitting communities to qualify for a tax-exempt status is not new, but the regulations have been made more rigorous under the Affordable Care Act, popularly known as “Obamacare.” At the same time, communities and doctors are becoming more concerned about the quality of food people eat and the impact that it has on their health and health care costs, DeBor said.

In the past, hospitals have gotten credit for providing care to people who can’t pay, but with almost everyone required to have insurance under Obamacare, hospitals will be looking for new ways to prove that they are providing community services, DeBor said.

While she was a senior executive at New Milford Hospital in Connecticut, DeBor said, she set up a multifaceted public health initiative to address increasing rates of obesity and Type II diabetes and other chronic disease in the hospital’s customer service area.

Patients were served higher qualify food in the hospital and were encouraged to buy locally produced, healthy food after they were discharged. The activities to encourage better eating in the community included working with a farmer’s market, creating an employee community-supported agriculture organization and a healthy foods prescription program under which doctors gave patients “prescriptions” rather than medicines to improve their health.

The hospital also put on senior suppers and the hospital cafeteria’s healthy chicken salad became so popular even the mayor ate there, she said.

DeBor said she started by challenging the hospital’s food vendor to provide locally produced, healthier food, and when the vendor could not, the hospital switched vendors.

The famed Cleveland Clinic has built a 3.5-acre hydroponic garden under its community mandate, and Kaiser Permanente, the health care organization, is involved in many healthy eating activities.

DeBor, who is now on the board of the New England Farmers Union and was a delegate to the convention, urged the farmers to develop “direct relationships” with the officials in charge of community benefits at their local hospitals.

“Farmers really need to be advocates in a time of opportunity,” DeBor said. “Talk about hospitals and what they are doing right now. It is a time of new ideas.”

While many of the farmers who showed an interest in DeBor’s ideas were from New England, another was Nebraska Farmers Union President John Hansen.

Nebraska produces the finest beef in the world, Hansen said, but many restaurants and institutions in the state buy steaks and other meats from “five or six states away.” Farmers, Hansen said, should encourage local institutions to serve locally-produced meat.