MAGENT

Respiratory · LIVE

ASCO irAE pneumonitis

irAE pneumonitis

Apply Brahmer 2018 ASCO Table 3.1 immune-related pneumonitis grading and return grade 1-4 plus the published ICPi hold or permanently-discontinue action from caller-assigned flags.

LIVE $0.005 USDC GET /api/calc/irae_pneumonitis

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

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

What it computes

Apply Brahmer 2018 ASCO Table 3.1 immune-related pneumonitis grading and return grade 1-4 plus the published ICPi hold or permanently-discontinue action from caller-assigned flags.

When to use

When an agent already has caller-assigned flags for life-threatening respiratory compromise, hospitalization, oxygen, self-care or instrumental ADL limitation, radiographic extent, and symptoms, and needs the published ASCO 2018 pneumonitis grade and ICPi action. magent does not read CT or pulse oximetry.

When not to use

  • Not a medical device.
  • Not a diagnosis. Grade is not a pneumonitis diagnosis and not a steroid dose.
  • magent does not read CT or pulse oximetry. All flags are caller-assigned.
  • ASCO 2018 (Brahmer) Table 3.1 pneumonitis only. Not SITC 2021.
  • Not CTCAE pneumonitis as a separate instrument.

Formula

irae_pneumonitis first-match worst-wins (Brahmer 2018 Table 3.1): grade 4 if life_threatening_respiratory; else grade 3 if hospitalization_required or oxygen_indicated or limiting_self_care or all_lobes_or_gt_50_pct; else grade 2 if symptomatic or more_than_one_lobe or extent_25_to_50_pct or limiting_instrumental_adl; else grade 1. icpi_action hold_if_radiographic_progression (grade 1), hold (grade 2), permanently_discontinue (grade 3 or 4). magent does not read CT or pulse oximetry. Not SITC 2021. Not CTCAE pneumonitis as a separate instrument. 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

Grade 1: all flags false

Given: all_lobes_or_gt_50_pct=falseextent_25_to_50_pct=falsehospitalization_required=falselife_threatening_respiratory=falselimiting_instrumental_adl=falselimiting_self_care=falsemore_than_one_lobe=falseoxygen_indicated=falsesymptomatic=false

  1. life_threatening_respiratory false, so not grade 4
  2. No grade 3 flags (hospitalization, oxygen, limiting self-care, all lobes or >50%)
  3. No grade 2 flags (symptomatic, more than one lobe, 25%-50% parenchyma, limiting instrumental ADL)
  4. grade is 1; icpi_action is hold_if_radiographic_progression

Grade 2: symptomatic only

Given: all_lobes_or_gt_50_pct=falseextent_25_to_50_pct=falsehospitalization_required=falselife_threatening_respiratory=falselimiting_instrumental_adl=falselimiting_self_care=falsemore_than_one_lobe=falseoxygen_indicated=falsesymptomatic=true

  1. No grade 4 or grade 3 flags
  2. symptomatic true (Brahmer 2018 Table 3.1 grade 2)
  3. grade is 2; icpi_action is hold

Grade 3: oxygen indicated

Given: all_lobes_or_gt_50_pct=falseextent_25_to_50_pct=falsehospitalization_required=falselife_threatening_respiratory=falselimiting_instrumental_adl=falselimiting_self_care=falsemore_than_one_lobe=falseoxygen_indicated=truesymptomatic=false

  1. life_threatening_respiratory false, so not grade 4
  2. oxygen_indicated true (Brahmer 2018 Table 3.1 grade 3)
  3. grade is 3; icpi_action is permanently_discontinue

Grade 4: life-threatening respiratory compromise

Given: all_lobes_or_gt_50_pct=falseextent_25_to_50_pct=falsehospitalization_required=falselife_threatening_respiratory=truelimiting_instrumental_adl=falselimiting_self_care=falsemore_than_one_lobe=falseoxygen_indicated=falsesymptomatic=false

  1. life_threatening_respiratory true (urgent intervention indicated, intubation)
  2. grade is 4; icpi_action is permanently_discontinue

Also searched as

  • irAE pneumonitis
  • immune checkpoint pneumonitis
  • ASCO 2018 pneumonitis
  • Brahmer pneumonitis grade
  • ICI pneumonitis
  • immune-related lung toxicity
  • checkpoint inhibitor pneumonitis
  • ICPi pneumonitis hold

Try

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

/api/calc/irae_pneumonitis?life_threatening_respiratory=false&hospitalization_required=false&oxygen_indicated=false&limiting_self_care=false&all_lobes_or_gt_50_pct=false&symptomatic=false&more_than_one_lobe=false&extent_25_to_50_pct=false&limiting_instrumental_adl=false

Full URL: https://api.magentlab.com/api/calc/irae_pneumonitis?life_threatening_respiratory=false&hospitalization_required=false&oxygen_indicated=false&limiting_self_care=false&all_lobes_or_gt_50_pct=false&symptomatic=false&more_than_one_lobe=false&extent_25_to_50_pct=false&limiting_instrumental_adl=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_pneumonitis?life_threatening_respiratory=false&hospitalization_required=false&oxygen_indicated=false&limiting_self_care=false&all_lobes_or_gt_50_pct=false&symptomatic=false&more_than_one_lobe=false&extent_25_to_50_pct=false&limiting_instrumental_adl=false"

