MAGENT

GI · LIVE

ASCO irAE colitis grade

irAE colitis

Apply Brahmer 2018 ASCO Table 2.1 immune-related colitis grading (CTCAE diarrhea as used in the table) and return grade 1-4 plus icpi_action from stools_over_baseline and four caller-assigned flags.

LIVE $0.005 USDC GET /api/calc/irae_colitis

Markdown: /docs/irae-colitis.md · Canonical: https://magentlab.com/docs/irae-colitis

Not a medical device. Not a diagnosis, dose, or listing recommendation.

What it computes

Apply Brahmer 2018 ASCO Table 2.1 immune-related colitis grading (CTCAE diarrhea as used in the table) and return grade 1-4 plus icpi_action from stools_over_baseline and four caller-assigned flags.

When to use

When an agent already has the increase of stools per day over baseline and caller-assigned incontinence, hospitalization-indicated, limiting-self-care, and life-threatening flags and needs the published first-match grade and ICI hold or discontinue action. magent does not count stools.

When not to use

  • Not a medical device.
  • Not a diagnosis. Not a steroid dose or immunosuppression order.
  • magent does not count stools. stools_over_baseline and the four flags are caller-assigned (Brahmer 2018 Table 2.1 CTCAE diarrhea as used in the table).
  • Ostomy-output bands are not implemented (stool-increase plus incontinence, hospitalization_indicated, limiting_self_care, and life_threatening only).
  • Not SITC 2021. Not CTCAE v5 diarrhea as a separate instrument.

Formula

irae colitis first-match (Brahmer 2018 Table 2.1 CTCAE diarrhea): grade 4 if life_threatening; else grade 3 if stools_over_baseline >= 7 or incontinence or hospitalization_indicated or limiting_self_care; else grade 2 if stools_over_baseline >= 4; else grade 1. icpi_action continue (1), hold (2), hold_consider_discontinue_ctla4 (3), permanently_discontinue (4). Ostomy-output bands not implemented. magent does not count stools. Not a diagnosis. Not a steroid dose

Citation

Title
Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline
Authors
Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA
Source
J Clin Oncol. 2018;36(17):1714-1768
DOI
10.1200/JCO.2017.77.6385

Worked example

Two stools over baseline, grade 1 continue

Given: hospitalization_indicated=falseincontinence=falselife_threatening=falselimiting_self_care=falsestools_over_baseline=2

  1. stools_over_baseline is 2 (increase of fewer than four stools per day over baseline)
  2. incontinence, hospitalization_indicated, limiting_self_care, and life_threatening are false
  3. first-match is grade 1; icpi_action is continue

Life-threatening flag, grade 4 discontinue

Given: hospitalization_indicated=falseincontinence=falselife_threatening=truelimiting_self_care=falsestools_over_baseline=1

  1. life_threatening is true (life-threatening consequences; urgent intervention indicated)
  2. stools_over_baseline is 1; first-match grade 4 overrides the stool band
  3. icpi_action is permanently_discontinue

Also searched as

  • irAE colitis
  • immune-related colitis
  • ASCO colitis grade
  • Brahmer 2018 colitis
  • ICI colitis CTCAE
  • checkpoint inhibitor diarrhea
  • immune checkpoint colitis grade
  • CTCAE diarrhea colitis

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/irae_colitis?stools_over_baseline=2&incontinence=false&hospitalization_indicated=false&limiting_self_care=false&life_threatening=false

Full URL: https://api.magentlab.com/api/calc/irae_colitis?stools_over_baseline=2&incontinence=false&hospitalization_indicated=false&limiting_self_care=false&life_threatening=false

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/irae_colitis?stools_over_baseline=2&incontinence=false&hospitalization_indicated=false&limiting_self_care=false&life_threatening=false"

Parameters

