– On a foggy afternoon, Diana Van Ry, a retired judicial assistant, dropped by the kitchens of a nonprofit group to pick up rock cod, cauliflower couscous and an “immune broth” enriched with vegetables and seaweed. She planned to deliver the meals to Brandi Dornan, 46, who is recuperating from breast cancer.

“It’s food I wouldn’t have thought to make myself,” Dornan said. “Wow, bless their hearts.”

The Ceres Community Project — its meals prepared for cancer patients by teenage sous-chefs — is at the forefront of the “food as medicine” approach increasingly embraced by physicians, health insurers, researchers and public health officials. The group is participating in an ambitious, state-funded study to test whether providing daily nutritious meals to chronically ill, low-income people on Medi-Cal — California’s version of Medicaid — will affect their prognosis and treatment, or the cost of their medical care.

Over the next three years, researchers from the University of California, San Francisco, and Stanford University will assess whether providing 1,000 patients who have congestive heart failure or Type 2 diabetes with a healthier diet and nutrition education affects hospital readmissions and referrals to long-term care, compared with 4,000 similar Medi-Cal patients who do not get the food.

The interest in food as medicine is largely an outgrowth of the nutritional know-how acquired during the AIDS epidemic of the 1980s. Organizations like Project Open Hand in San Francisco and God’s Love We Deliver in New York City sprang up to bolster the health of people whose lives were being decimated, often by the weight loss called wasting syndrome.

As the disease became treatable, many groups expanded their missions to help people with chronic conditions. “When you feel terrible, managing your diet falls to the bottom of your list,” said Karen Pearl, president and chief executive of God’s Love We Deliver.

The new study will build on more modest earlier research. A small study by researchers at UCSF tracked patients with HIV and Type 2 diabetes who got special meals for six months and found they were less likely to make trade-offs between food and health care, and more likely to stick with medications. And the price of feeding each participant was $1,184 per person, less than half the $2,774 cost per day at a hospital, the study said.

Poor people can have an especially hard time controlling chronic diseases; they often eat cheap food laden with sugar and salt, avoiding costly fruits and vegetables. “Sometimes there is a short-term sacrificing of food to pay the rent or they go without medications because they can’t afford the copay,” said Dr. Sanjay Basu, an assistant professor of medicine at Stanford. “That’s when they unintentionally end up in the ER.”

For cancer patients, a loss of appetite from treatment side effects can lead to malnutrition, which lessens the body’s ability to fight disease.

Dr. Hilary K. Seligman, an associate professor of medicine at UCSF, noted that “the critical epidemics of our day — obesity and diabetes — are diet related.” The medical profession, she said, “accepts the most expensive procedures and medications without batting an eyelash. But with food, we have to prove it’s inexpensive to be accepted.”