{
  "engine": {
    "id": "cpe-009",
    "code": "CPE-009",
    "name": "Vitamin B12 and Folate Pattern Engine",
    "version": "1.0.0",
    "url": "https://biod.ai/tools/b12",
    "status": "Executable specification v1.0.0, authored by Biod from the narrative CPE-009 specification and current guidelines. Reviewed by Dr. Vinicius Amaral, D.O. Not for clinical production use."
  },
  "notice": "Clinical decision support for licensed clinicians. Synthetic-data demonstration. Not FDA cleared. Physician adjudication required.",
  "rules": [
    {
      "id": "B12-SCOPE-01",
      "name": "Patients under 18 routed out",
      "group": "Scope and validity",
      "status": "active",
      "classification": "Priority 1",
      "summary": "Patients under 18 routed out. Evaluates age_years below 18.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "age_years < 18"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Routing: pediatric hematology and nutrition pathway"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Adult thresholds do not apply."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-scope-01"
    },
    {
      "id": "B12-01",
      "name": "Low serum B12",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Low serum B12. Evaluates serum vitamin B12 below 200 pg/mL (148 pmol/L).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "serum vitamin B12 < 200 pg/mL (148 pmol/L)"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Biochemical pattern compatible with vitamin B12 deficiency"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Look for the cause: pernicious anemia, diet, drugs (metformin, acid suppression, nitrous oxide), malabsorption",
            "Confirm with methylmalonic acid when the picture is unclear"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "A pattern for physician review; it does not choose a treatment."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-STABLER-2013"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-01"
    },
    {
      "id": "B12-02",
      "name": "Borderline B12 with raised MMA or homocysteine",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Borderline B12 with raised MMA or homocysteine. Evaluates serum vitamin B12 200 to 300 pg/mL.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "serum vitamin B12 200 to 300 pg/mL",
            "methylmalonic acid > 0.27 µmol/L OR homocysteine > 15 µmol/L"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Functional vitamin B12 deficiency pattern: tissue deficiency despite a serum value that looks acceptable"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Renal impairment raises MMA and homocysteine; interpret with eGFR."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-GREEN-2017"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-02"
    },
    {
      "id": "B12-03",
      "name": "Borderline B12, confirmatory test not done",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 4",
      "summary": "Borderline B12, confirmatory test not done. Evaluates serum vitamin B12 200 to 300 pg/mL.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "serum vitamin B12 200 to 300 pg/mL",
            "MMA and homocysteine not entered"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Borderline: a serum B12 in this range does not settle the question"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Consider methylmalonic acid (with homocysteine) when deficiency is suspected"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "A prompt."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-GREEN-2017"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-03"
    },
    {
      "id": "B12-04",
      "name": "Folic acid before B12 status is known",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 2",
      "summary": "Folic acid before B12 status is known. Evaluates macrocytosis or anemia.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "macrocytosis or anemia",
            "folic acid ordered or planned",
            "vitamin B12 not measured"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Safety: correcting a megaloblastic anemia with folic acid alone can mask vitamin B12 deficiency while neurologic damage progresses"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Measure vitamin B12 before or together with any folic acid treatment"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "A safety prompt, not a treatment instruction."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-STABLER-2013"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-04"
    },
    {
      "id": "B12-05",
      "name": "Neurologic or psychiatric features with unmeasured or low B12",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 2",
      "summary": "Neurologic or psychiatric features with unmeasured or low B12. Evaluates peripheral neuropathy, balance problems, cognitive change or psychiatric symptoms.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "peripheral neuropathy, balance problems, cognitive change or psychiatric symptoms",
            "vitamin B12 not measured, OR below 300 pg/mL, OR nitrous oxide exposure (a normal serum level does not exclude functional deficiency)"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Neurologic involvement raises the urgency of finding vitamin B12 deficiency, and can occur without anemia"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Measure B12 (with MMA) promptly",
            "BSH advises that neurologic involvement is a reason not to delay treatment while awaiting results"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Neuropathy has many causes; this rule asks that B12 not be overlooked."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-STABLER-2013"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-05"
    },
    {
      "id": "B12-06",
      "name": "Pattern of subacute combined degeneration",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 1",
      "summary": "Pattern of subacute combined degeneration. Evaluates posterior-column signs (loss of vibration or proprioception, positive Romberg) or gait ataxia.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "posterior-column signs (loss of vibration or proprioception, positive Romberg) or gait ataxia",
            "with spasticity or Babinski sign, or with ascending sensory symptoms"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Urgent: neurologic pattern compatible with vitamin B12-related subacute combined degeneration"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Time-sensitive: irreversible damage can follow delay. The engine names no treatment."
          ]
        }
      ],
      "evidence": [
        "EV-STABLER-2013",
        "EV-BSH-2014"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-06"
    },
    {
      "id": "B12-07",
      "name": "Macrocytosis work-up",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 4",
      "summary": "Macrocytosis work-up. Evaluates MCV above 100 fL.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "MCV > 100 fL"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Macrocytosis has B12 and folate causes and many others: alcohol, liver disease, hypothyroidism, reticulocytosis, myelodysplasia and drugs"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Check B12 and folate, a reticulocyte count and a blood film",
            "Review alcohol, liver and thyroid status and drugs (hydroxyurea, methotrexate, zidovudine, azathioprine)"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Macrocytosis is absent in many patients with B12 deficiency, especially when iron deficiency coexists."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-07"
    },
    {
      "id": "B12-08",
      "name": "Pernicious anemia evaluation",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 4",
      "summary": "Pernicious anemia evaluation. Evaluates low or borderline B12.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "low or borderline B12",
            "age 60 and over, OR autoimmune disease (type 1 diabetes, autoimmune thyroid disease, vitiligo, Addison disease), OR glossitis"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Autoimmune gastritis (pernicious anemia) is a leading cause: intrinsic-factor antibodies are specific when positive"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Consider intrinsic-factor antibodies",
            "If positive, pernicious anemia is supported and its gastric implications should be considered by the physician"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Negative antibodies do not exclude pernicious anemia."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-GREEN-2017"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-08"
    },
    {
      "id": "B12-09",
      "name": "Blood film clue: hypersegmented neutrophils",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 5",
      "summary": "Blood film clue: hypersegmented neutrophils. Evaluates hypersegmented neutrophils reported.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "hypersegmented neutrophils reported"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "A supportive finding for a megaloblastic state"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Supportive only."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-09"
    },
    {
      "id": "B12-10",
      "name": "Drug exposure that lowers B12",
      "group": "Context triggers",
      "status": "active",
      "classification": "Priority 4",
      "summary": "Drug exposure that lowers B12. Evaluates metformin for 12 months or more, OR proton-pump inhibitor/H2 blocker for 24 months or more, OR nitrous oxide exposure.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "metformin for 12 months or more, OR proton-pump inhibitor/H2 blocker for 24 months or more, OR nitrous oxide exposure"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Drug-associated risk of B12 deficiency",
            "Nitrous oxide inactivates B12 and can cause neurologic injury with a normal serum level"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "The ADA standards say periodic B12 measurement should be considered in people on metformin, especially with anemia or neuropathy"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Exposure raises likelihood; it is not a finding."
          ]
        }
      ],
      "evidence": [
        "EV-ADA-STANDARDS",
        "EV-BSH-2014",
        "EV-STABLER-2013"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-10"
    },
    {
      "id": "B12-11",
      "name": "Higher-risk group without B12 on file",
      "group": "Context triggers",
      "status": "active",
      "classification": "Priority 6",
      "summary": "Higher-risk group without B12 on file. Evaluates age 60 and over, vegan or vegetarian diet, bariatric surgery, ileal resection or Crohn disease, celiac disease, atrophic gastritis, heavy alcohol use or HIV.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "age 60 and over, vegan or vegetarian diet, bariatric surgery, ileal resection or Crohn disease, celiac disease, atrophic gastritis, heavy alcohol use or HIV",
            "vitamin B12 not measured"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Screening opportunity: a group at higher risk of B12 deficiency has no measurement"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Groups raise the pre-test likelihood."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-GREEN-2017"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-11"
    },
    {
      "id": "B12-12",
      "name": "Raised homocysteine with adequate B12 and folate",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 5",
      "summary": "Raised homocysteine with adequate B12 and folate. Evaluates homocysteine above 15 µmol/L.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "homocysteine > 15 µmol/L",
            "vitamin B12 above 300 pg/mL",
            "folate adequate"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Consider other contributors to hyperhomocysteinemia: reduced kidney function, hypothyroidism, vitamin B6 deficiency, drugs"
          ]
        },
        {
          "heading": "Never outputs",
          "items": [
            "a recommendation for MTHFR genotyping"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "The ACMG finds no evidence supporting MTHFR polymorphism testing."
          ]
        }
      ],
      "evidence": [
        "EV-ACMG-MTHFR-2013"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-12"
    },
    {
      "id": "B12-13",
      "name": "Low folate",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Low folate. Evaluates serum folate below 4.4 ng/mL (10 nmol/L) OR red-cell folate below 135 ng/mL (305 nmol/L).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "serum folate < 4.4 ng/mL (10 nmol/L) OR red-cell folate < 135 ng/mL (305 nmol/L)"
          ]
        },
        {
          "heading": "Supportive, not required",
          "items": [
            "macrocytosis",
            "poor diet, alcohol use disorder, malabsorption",
            "folate-antagonist drugs (methotrexate, trimethoprim, phenytoin)"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Biochemical pattern compatible with folate deficiency"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Check B12 together with folate, so a coexisting deficiency is not missed"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Serum folate reflects recent intake; red-cell folate reflects stores."
          ]
        }
      ],
      "evidence": [
        "EV-WHO-FOLATE-2015",
        "EV-BSH-2014"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-13"
    },
    {
      "id": "B12-14",
      "name": "Preconception folic acid",
      "group": "Context triggers",
      "status": "active",
      "classification": "Priority 7",
      "summary": "Preconception folic acid. Evaluates woman aged 15 to 45 able to become pregnant.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "woman aged 15 to 45 able to become pregnant",
            "not taking folic acid"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "USPSTF Grade A: all persons planning or capable of pregnancy should take daily folic acid supplementation to prevent neural tube defects"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "A preventive-care prompt; the dose is the USPSTF's and the physician's."
          ]
        }
      ],
      "evidence": [
        "EV-USPSTF-FOLIC-2023"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-14"
    },
    {
      "id": "B12-15",
      "name": "Severe or hemolytic picture",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 1",
      "summary": "Severe or hemolytic picture. Evaluates pancytopenia OR hemoglobin below 7 g/dL OR schistocytes with raised LDH and low haptoglobin.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "pancytopenia OR hemoglobin < 7 g/dL OR schistocytes with raised LDH and low haptoglobin",
            "with macrocytosis, or low or borderline B12, or low folate"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Urgent hematology review: severe megaloblastic anemia can mimic thrombotic microangiopathy"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Routine outpatient pathway is not appropriate."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014",
        "EV-STABLER-2013"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-15"
    },
    {
      "id": "B12-MISS-01",
      "name": "B12 needed",
      "group": "Missing data",
      "status": "active",
      "classification": "Priority 8",
      "summary": "B12 needed. Evaluates macrocytosis, neurologic features, anemia or a higher-risk group.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "macrocytosis, neurologic features, anemia or a higher-risk group",
            "vitamin B12 not entered"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "The question cannot be answered without a vitamin B12 level"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Names what is needed."
          ]
        }
      ],
      "evidence": [
        "EV-BSH-2014"
      ],
      "url": "https://biod.ai/tools/b12/rules/b12-miss-01"
    }
  ],
  "evidence": [
    {
      "id": "EV-BSH-2014",
      "citation": "Devalia V, Hamilton MS, Molloy AM; British Committee for Standards in Haematology. Guidelines for the diagnosis and treatment of cobalamin and folate disorders. Br J Haematol. 2014;166(4):496-513.",
      "supports": [
        "Diagnostic approach with serum B12, MMA and homocysteine",
        "Neurologic involvement means treatment should not wait for confirmation",
        "Folic acid alone must not be given while B12 deficiency is unexcluded"
      ]
    },
    {
      "id": "EV-STABLER-2013",
      "citation": "Stabler SP. Vitamin B12 deficiency. N Engl J Med. 2013;368(2):149-160.",
      "supports": [
        "Clinical presentations, subacute combined degeneration, nitrous oxide and drug causes"
      ]
    },
    {
      "id": "EV-GREEN-2017",
      "citation": "Green R, Allen LH, Bjørke-Monsen AL, et al. Vitamin B12 deficiency. Nat Rev Dis Primers. 2017;3:17040.",
      "supports": [
        "Functional deficiency, markers (MMA, homocysteine) and causes including autoimmune gastritis"
      ]
    },
    {
      "id": "EV-ADA-STANDARDS",
      "citation": "American Diabetes Association Professional Practice Committee. Standards of Care in Diabetes, section on pharmacologic approaches to glycemic treatment (current edition). Diabetes Care.",
      "supports": [
        "Periodic vitamin B12 measurement should be considered in metformin-treated people, especially those with anemia or peripheral neuropathy"
      ]
    },
    {
      "id": "EV-ACMG-MTHFR-2013",
      "citation": "Hickey SE, Curry CJ, Toriello HV. ACMG Practice Guideline: lack of evidence for MTHFR polymorphism testing. Genet Med. 2013;15(2):153-156.",
      "supports": [
        "MTHFR polymorphism testing is not supported for hyperhomocysteinemia or thrombophilia work-up"
      ]
    },
    {
      "id": "EV-WHO-FOLATE-2015",
      "citation": "World Health Organization. Serum and red blood cell folate concentrations for assessing folate status in populations. Geneva: WHO; 2015.",
      "supports": [
        "Serum folate below 10 nmol/L and red-cell folate below 305 nmol/L indicate deficiency"
      ]
    },
    {
      "id": "EV-USPSTF-FOLIC-2023",
      "citation": "US Preventive Services Task Force. Folic Acid Supplementation to Prevent Neural Tube Defects: US Preventive Services Task Force Reaffirmation Recommendation Statement. JAMA. 2023;330(5):454-459.",
      "supports": [
        "Grade A recommendation for daily folic acid supplementation in persons planning or capable of pregnancy"
      ]
    }
  ]
}