Name Type Required Description
stools_over_baseline integer required Increase of stools per day over baseline as assigned by the caller (integer 0-40; Brahmer 2018 Table 2.1 CTCAE diarrhea). Fewer than four is grade 1; four to six is grade 2; seven or more is grade 3 unless life_threatening is true. Ostomy-output increase is not an input. magent does not count stools.
incontinence boolean required Incontinence as assigned by the caller (Brahmer 2018 Table 2.1 grade 3). true or false. When true and life_threatening is false, grade is 3. magent does not examine the patient.
hospitalization_indicated boolean required Hospitalization indicated as assigned by the caller (Brahmer 2018 Table 2.1 grade 3). true or false. When true and life_threatening is false, grade is 3. magent does not admit the patient.
limiting_self_care boolean required Limiting self-care ADL as assigned by the caller (Brahmer 2018 Table 2.1 grade 3). true or false. When true and life_threatening is false, grade is 3. magent does not assess ADL.
life_threatening boolean required Life-threatening consequences with urgent intervention indicated, as assigned by the caller (Brahmer 2018 Table 2.1 grade 4). true or false. When true, grade is 4 regardless of stool count. magent does not examine the patient.

Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

POST /api/calc/irae_colitis Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
  • The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
  • HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
  • Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
  • x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request (fixture)

{
  "items": [
    {
      "hospitalization_indicated": "false",
      "incontinence": "false",
      "life_threatening": "false",
      "limiting_self_care": "false",
      "stools_over_baseline": "2"
    },
    {
      "hospitalization_indicated": "false",
      "incontinence": "false",
      "life_threatening": "false",
      "limiting_self_care": "false",
      "stools_over_baseline": "2"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/irae_colitis",
  "items": [
    {
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA",
        "doi": "10.1200/JCO.2017.77.6385",
        "id": "brahmer-2018",
        "pmid": "29442540",
        "source": "J Clin Oncol. 2018;36(17):1714-1768",
        "title": "Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline"
      },
      "formula": "irae_colitis",
      "formula_expression": "irae colitis first-match (Brahmer 2018 Table 2.1 CTCAE diarrhea): grade 4 if life_threatening; else grade 3 if stools_over_baseline >= 7 or incontinence or hospitalization_indicated or limiting_self_care; else grade 2 if stools_over_baseline >= 4; else grade 1. icpi_action continue (1), hold (2), hold_consider_discontinue_ctla4 (3), permanently_discontinue (4). Ostomy-output bands not implemented. magent does not count stools. Not a diagnosis. Not a steroid dose",
      "criteria": [
        {
          "factor": "life_threatening",
          "met": false
        },
        {
          "value": 2,
          "factor": "stools_ge_7",
          "met": false
        },
        {
          "factor": "incontinence",
          "met": false
        },
        {
          "factor": "hospitalization_indicated",
          "met": false
        },
        {
          "factor": "limiting_self_care",
          "met": false
        },
        {
          "value": 2,
          "factor": "stools_ge_4",
          "met": false
        }
      ],
      "grade": 1,
      "hospitalization_indicated": false,
      "icpi_action": "continue",
      "incontinence": false,
      "life_threatening": false,
      "limiting_self_care": false,
      "stools_over_baseline": 2
    },
    {
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA",
        "doi": "10.1200/JCO.2017.77.6385",
        "id": "brahmer-2018",
        "pmid": "29442540",
        "source": "J Clin Oncol. 2018;36(17):1714-1768",
        "title": "Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline"
      },
      "formula": "irae_colitis",
      "formula_expression": "irae colitis first-match (Brahmer 2018 Table 2.1 CTCAE diarrhea): grade 4 if life_threatening; else grade 3 if stools_over_baseline >= 7 or incontinence or hospitalization_indicated or limiting_self_care; else grade 2 if stools_over_baseline >= 4; else grade 1. icpi_action continue (1), hold (2), hold_consider_discontinue_ctla4 (3), permanently_discontinue (4). Ostomy-output bands not implemented. magent does not count stools. Not a diagnosis. Not a steroid dose",
      "criteria": [
        {
          "factor": "life_threatening",
          "met": false
        },
        {
          "value": 2,
          "factor": "stools_ge_7",
          "met": false
        },
        {
          "factor": "incontinence",
          "met": false
        },
        {
          "factor": "hospitalization_indicated",
          "met": false
        },
        {
          "factor": "limiting_self_care",
          "met": false
        },
        {
          "value": 2,
          "factor": "stools_ge_4",
          "met": false
        }
      ],
      "grade": 1,
      "hospitalization_indicated": false,
      "icpi_action": "continue",
      "incontinence": false,
      "life_threatening": false,
      "limiting_self_care": false,
      "stools_over_baseline": 2
    }
  ]
}

Response

