# ESAS-r (Watanabe)

ESAS-r

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/esas_r`
HTML: https://magentlab.com/docs/esas-r
Markdown: https://magentlab.com/docs/esas-r.md

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

## What it computes

Sum nine caller-assigned Watanabe 2011 ESAS-r integers (0-10) and return the total (max 90). Does not invent severity classes for the sum.

## When to use

When an agent has already assigned Watanabe 2011 ESAS-r 0-10 integers for the nine core items (now) and needs the published total, not a diagnosis, treatment order, Bruera 1991 ESAS, or ESAS-r Renal.

## When not to use

- Not a medical device and not a diagnosis or treatment order.
- Each of the nine items is a caller-assigned integer 0-10 (0 none/best, 10 worst) for how the person feels now. magent does not administer the form.
- This is Watanabe 2011 ESAS-r only (nine core items; max 90). magent does not score Bruera 1991 original ESAS. Itch, sleep, and restless legs are not core ESAS-r items (those appear on ESAS-r Renal). The optional other-problem line is not a required input.
- Watanabe 2011 published the nine 0-10 ratings and did not publish severity classes for a summed total. This tool returns score and max_score only. It does not invent mild, moderate, or severe bands.

## Formula

```
ESAS-r = pain + tiredness + drowsiness + nausea + lack_of_appetite + shortness_of_breath + depression + anxiety + wellbeing; each caller-assigned 0-10; max 90; Watanabe 2011; no total-score severity classes; not Bruera 1991 ESAS
```

## Citation

[A multicenter study comparing two numerical versions of the Edmonton Symptom Assessment System in palliative care patients](https://doi.org/10.1016/j.jpainsymman.2010.04.020)
Watanabe SM, Nekolaichuk C, Beaumont C, Johnson L, Myers J, Strasser F
J Pain Symptom Manage. 2011;41(2):456-468
DOI: [10.1016/j.jpainsymman.2010.04.020](https://doi.org/10.1016/j.jpainsymman.2010.04.020)

## Worked example

### All items 0

Given: `anxiety=0, depression=0, drowsiness=0, lack_of_appetite=0, nausea=0, pain=0, shortness_of_breath=0, tiredness=0, wellbeing=0`

1. pain, tiredness, drowsiness, nausea, lack_of_appetite, shortness_of_breath, depression, anxiety, and wellbeing are 0 as assigned by the caller
2. Score = 0 (max 90). Watanabe 2011 published no total-score severity class.


### All items 10

Given: `anxiety=10, depression=10, drowsiness=10, lack_of_appetite=10, nausea=10, pain=10, shortness_of_breath=10, tiredness=10, wellbeing=10`

1. each of the nine Watanabe 2011 ESAS-r items is 10 as assigned by the caller
2. Score = 90 (max 90). No total-score severity class.


## Also searched as

- ESAS-r
- ESAS-r score
- Edmonton Symptom Assessment System-revised
- Watanabe ESAS-r
- Watanabe 2011 ESAS-r
- revised Edmonton Symptom Assessment System
- ESAS revised nine-item NRS
- palliative symptom assessment ESAS-r

## Parameters

- `pain` (integer, required): Caller-assigned Watanabe 2011 ESAS-r pain (integer 0-10): 0 no pain, 10 worst possible pain; how the person feels now. magent does not administer the form.
- `tiredness` (integer, required): Caller-assigned Watanabe 2011 ESAS-r tiredness (integer 0-10): 0 no tiredness, 10 worst possible tiredness (tiredness = lack of energy); how the person feels now. magent does not administer the form.
- `drowsiness` (integer, required): Caller-assigned Watanabe 2011 ESAS-r drowsiness (integer 0-10): 0 no drowsiness, 10 worst possible drowsiness (drowsiness = feeling sleepy); how the person feels now. magent does not administer the form.
- `nausea` (integer, required): Caller-assigned Watanabe 2011 ESAS-r nausea (integer 0-10): 0 no nausea, 10 worst possible nausea; how the person feels now. magent does not administer the form.
- `lack_of_appetite` (integer, required): Caller-assigned Watanabe 2011 ESAS-r lack of appetite (integer 0-10): 0 no lack of appetite, 10 worst possible lack of appetite; how the person feels now. magent does not administer the form.
- `shortness_of_breath` (integer, required): Caller-assigned Watanabe 2011 ESAS-r shortness of breath (integer 0-10): 0 no shortness of breath, 10 worst possible shortness of breath; how the person feels now. magent does not administer the form.
- `depression` (integer, required): Caller-assigned Watanabe 2011 ESAS-r depression (integer 0-10): 0 no depression, 10 worst possible depression (depression = feeling sad); how the person feels now. magent does not administer the form.
- `anxiety` (integer, required): Caller-assigned Watanabe 2011 ESAS-r anxiety (integer 0-10): 0 no anxiety, 10 worst possible anxiety (anxiety = feeling nervous); how the person feels now. magent does not administer the form.
- `wellbeing` (integer, required): Caller-assigned Watanabe 2011 ESAS-r wellbeing (integer 0-10): 0 best wellbeing, 10 worst possible wellbeing (wellbeing = how you feel overall); how the person feels now. magent does not administer the form.

## 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.

Method: `POST /api/calc/esas_r`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: 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:

```json
{
  "items": [
    {
      "anxiety": "0",
      "depression": "0",
      "drowsiness": "0",
      "lack_of_appetite": "0",
      "nausea": "0",
      "pain": "0",
      "shortness_of_breath": "0",
      "tiredness": "0",
      "wellbeing": "0"
    },
    {
      "anxiety": "0",
      "depression": "0",
      "drowsiness": "0",
      "lack_of_appetite": "0",
      "nausea": "0",
      "pain": "0",
      "shortness_of_breath": "0",
      "tiredness": "0",
      "wellbeing": "0"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/esas-r

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/esas_r",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "pain",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tiredness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "drowsiness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "nausea",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lack_of_appetite",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "shortness_of_breath",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "depression",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "anxiety",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "wellbeing",
          "points": 0,
          "present": true
        }
      ],
      "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": "Watanabe SM, Nekolaichuk C, Beaumont C, Johnson L, Myers J, Strasser F",
        "doi": "10.1016/j.jpainsymman.2010.04.020",
        "id": "watanabe-2011",
        "pmid": "20832987",
        "source": "J Pain Symptom Manage. 2011;41(2):456-468",
        "title": "A multicenter study comparing two numerical versions of the Edmonton Symptom Assessment System in palliative care patients"
      },
      "formula": "esas_r",
      "formula_expression": "ESAS-r = pain + tiredness + drowsiness + nausea + lack_of_appetite + shortness_of_breath + depression + anxiety + wellbeing; each caller-assigned 0-10; max 90; Watanabe 2011; no total-score severity classes; not Bruera 1991 ESAS",
      "max_score": 90,
      "score": 0
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "pain",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tiredness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "drowsiness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "nausea",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "lack_of_appetite",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "shortness_of_breath",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "depression",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "anxiety",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "wellbeing",
          "points": 0,
          "present": true
        }
      ],
      "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": "Watanabe SM, Nekolaichuk C, Beaumont C, Johnson L, Myers J, Strasser F",
        "doi": "10.1016/j.jpainsymman.2010.04.020",
        "id": "watanabe-2011",
        "pmid": "20832987",
        "source": "J Pain Symptom Manage. 2011;41(2):456-468",
        "title": "A multicenter study comparing two numerical versions of the Edmonton Symptom Assessment System in palliative care patients"
      },
      "formula": "esas_r",
      "formula_expression": "ESAS-r = pain + tiredness + drowsiness + nausea + lack_of_appetite + shortness_of_breath + depression + anxiety + wellbeing; each caller-assigned 0-10; max 90; Watanabe 2011; no total-score severity classes; not Bruera 1991 ESAS",
      "max_score": 90,
      "score": 0
    }
  ]
}
```

## Response fields

- `formula` (string): esas_r
- `formula_expression` (string): Exact expression used
- `score` (integer): Watanabe 2011 ESAS-r sum of nine caller-assigned 0-10 items (0-90)
- `max_score` (integer): Always 90
- `components` (array): Per-item caller-assigned points
- `citation` (object): Watanabe et al. J Pain Symptom Manage 2011 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "pain",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "tiredness",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "drowsiness",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "nausea",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "lack_of_appetite",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "shortness_of_breath",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "depression",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "anxiety",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "wellbeing",
      "points": 0,
      "present": true
    }
  ],
  "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": "Watanabe SM, Nekolaichuk C, Beaumont C, Johnson L, Myers J, Strasser F",
    "doi": "10.1016/j.jpainsymman.2010.04.020",
    "id": "watanabe-2011",
    "pmid": "20832987",
    "source": "J Pain Symptom Manage. 2011;41(2):456-468",
    "title": "A multicenter study comparing two numerical versions of the Edmonton Symptom Assessment System in palliative care patients"
  },
  "formula": "esas_r",
  "formula_expression": "ESAS-r = pain + tiredness + drowsiness + nausea + lack_of_appetite + shortness_of_breath + depression + anxiety + wellbeing; each caller-assigned 0-10; max 90; Watanabe 2011; no total-score severity classes; not Bruera 1991 ESAS",
  "max_score": 90,
  "score": 0
}
```

## Errors

- HTTP 400 `invalid_esas_item`: each ESAS-r item must be an integer from 0 to 10 (Watanabe 2011). Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [PEG](https://magentlab.com/docs/peg) — Compute the Krebs 2009 PEG as the unweighted mean of three caller-assigned 0-10 integers (pain_average, enjoyment_of_life, general_activity). Potential range 0-10. Krebs 2009 did not publish a diagnostic cutoff.
- [PAINAD](https://magentlab.com/docs/painad) — Sum five caller-assigned Warden 2003 PAINAD integers (0-2) and return the published total (max 10).

## 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.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/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.