Parameters

Name Type Required Description
life_threatening_respiratory boolean required Life-threatening respiratory compromise with urgent intervention indicated (intubation) as assigned by the caller (Brahmer 2018 Table 3.1 grade 4). true or false. When true, grade is 4 regardless of other flags. magent does not examine the patient or set a ventilator.
hospitalization_required boolean required Hospitalization required as assigned by the caller (Brahmer 2018 Table 3.1 grade 3). true or false. magent does not decide admission.
oxygen_indicated boolean required Oxygen indicated as assigned by the caller (Brahmer 2018 Table 3.1 grade 3). true or false. magent does not read pulse oximetry or start oxygen.
limiting_self_care boolean required Limiting self-care ADL as assigned by the caller (Brahmer 2018 Table 3.1 grade 3). true or false. magent does not assess ADL.
all_lobes_or_gt_50_pct boolean required Involves all lung lobes or >50% of lung parenchyma as assigned by the caller (Brahmer 2018 Table 3.1 grade 3). true or false. magent does not read CT.
symptomatic boolean required Symptomatic as assigned by the caller (Brahmer 2018 Table 3.1 grade 2). true or false. magent does not examine the patient.
more_than_one_lobe boolean required Involves more than one lobe as assigned by the caller (Brahmer 2018 Table 3.1 grade 2). true or false. magent does not read CT.
extent_25_to_50_pct boolean required Involves 25%–50% of lung parenchyma as assigned by the caller (Brahmer 2018 Table 3.1 grade 2). true or false. magent does not read CT.
limiting_instrumental_adl boolean required Limiting instrumental ADL as assigned by the caller (Brahmer 2018 Table 3.1 grade 2). true or false. magent does not assess ADL.

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_pneumonitis 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": [
    {
      "all_lobes_or_gt_50_pct": "false",
      "extent_25_to_50_pct": "false",
      "hospitalization_required": "false",
      "life_threatening_respiratory": "false",
      "limiting_instrumental_adl": "false",
      "limiting_self_care": "false",
      "more_than_one_lobe": "false",
      "oxygen_indicated": "false",
      "symptomatic": "false"
    },
    {
      "all_lobes_or_gt_50_pct": "false",
      "extent_25_to_50_pct": "false",
      "hospitalization_required": "false",
      "life_threatening_respiratory": "false",
      "limiting_instrumental_adl": "false",
      "limiting_self_care": "false",
      "more_than_one_lobe": "false",
      "oxygen_indicated": "false",
      "symptomatic": "false"
    }
  ]
}

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_pneumonitis",
  "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_pneumonitis",
      "formula_expression": "irae_pneumonitis first-match worst-wins (Brahmer 2018 Table 3.1): grade 4 if life_threatening_respiratory; else grade 3 if hospitalization_required or oxygen_indicated or limiting_self_care or all_lobes_or_gt_50_pct; else grade 2 if symptomatic or more_than_one_lobe or extent_25_to_50_pct or limiting_instrumental_adl; else grade 1. icpi_action hold_if_radiographic_progression (grade 1), hold (grade 2), permanently_discontinue (grade 3 or 4). magent does not read CT or pulse oximetry. Not SITC 2021. Not CTCAE pneumonitis as a separate instrument. Not a diagnosis. Not a steroid dose",
      "criteria": [
        {
          "factor": "life_threatening_respiratory",
          "met": false
        },
        {
          "factor": "hospitalization_required",
          "met": false
        },
        {
          "factor": "oxygen_indicated",
          "met": false
        },
        {
          "factor": "limiting_self_care",
          "met": false
        },
        {
          "factor": "all_lobes_or_gt_50_pct",
          "met": false
        },
        {
          "factor": "symptomatic",
          "met": false
        },
        {
          "factor": "more_than_one_lobe",
          "met": false
        },
        {
          "factor": "extent_25_to_50_pct",
          "met": false
        },
        {
          "factor": "limiting_instrumental_adl",
          "met": false
        }
      ],
      "grade": 1,
      "icpi_action": "hold_if_radiographic_progression",
      "limiting_self_care": false,
      "all_lobes_or_gt_50_pct": false,
      "extent_25_to_50_pct": false,
      "hospitalization_required": false,
      "life_threatening_respiratory": false,
      "limiting_instrumental_adl": false,
      "more_than_one_lobe": false,
      "oxygen_indicated": false,
      "symptomatic": false
    },
    {
      "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_pneumonitis",
      "formula_expression": "irae_pneumonitis first-match worst-wins (Brahmer 2018 Table 3.1): grade 4 if life_threatening_respiratory; else grade 3 if hospitalization_required or oxygen_indicated or limiting_self_care or all_lobes_or_gt_50_pct; else grade 2 if symptomatic or more_than_one_lobe or extent_25_to_50_pct or limiting_instrumental_adl; else grade 1. icpi_action hold_if_radiographic_progression (grade 1), hold (grade 2), permanently_discontinue (grade 3 or 4). magent does not read CT or pulse oximetry. Not SITC 2021. Not CTCAE pneumonitis as a separate instrument. Not a diagnosis. Not a steroid dose",
      "criteria": [
        {
          "factor": "life_threatening_respiratory",
          "met": false
        },
        {
          "factor": "hospitalization_required",
          "met": false
        },
        {
          "factor": "oxygen_indicated",
          "met": false
        },
        {
          "factor": "limiting_self_care",
          "met": false
        },
        {
          "factor": "all_lobes_or_gt_50_pct",
          "met": false
        },
        {
          "factor": "symptomatic",
          "met": false
        },
        {
          "factor": "more_than_one_lobe",
          "met": false
        },
        {
          "factor": "extent_25_to_50_pct",
          "met": false
        },
        {
          "factor": "limiting_instrumental_adl",
          "met": false
        }
      ],
      "grade": 1,
      "icpi_action": "hold_if_radiographic_progression",
      "limiting_self_care": false,
      "all_lobes_or_gt_50_pct": false,
      "extent_25_to_50_pct": false,
      "hospitalization_required": false,
      "life_threatening_respiratory": false,
      "limiting_instrumental_adl": false,
      "more_than_one_lobe": false,
      "oxygen_indicated": false,
      "symptomatic": false
    }
  ]
}

