Weight loss surgery (aka bariatric surgery) can work wonders if you are severely overweight and can’t lose enough through diet and exercise. It can even help reverse Type 2 diabetes.

But here’s a dark side: If you have this surgery, you’re prone to vitamin and mineral deficiencies and the health problems they can cause, which range from anemia to age-old scourges such as scurvy, beri-beri, rickets, kwashiorkor and pellagra.

After surgery, patients eat much less than before, and their digestive tract no longer absorbs as many nutrients, according to the American Society for Metabolic and Bariatric Surgery (ASMBS). A third of all people who have Roux-en-Y gastric bypass, for example, develop vitamin B-12 deficiency because food bypasses the lower stomach, where the vitamin is normally absorbed.

Many patients also develop an intolerance to certain foods, such as red meat (a good source of B-12) and fiber-rich vegetables.

Related: Cosmetic Surgery: How Safe Are the Tweaks You’re Considering?

Get regular nutritional testing — forever

To avoid malnutrition after weight-loss surgery, experts say you need to eat nutrient-rich foods and take special vitamin and mineral supplements — not just multivitamins — for the rest of your life. Your surgeon or follow-up specialist can tailor your supplements to the particular weight-loss surgery you received.

You also need to get tested regularly for nutrient shortfalls, which may require further treatment. Joint clinical guidelines on supplementation from the ASMBS and two other groups say you should be tested for nutritional deficiencies before the surgery, every three to six months during the first year after the surgery (depending on which kind you have) and at least once a year after that. But a study of more than 21,000 patients who had bariatric surgery found that fewer than 3 percent were tested for all micronutrients prior to their surgery, and many were not tested for deficiencies in key nutrients during the first year after surgery.

Kimberly Gudzune, MD, MPH, an assistant professor at the Johns Hopkins University School of Medicine and the study’s lead author, told SafeBee that as doctors become more familiar with the procedures, “I am hopeful that rates of testing may be improving…Regular nutritional deficiency testing is vital.”

Related: How to Get Help for Out of Control Eating

Preventing malnutrition after surgery

The bottom line: Get regular testing for nutrient deficiencies before and after surgery and be alert for changes in the way you feel. If you notice any symptoms of illnesses caused by deficiencies, see your doctor right away — some nutritional deficiencies can cause permanent damage and can even be life-threatening.

According to the ASMBS and bariatric surgery researchers, you’re at risk for the following nutrition-related problems after weight-loss surgery.

Iron deficiency anemia. Iron deficiency can lead to anemia, a condition in which the blood contains too few red blood cells. Symptoms: fatigue, shortness of breath, leg cramps, difficulty concentrating and dizziness.

Beriberi. This is caused by a deficiency in thiamin (vitamin B-1). Patients are most at risk during the first six months after surgery. Symptoms: Most people have no symptoms, although you may experience fatigue and muscle cramps.

Kwashiorkor. Many patients have trouble getting the recommended amount of protein after surgery. A severe deficiency can result in kwashiorkor, a disease linked to starvation that’s common in developing countries but extremely rare in the United States. Symptoms: hair loss, muscle wasting, irritability, anemia. In severe cases, potbelly, foot and ankle swelling, electrolyte imbalances.

Osteoporosis. Bariatric surgery can lead to shortfalls in vitamin D and calcium, possibly resulting in softening bones (rickets) or osteoporosis . Symptoms: backache, fractures (a symptom of osteoporosis), bone pain (a symptom of rickets).

B-12 deficiency problems. In severe cases, a vitamin B-12 deficiency can cause nerve-related problems, difficulty walking and problems with thinking and reasoning. Symptoms: numbness, yellowed skin (jaundice), staggering, swollen tongue, hallucinations and paranoia.

Related: Are Low Vitamin B-12 Levels Wreaking Havoc with Your Health?

Folate deficiency problems. Deficiencies of folate (vitamin B-9) can lead to anemia, psychiatric problems and other ills. Pregnant women need extra folate to protect against birth defects. Symptoms: fatigue, headache, palpitations, diarrhea, sore tongue, difficulty concentrating, pale skin, depression.

Zinc and copper deficiency problems. A zinc deficiency may result in poor wound healing, while a severe copper deficiency can lead to difficulty walking and (in rare cases) paralysis. Symptoms: In zinc deficiency, dermatitis (skin inflammation), a lack of taste, hair loss, and reduced immunity. In copper deficiency, numbness and tingling in hands and feet.

Fat-soluble vitamin deficiency problems. After a gastric bypass, your body may not absorb enough fat-soluble vitamins D, A, K and E. Left untreated, a vitamin E deficiency, for example, can cause irreversible damage to your nervous system. Symptoms: loss of appetite, night blindness, loss of smell, enlarged prostate gland, abdominal problems, hair loss, muscle wasting, leg cramps, slow tissue healing, brittle bones, poor blood clotting, high blood sugar.

Related: Overweight? Vitamin D Supplements Could Help

Mary Purcell is a freelance writer and health researcher in Piedmont, Calif., with expertise in policy analysis. She has a master's degree in Latin American studies from Georgetown University.