Electrolytes / glucose · LIVE
ASCO irAE hypothyroidism grade
irAE hypothyroidism
Apply Brahmer 2018 ASCO Table 4.1.1 primary hypothyroidism grading and return grade 1-3 plus icpi_action from tsh_miu_l and three caller-assigned flags.
Markdown: /docs/irae-hypothyroidism.md · Canonical: https://magentlab.com/docs/irae-hypothyroidism
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply Brahmer 2018 ASCO Table 4.1.1 primary hypothyroidism grading and return grade 1-3 plus icpi_action from tsh_miu_l and three caller-assigned flags.
When to use
When an agent already has TSH in mIU/L and caller-assigned moderate-symptoms, severe-or-life-threatening, and unable-to-perform-ADL flags and needs the published first-match grade and ICI continue or hold-until-baseline action. magent does not assay TSH or FT4.
When not to use
- Not a medical device.
- Not a diagnosis. Not a levothyroxine dose.
- magent does not assay TSH or FT4. tsh_miu_l and the three flags are caller-assigned (Brahmer 2018 Table 4.1.1 primary hypothyroidism).
- Not hyperthyroidism (Brahmer 2018 Table 4.1.2).
- Paper grade 3-4 is one band; this tool returns grade 3, not a separate grade 4.
Formula
irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose
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
- Source
- J Clin Oncol. 2018;36(17):1714-1768
Worked example
TSH 8 mIU/L, grade 1 continue
Given:
moderate_symptoms=falsesevere_or_life_threatening=falsetsh_miu_l=8unable_to_perform_adl=false
- tsh_miu_l is 8 (TSH <10 mIU/L)
- moderate_symptoms, severe_or_life_threatening, and unable_to_perform_adl are false
- first-match is grade 1; icpi_action is continue
TSH 12 mIU/L, grade 2 hold until baseline
Given:
moderate_symptoms=falsesevere_or_life_threatening=falsetsh_miu_l=12unable_to_perform_adl=false
- tsh_miu_l is 12 (persistently TSH >10 mIU/L; TSH 10 is this band)
- moderate_symptoms, severe_or_life_threatening, and unable_to_perform_adl are false
- first-match is grade 2; icpi_action is hold_until_baseline
Also searched as
- irAE hypothyroidism
- immune-related hypothyroidism
- ASCO hypothyroidism grade
- Brahmer 2018 hypothyroidism
- ICI hypothyroidism
- checkpoint inhibitor TSH
- immune checkpoint thyroid
- primary hypothyroidism irAE
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/irae_hypothyroidism?tsh_miu_l=8&moderate_symptoms=false&severe_or_life_threatening=false&unable_to_perform_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_hypothyroidism?tsh_miu_l=8&moderate_symptoms=false&severe_or_life_threatening=false&unable_to_perform_adl=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
tsh_miu_l |
number | required | TSH in mIU/L (0.01-150; Brahmer 2018 Table 4.1.1 primary hypothyroidism). Persistently TSH >10 mIU/L is grade 2 unless a grade 3 flag is true; TSH 10 is this band. TSH <10 mIU/L with no moderate or severe flags is grade 1. magent does not assay TSH. |
moderate_symptoms |
boolean | required | Moderate symptoms with ability to perform ADL as assigned by the caller (Brahmer 2018 Table 4.1.1 grade 2). true or false. When true and no grade 3 flag is true, grade is 2. magent does not examine the patient. |
severe_or_life_threatening |
boolean | required | Severe symptoms, medically significant or life-threatening consequences as assigned by the caller (Brahmer 2018 Table 4.1.1 grade 3-4, returned as grade 3). true or false. When true, grade is 3. magent does not examine the patient. |
unable_to_perform_adl |
boolean | required | Unable to perform ADL as assigned by the caller (Brahmer 2018 Table 4.1.1 grade 3-4, returned as grade 3). true or false. When true, grade is 3. 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.
- 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": [
{
"moderate_symptoms": "false",
"severe_or_life_threatening": "false",
"tsh_miu_l": "8",
"unable_to_perform_adl": "false"
},
{
"moderate_symptoms": "false",
"severe_or_life_threatening": "false",
"tsh_miu_l": "8",
"unable_to_perform_adl": "false"
}
]
}
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_hypothyroidism",
"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_hypothyroidism",
"formula_expression": "irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose",
"criteria": [
{
"factor": "severe_or_life_threatening",
"met": false
},
{
"factor": "unable_to_perform_adl",
"met": false
},
{
"factor": "moderate_symptoms",
"met": false
},
{
"value": 8.0,
"factor": "tsh_ge_10",
"met": false
}
],
"grade": 1,
"icpi_action": "continue",
"moderate_symptoms": false,
"severe_or_life_threatening": false,
"tsh_miu_l": 8.0,
"unable_to_perform_adl": 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_hypothyroidism",
"formula_expression": "irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose",
"criteria": [
{
"factor": "severe_or_life_threatening",
"met": false
},
{
"factor": "unable_to_perform_adl",
"met": false
},
{
"factor": "moderate_symptoms",
"met": false
},
{
"value": 8.0,
"factor": "tsh_ge_10",
"met": false
}
],
"grade": 1,
"icpi_action": "continue",
"moderate_symptoms": false,
"severe_or_life_threatening": false,
"tsh_miu_l": 8.0,
"unable_to_perform_adl": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | irae_hypothyroidism |
formula_expression |
string | Brahmer 2018 Table 4.1.1 first-match primary hypothyroidism grade and icpi_action rule |
grade |
integer | Primary hypothyroidism grade 1, 2, or 3 (Brahmer 2018 Table 4.1.1; paper G3-4 is grade 3). First-match worst-wins. Not a diagnosis. |
icpi_action |
string | continue (grade 1) or hold_until_baseline (grade 2 or 3). Not a levothyroxine dose. |
tsh_miu_l |
number | Echo of the caller-assigned TSH in mIU/L (0.01-150) |
moderate_symptoms |
boolean | Echo of caller-assigned moderate symptoms (grade 2 when true) |
severe_or_life_threatening |
boolean | Echo of caller-assigned severe or life-threatening flag (grade 3 when true) |
unable_to_perform_adl |
boolean | Echo of caller-assigned unable to perform ADL (grade 3 when true) |
criteria |
array | Per-factor Tree rows with factor and met for severe_or_life_threatening, unable_to_perform_adl, moderate_symptoms, and tsh_ge_10; the TSH row includes 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_hypothyroidism",
"formula_expression": "irae hypothyroidism first-match (Brahmer 2018 Table 4.1.1 primary hypothyroidism): grade 3 if severe_or_life_threatening or unable_to_perform_adl (paper G3-4 as grade 3); else grade 2 if moderate_symptoms or tsh_miu_l >= 10; else grade 1 if tsh_miu_l < 10. icpi_action continue (1), hold_until_baseline (2 and 3). Not hyperthyroidism (Table 4.1.2). magent does not assay TSH/FT4. Not a diagnosis. Not a levothyroxine dose",
"criteria": [
{
"factor": "severe_or_life_threatening",
"met": false
},
{
"factor": "unable_to_perform_adl",
"met": false
},
{
"factor": "moderate_symptoms",
"met": false
},
{
"value": 8.0,
"factor": "tsh_ge_10",
"met": false
}
],
"grade": 1,
"icpi_action": "continue",
"moderate_symptoms": false,
"severe_or_life_threatening": false,
"tsh_miu_l": 8.0,
"unable_to_perform_adl": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_tsh_miu_l |
tsh_miu_l must be a number from 0.01 to 150 (Brahmer 2018 TSH mIU/L). 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
- Myxedema coma score — Sum Popoveniuc 2014 myxedema coma diagnostic points from caller-assigned thermoregulatory, CNS, GI, precipitating-event, cardiovascular, and metabolic bands and return ≥60 potentially diagnostic or 45–59 at risk.
- Miller ESR — Compute the Miller 1983 adult maximum normal erythrocyte sedimentation rate in mm/h from age and sex. Men: age/2. Women: (age + 10)/2. Returns the threshold only.
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.