{
  "engine": {
    "id": "cpe-008",
    "code": "CPE-008",
    "name": "Adrenal Insufficiency Pattern Engine",
    "version": "1.0.0",
    "url": "https://biod.ai/tools/adrenal",
    "status": "Executable specification v1.0.0, authored by Biod from the narrative CPE-008 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": "AI-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 endocrine pathway"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Adult cortisol bands do not apply."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-scope-01"
    },
    {
      "id": "AI-VAL-01",
      "name": "Cortisol result may be unreliable",
      "group": "Scope and validity",
      "status": "active",
      "classification": "Priority 2",
      "summary": "Cortisol result may be unreliable. Evaluates sample drawn after 10 am OR estrogen/oral contraceptive/pregnancy (raises binding globulin) OR nephrotic syndrome, cirrhosis or critical illness (lowers binding globulin) OR exogenous glucocorticoid taken in the last 24 hours (prednisolone and hydrocortisone cross-react).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "sample drawn after 10 am OR estrogen/oral contraceptive/pregnancy (raises binding globulin) OR nephrotic syndrome, cirrhosis or critical illness (lowers binding globulin) OR exogenous glucocorticoid taken in the last 24 hours (prednisolone and hydrocortisone cross-react)"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Total cortisol may mislead: the interpretation is provisional"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Repeat an 8 am cortisol with ACTH after the confounder is addressed, or use an ACTH-stimulation test"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Does not discard the value."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016",
        "EV-ES-GCAI-2024"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-val-01"
    },
    {
      "id": "AI-01",
      "name": "Clinical and laboratory pattern that justifies testing",
      "group": "Screening",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Clinical and laboratory pattern that justifies testing. Evaluates laboratory features: sodium below 135, potassium above 5.0, eosinophils above 5%, glucose below 70.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "laboratory features: sodium < 135, potassium > 5.0, eosinophils > 5%, glucose < 70",
            "clinical features: fatigue, weight loss, nausea or vomiting, orthostatic dizziness, hyperpigmentation, salt craving",
            "at least one of each, OR three of any"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Screening opportunity: measure an 8 am cortisol with ACTH"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Order an 8 am cortisol with ACTH; add renin and aldosterone when primary insufficiency is suspected"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Individually non-specific features; the pattern only justifies measuring."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016",
        "EV-HUSEBYE-2014"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-01"
    },
    {
      "id": "AI-02",
      "name": "Hyperpigmentation",
      "group": "Screening",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Hyperpigmentation. Evaluates skin, scar, gum or palmar-crease hyperpigmentation documented.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "skin, scar, gum or palmar-crease hyperpigmentation documented"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "A strong clue to primary adrenal insufficiency (ACTH excess): testing is warranted"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Not diagnostic; sun exposure and other causes are common."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-02"
    },
    {
      "id": "AI-03",
      "name": "Salt craving",
      "group": "Screening",
      "status": "active",
      "classification": "Priority 5",
      "summary": "Salt craving. Evaluates salt craving documented.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "salt craving documented"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Salt craving can reflect mineralocorticoid deficiency: consider primary adrenal insufficiency"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "No sensitivity or specificity is claimed."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-03"
    },
    {
      "id": "AI-04",
      "name": "Morning cortisol band",
      "group": "Testing",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Morning cortisol band. Evaluates 8 am total cortisol entered.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "8 am total cortisol entered"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Below 5 µg/dL: adrenal insufficiency very likely",
            "5 to under 15 µg/dL: indeterminate, needs an ACTH-stimulation test",
            "15 µg/dL or above: adrenal insufficiency unlikely"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Assay-dependent; acute illness can alter the bands."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016",
        "EV-HUSEBYE-2014"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-04"
    },
    {
      "id": "AI-05",
      "name": "ACTH-stimulation result",
      "group": "Testing",
      "status": "active",
      "classification": "Priority 3",
      "summary": "ACTH-stimulation result. Evaluates peak cortisol after 250 µg cosyntropin entered.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "peak cortisol after 250 µg cosyntropin entered"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Peak below 18 µg/dL (500 nmol/L): insufficient adrenal response",
            "Peak 18 µg/dL or above: adequate response, though recent-onset secondary insufficiency can still pass"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Assay cutoffs differ."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-05"
    },
    {
      "id": "AI-06",
      "name": "Primary pattern",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Primary pattern. Evaluates low cortisol (8 am below 15 µg/dL, or stimulated peak below 18).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "low cortisol (8 am < 15 µg/dL, or stimulated peak < 18)",
            "ACTH above the laboratory upper limit"
          ]
        },
        {
          "heading": "Supportive, not required",
          "items": [
            "renin raised",
            "aldosterone low",
            "hyperkalemia"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Pattern of primary adrenal insufficiency"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Add renin and aldosterone to define mineralocorticoid deficiency",
            "Look for the cause: 21-hydroxylase antibodies, then adrenal imaging"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "A pattern for physician review."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-06"
    },
    {
      "id": "AI-07",
      "name": "Secondary or tertiary pattern",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Secondary or tertiary pattern. Evaluates low cortisol.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "low cortisol",
            "ACTH low or inappropriately normal (not raised)"
          ]
        },
        {
          "heading": "Supportive, not required",
          "items": [
            "low DHEA-S for age",
            "other pituitary hormone deficiencies",
            "pituitary or hypothalamic disease, head trauma, surgery or radiation"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Pattern of secondary (pituitary) or tertiary (hypothalamic or glucocorticoid-suppressed) adrenal insufficiency"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Assess the other pituitary axes and consider pituitary imaging",
            "Review exogenous glucocorticoid, opioid and megestrol exposure"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Exogenous glucocorticoid suppression produces the same pattern."
          ]
        }
      ],
      "evidence": [
        "EV-ES-HYPOPIT-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-07"
    },
    {
      "id": "AI-08",
      "name": "Work-up of the cause in primary pattern",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 4",
      "summary": "Work-up of the cause in primary pattern. Evaluates primary pattern (AI-06).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "primary pattern (AI-06)"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Autoimmune adrenalitis is the most common cause: check 21-hydroxylase antibodies",
            "If negative, consider imaging and tuberculosis, hemorrhage, metastases, infection and adrenoleukodystrophy (young men)"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Prompts, not conclusions."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-08"
    },
    {
      "id": "AI-09",
      "name": "Hypopituitarism context",
      "group": "Classification",
      "status": "active",
      "classification": "Priority 4",
      "summary": "Hypopituitarism context. Evaluates secondary pattern (AI-07).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "secondary pattern (AI-07)",
            "pituitary or hypothalamic context"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Assess all pituitary axes; replacement order matters when several are deficient"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "A prompt."
          ]
        }
      ],
      "evidence": [
        "EV-ES-HYPOPIT-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-09"
    },
    {
      "id": "AI-10",
      "name": "Glucocorticoid exposure",
      "group": "Context triggers",
      "status": "active",
      "classification": "Priority 3",
      "summary": "Glucocorticoid exposure. Evaluates glucocorticoid at or above a prednisone equivalent of about 5 mg/day for 3–4 weeks or more, by any route (oral, high-dose inhaled, injected or topical).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "glucocorticoid at or above a prednisone equivalent of about 5 mg/day for 3–4 weeks or more, by any route (oral, high-dose inhaled, injected or topical)",
            "OR megestrol or chronic opioid use"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Glucocorticoid-induced adrenal insufficiency is possible, particularly if the dose is reduced or stopped or illness occurs"
          ]
        },
        {
          "heading": "Recommended next steps (for physician review)",
          "items": [
            "Do not stop glucocorticoids abruptly; physician to plan any taper",
            "Provide sick-day guidance and consider testing, with hydrocortisone held before a morning cortisol"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Does not diagnose; the engine gives no taper or dose."
          ]
        }
      ],
      "evidence": [
        "EV-ES-GCAI-2024"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-10"
    },
    {
      "id": "AI-11",
      "name": "Immune checkpoint inhibitor",
      "group": "Context triggers",
      "status": "active",
      "classification": "Priority 2",
      "summary": "Immune checkpoint inhibitor. Evaluates checkpoint inhibitor treatment.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "checkpoint inhibitor treatment",
            "fatigue, headache, nausea, weakness, hyponatremia or hypotension"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Hypophysitis and primary adrenalitis are recognized immune-related adverse events: screen cortisol, ACTH, TSH, free T4 and sodium/potassium"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Reporting and management belong to the treating oncology team."
          ]
        }
      ],
      "evidence": [
        "EV-ASCO-IRAE-2021"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-11"
    },
    {
      "id": "AI-12",
      "name": "Possible adrenal crisis",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 1",
      "summary": "Possible adrenal crisis. Evaluates systolic blood pressure below 90 mmHg or shock.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "systolic blood pressure < 90 mmHg or shock",
            "with known adrenal insufficiency, chronic glucocorticoid use, hyponatremia, hyperkalemia, hypoglycemia, or vomiting/fever/trauma/surgery in an at-risk patient"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Emergency: suspected adrenal crisis. Treat first per protocol; do not wait for test results. Draw cortisol and ACTH if it does not delay treatment"
          ]
        },
        {
          "heading": "Never outputs",
          "items": [
            "a glucocorticoid dose"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "The engine names no dose."
          ]
        }
      ],
      "evidence": [
        "EV-RUSHWORTH-2019",
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-12"
    },
    {
      "id": "AI-13",
      "name": "Known adrenal insufficiency with intercurrent illness",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 2",
      "summary": "Known adrenal insufficiency with intercurrent illness. Evaluates known adrenal insufficiency.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "known adrenal insufficiency",
            "fever, vomiting, diarrhea, trauma or surgery"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Sick-day rules apply: glucocorticoid cover is increased per the patient's plan, and parenteral treatment is needed if vomiting"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Dose and route belong to the treating physician and the patient's written plan."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-13"
    },
    {
      "id": "AI-14",
      "name": "DHEA-S low for age",
      "group": "Context triggers",
      "status": "active",
      "classification": "Priority 6",
      "summary": "DHEA-S low for age. Evaluates DHEA-S below the age- and sex-specific reference.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "DHEA-S below the age- and sex-specific reference",
            "fatigue or secondary pattern"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Low DHEA-S supports ACTH deficiency"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Age-dependent and supportive only; not a screening test."
          ]
        }
      ],
      "evidence": [
        "EV-ES-HYPOPIT-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-14"
    },
    {
      "id": "AI-15",
      "name": "Central hypothyroidism: assess the adrenal axis first",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 2",
      "summary": "Central hypothyroidism: assess the adrenal axis first. Evaluates low free T4 with low or normal TSH (central pattern).",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "low free T4 with low or normal TSH (central pattern)"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Assess adrenal function before thyroid hormone replacement: levothyroxine can precipitate adrenal crisis in unrecognized insufficiency"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Links to the thyroid engine."
          ]
        }
      ],
      "evidence": [
        "EV-ES-HYPOPIT-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-15"
    },
    {
      "id": "AI-SAFE-01",
      "name": "Severe hyperkalemia or hypoglycemia with an adrenal clue",
      "group": "Safety",
      "status": "active",
      "classification": "Priority 1",
      "summary": "Severe hyperkalemia or hypoglycemia with an adrenal clue. Evaluates potassium ≥ 6.0 mmol/L OR glucose below 54 mg/dL.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "potassium ≥ 6.0 mmol/L OR glucose < 54 mg/dL",
            "with hyponatremia, hyperpigmentation, glucocorticoid use or an adrenal clue"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Urgent assessment: severe metabolic derangement with features of adrenal insufficiency"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Routine outpatient pathway is not appropriate."
          ]
        }
      ],
      "evidence": [
        "EV-RUSHWORTH-2019"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-safe-01"
    },
    {
      "id": "AI-MISS-01",
      "name": "ACTH needed to place the axis",
      "group": "Missing data",
      "status": "active",
      "classification": "Priority 8",
      "summary": "ACTH needed to place the axis. Evaluates low cortisol or insufficient stimulation.",
      "sections": [
        {
          "heading": "Condition",
          "items": [
            "low cortisol or insufficient stimulation",
            "ACTH not entered"
          ]
        },
        {
          "heading": "What it reports",
          "items": [
            "Primary versus secondary insufficiency cannot be separated without ACTH"
          ]
        },
        {
          "heading": "Diagnostic boundary",
          "items": [
            "Names what is needed."
          ]
        }
      ],
      "evidence": [
        "EV-ES-PAI-2016"
      ],
      "url": "https://biod.ai/tools/adrenal/rules/ai-miss-01"
    }
  ],
  "evidence": [
    {
      "id": "EV-ES-PAI-2016",
      "citation": "Bornstein SR, Allolio B, Arlt W, et al. Diagnosis and Treatment of Primary Adrenal Insufficiency: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2016;101(2):364-389.",
      "supports": [
        "Morning cortisol and ACTH as first tests; ACTH stimulation with 250 µg cosyntropin; peak cortisol below 18 µg/dL as insufficient",
        "Suspected adrenal crisis must be treated without waiting for tests"
      ]
    },
    {
      "id": "EV-HUSEBYE-2014",
      "citation": "Husebye ES, Allolio B, Arlt W, et al. Consensus statement on the diagnosis, treatment and follow-up of patients with primary adrenal insufficiency. J Intern Med. 2014;275(2):104-115.",
      "supports": [
        "Morning cortisol below about 5 µg/dL makes insufficiency very likely, above about 15 µg/dL unlikely"
      ]
    },
    {
      "id": "EV-ES-HYPOPIT-2016",
      "citation": "Fleseriu M, Hashim IA, Karavitaki N, et al. Hormonal Replacement in Hypopituitarism in Adults: An Endocrine Society Clinical Practice Guideline. J Clin Endocrinol Metab. 2016;101(11):3888-3921.",
      "supports": [
        "Assess the adrenal axis before thyroid replacement in central hypothyroidism",
        "Secondary adrenal insufficiency testing"
      ]
    },
    {
      "id": "EV-ES-GCAI-2024",
      "citation": "Beuschlein F, Else T, Bancos I, et al. European Society of Endocrinology and Endocrine Society Joint Clinical Guideline: Diagnosis and therapy of glucocorticoid-induced adrenal insufficiency. J Clin Endocrinol Metab. 2024;109(7):1657-1683.",
      "supports": [
        "Glucocorticoid exposure by any route can suppress the axis; do not stop abruptly; cross-reactivity of prednisolone in cortisol assays"
      ]
    },
    {
      "id": "EV-ASCO-IRAE-2021",
      "citation": "Schneider BJ, Naidoo J, Santomasso BD, et al. Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: ASCO Guideline Update. J Clin Oncol. 2021;39(36):4073-4126.",
      "supports": [
        "Endocrine immune-related adverse events: hypophysitis and adrenal insufficiency"
      ]
    },
    {
      "id": "EV-RUSHWORTH-2019",
      "citation": "Rushworth RL, Torpy DJ, Falhammar H. Adrenal Crisis. N Engl J Med. 2019;381(9):852-861.",
      "supports": [
        "Recognition of adrenal crisis and its precipitants"
      ]
    }
  ]
}