Field Type Description
formula string irae_colitis
formula_expression string Brahmer 2018 Table 2.1 first-match colitis grade and icpi_action rule
grade integer Colitis grade 1, 2, 3, or 4 (Brahmer 2018 Table 2.1 CTCAE diarrhea as used in the table). First-match worst-wins. Not a diagnosis.
icpi_action string continue (grade 1), hold (grade 2), hold_consider_discontinue_ctla4 (grade 3), or permanently_discontinue (grade 4). Not a steroid dose.
stools_over_baseline integer Echo of the caller-assigned stool increase over baseline (0-40)
incontinence boolean Echo of caller-assigned incontinence (grade 3 when true)
hospitalization_indicated boolean Echo of caller-assigned hospitalization indicated (grade 3 when true)
limiting_self_care boolean Echo of caller-assigned limiting self-care ADL (grade 3 when true)
life_threatening boolean Echo of caller-assigned life-threatening flag (grade 4 when true)
criteria array Per-factor Tree rows with factor and met for life_threatening, stools_ge_7, incontinence, hospitalization_indicated, limiting_self_care, and stools_ge_4; stool rows include value
citation object Brahmer 2018 J Clin Oncol ASCO irAE guideline citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Brahmer JR, Lacchetti C, Schneider BJ, Atkins MB, Brassil KJ, Caterino JM, Chau I, Ernstoff MS, Gardner JM, Ginex P, Hallmeyer S, Holter Chakrabarty J, Leighl NB, Mammen JS, McDermott DF, Naing A, Nastoupil LJ, Phillips T, Porter LD, Puzanov I, Reichner CA, Santomasso BD, Seigel C, Spira A, Suarez-Almazor ME, Wang Y, Weber JS, Wolchok JD, Thompson JA",
    "doi": "10.1200/JCO.2017.77.6385",
    "id": "brahmer-2018",
    "pmid": "29442540",
    "source": "J Clin Oncol. 2018;36(17):1714-1768",
    "title": "Management of Immune-Related Adverse Events in Patients Treated With Immune Checkpoint Inhibitor Therapy: American Society of Clinical Oncology Clinical Practice Guideline"
  },
  "formula": "irae_colitis",
  "formula_expression": "irae colitis first-match (Brahmer 2018 Table 2.1 CTCAE diarrhea): grade 4 if life_threatening; else grade 3 if stools_over_baseline >= 7 or incontinence or hospitalization_indicated or limiting_self_care; else grade 2 if stools_over_baseline >= 4; else grade 1. icpi_action continue (1), hold (2), hold_consider_discontinue_ctla4 (3), permanently_discontinue (4). Ostomy-output bands not implemented. magent does not count stools. Not a diagnosis. Not a steroid dose",
  "criteria": [
    {
      "factor": "life_threatening",
      "met": false
    },
    {
      "value": 2,
      "factor": "stools_ge_7",
      "met": false
    },
    {
      "factor": "incontinence",
      "met": false
    },
    {
      "factor": "hospitalization_indicated",
      "met": false
    },
    {
      "factor": "limiting_self_care",
      "met": false
    },
    {
      "value": 2,
      "factor": "stools_ge_4",
      "met": false
    }
  ],
  "grade": 1,
  "hospitalization_indicated": false,
  "icpi_action": "continue",
  "incontinence": false,
  "life_threatening": false,
  "limiting_self_care": false,
  "stools_over_baseline": 2
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_stools_over_baseline stools_over_baseline must be an integer from 0 to 40 (Brahmer 2018 CTCAE diarrhea stools per day over baseline). Returned before settlement; you are not charged.
400 invalid_flag boolean clinical flags must be true or false Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • irAE hepatitis — Apply Brahmer 2018 ASCO Table 2.2 immune-related hepatitis lab folds (AST or ALT × ULN and total bilirubin × ULN) and return grade 0–4 plus ICI action, with caller-assigned decompensation (grade 4) and symptomatic compensated liver dysfunction (grade 3) upgrades.
  • Mayo DAI — Sum four caller-assigned Schroeder 1987 ulcerative colitis disease-activity index items (each integer 0-3) and return the total (max 12). Does not return later remission or activity bands.

Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /docs/mcp.

Guarantees

  • HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
  • exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
  • HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
  • Execution is timeout-bounded and concurrency-capped.
  • Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.