Response

Field Type Description
formula string irae_pneumonitis
formula_expression string Brahmer 2018 Table 3.1 first-match worst-wins pneumonitis grade and ICPi action
grade integer 1, 2, 3, or 4. First-match worst-wins on caller-assigned Brahmer 2018 Table 3.1 flags. Not a diagnosis. Not a steroid dose.
icpi_action string hold_if_radiographic_progression (grade 1), hold (grade 2), or permanently_discontinue (grade 3 or 4)
life_threatening_respiratory boolean Echo of caller-assigned life_threatening_respiratory (true or false)
hospitalization_required boolean Echo of caller-assigned hospitalization_required (true or false)
oxygen_indicated boolean Echo of caller-assigned oxygen_indicated (true or false)
limiting_self_care boolean Echo of caller-assigned limiting_self_care (true or false)
all_lobes_or_gt_50_pct boolean Echo of caller-assigned all_lobes_or_gt_50_pct (true or false)
symptomatic boolean Echo of caller-assigned symptomatic (true or false)
more_than_one_lobe boolean Echo of caller-assigned more_than_one_lobe (true or false)
extent_25_to_50_pct boolean Echo of caller-assigned extent_25_to_50_pct (true or false)
limiting_instrumental_adl boolean Echo of caller-assigned limiting_instrumental_adl (true or false)
criteria array Per-factor Tree rows with factor and met for each Brahmer 2018 Table 3.1 caller-assigned flag
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_pneumonitis",
  "formula_expression": "irae_pneumonitis first-match worst-wins (Brahmer 2018 Table 3.1): grade 4 if life_threatening_respiratory; else grade 3 if hospitalization_required or oxygen_indicated or limiting_self_care or all_lobes_or_gt_50_pct; else grade 2 if symptomatic or more_than_one_lobe or extent_25_to_50_pct or limiting_instrumental_adl; else grade 1. icpi_action hold_if_radiographic_progression (grade 1), hold (grade 2), permanently_discontinue (grade 3 or 4). magent does not read CT or pulse oximetry. Not SITC 2021. Not CTCAE pneumonitis as a separate instrument. Not a diagnosis. Not a steroid dose",
  "criteria": [
    {
      "factor": "life_threatening_respiratory",
      "met": false
    },
    {
      "factor": "hospitalization_required",
      "met": false
    },
    {
      "factor": "oxygen_indicated",
      "met": false
    },
    {
      "factor": "limiting_self_care",
      "met": false
    },
    {
      "factor": "all_lobes_or_gt_50_pct",
      "met": false
    },
    {
      "factor": "symptomatic",
      "met": false
    },
    {
      "factor": "more_than_one_lobe",
      "met": false
    },
    {
      "factor": "extent_25_to_50_pct",
      "met": false
    },
    {
      "factor": "limiting_instrumental_adl",
      "met": false
    }
  ],
  "grade": 1,
  "icpi_action": "hold_if_radiographic_progression",
  "limiting_self_care": false,
  "all_lobes_or_gt_50_pct": false,
  "extent_25_to_50_pct": false,
  "hospitalization_required": false,
  "life_threatening_respiratory": false,
  "limiting_instrumental_adl": false,
  "more_than_one_lobe": false,
  "oxygen_indicated": false,
  "symptomatic": false
}

Client errors (HTTP 400)

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

HTTP Code When
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

  • LIPS — Sum Gajic 2011 Table 3 lung injury prediction score items from caller-assigned flags and return the published ROC cutoff band (low <4, high ≥4).
  • qCSI — Sum Haimovich 2020 qCSI bedside points (Table 2) from respiratory rate, lowest SpO2, and nasal-cannula oxygen flow and return the integer total (max 12).

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.