# ASDAS-ESR (Ankylosing Spondylitis Disease Activity Score)

ASDAS-ESR

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/asdas_esr`
HTML: https://magentlab.com/docs/asdas-esr
Markdown: https://magentlab.com/docs/asdas-esr.md

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

## What it computes

Compute the Lukas 2009 ASDAS-ESR from caller-assigned BASDAI 0–10 back pain, morning stiffness duration, peripheral pain/swelling, patient global, and ESR in mm/h.

## When to use

When an agent already has caller-assigned 0–10 BASDAI items (questions 2, 3, and 6), a 0–10 patient global, and ESR in mm/h and needs the published 2009 ASDAS-ESR, not ASDAS-CRP and not a BASDAI total.

## When not to use

- Not a medical device and not a biologic order.
- magent does not examine the patient or assay ESR. back_pain, morning_stiffness_duration, patient_global, and peripheral_pain_swelling are caller-assigned 0–10 VAS/NRS items. morning_stiffness_duration is BASDAI question 6 on 0–10, not hours. ESR is mm/h as published. The 0–150 ESR range is a magent clamp.
- Computes ASDAS-ESR only. Does not compute ASDAS-CRP. Not a BASDAI total (does not use BASDAI questions 1, 4, or 5).
- Lukas 2009 published the development formula and did not publish inactive/low/high/very-high cuts. magent does not apply Machado 2011 1.3/2.1/3.5 bands or a later CRP 2 mg/L floor (this tool uses ESR).

## Formula

```
ASDAS-ESR = 0.08*back_pain + 0.07*morning_stiffness_duration + 0.11*patient_global + 0.09*peripheral_pain_swelling + 0.29*sqrt(esr_mm_h); Lukas 2009 development formula; BASDAI 0-10 items (Q2 back pain, Q6 stiffness duration, Q3 peripheral pain/swelling) and patient global 0-10; ESR mm/h; not ASDAS-CRP; not BASDAI total; no Machado 2011 1.3/2.1/3.5 cuts; magent does not examine the patient or assay ESR
```

## Citation

[Development of an ASAS-endorsed disease activity score (ASDAS) in patients with ankylosing spondylitis](https://doi.org/10.1136/ard.2008.094870)
Lukas C, Landewé R, Sieper J, Dougados M, Davis J, Braun J, van der Linden S, van der Heijde D
Ann Rheum Dis. 2009;68(1):18-24
DOI: [10.1136/ard.2008.094870](https://doi.org/10.1136/ard.2008.094870)

## Worked example

### All zeros isolate sqrt(ESR) at ESR 0 mm/h

Given: `back_pain=0, esr_mm_h=0, morning_stiffness_duration=0, patient_global=0, peripheral_pain_swelling=0`

1. BASDAI 0-10 terms are 0; ESR 0 mm/h
2. 0.29*sqrt(0) = 0
3. score 0.00


### Clinical zeros isolate 0.29*sqrt(ESR) at ESR 100 mm/h

Given: `back_pain=0, esr_mm_h=100, morning_stiffness_duration=0, patient_global=0, peripheral_pain_swelling=0`

1. 0.29*sqrt(100) = 0.29*10
2. score 2.90


## Also searched as

- ASDAS ESR
- ASDAS-ESR
- ankylosing spondylitis disease activity score ESR
- ASAS ASDAS ESR
- Lukas ASDAS
- axial spondyloarthritis ASDAS ESR
- BASDAI ESR ASDAS

## Parameters

- `back_pain` (number, required): Caller-assigned total back pain on a 0-10 VAS or NRS (Lukas 2009; BASDAI question 2, neck/back/hip pain). Number 0-10. magent does not examine the patient.
- `morning_stiffness_duration` (number, required): Caller-assigned duration of morning stiffness on a 0-10 VAS or NRS (Lukas 2009; BASDAI question 6). Number 0-10, not hours. magent does not examine the patient.
- `patient_global` (number, required): Caller-assigned patient global assessment of disease activity on a 0-10 VAS or NRS (Lukas 2009). Number 0-10. magent does not examine the patient.
- `peripheral_pain_swelling` (number, required): Caller-assigned peripheral pain/swelling on a 0-10 VAS or NRS (Lukas 2009; BASDAI question 3, joints other than neck/back/hips). Number 0-10. magent does not examine the patient.
- `esr_mm_h` (number, required): Caller-assigned erythrocyte sedimentation rate in mm/h (Lukas 2009). Number 0-150 is a magent clamp. magent does not assay ESR.

## 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/asdas_esr`
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": [
    {
      "back_pain": "0",
      "esr_mm_h": "0",
      "morning_stiffness_duration": "0",
      "patient_global": "0",
      "peripheral_pain_swelling": "0"
    },
    {
      "back_pain": "0",
      "esr_mm_h": "0",
      "morning_stiffness_duration": "0",
      "patient_global": "0",
      "peripheral_pain_swelling": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/asdas_esr",
  "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": "Lukas C, Landewé R, Sieper J, Dougados M, Davis J, Braun J, van der Linden S, van der Heijde D",
        "doi": "10.1136/ard.2008.094870",
        "id": "lukas-2009",
        "pmid": "18625618",
        "source": "Ann Rheum Dis. 2009;68(1):18-24",
        "title": "Development of an ASAS-endorsed disease activity score (ASDAS) in patients with ankylosing spondylitis"
      },
      "formula": "asdas_esr",
      "formula_expression": "ASDAS-ESR = 0.08*back_pain + 0.07*morning_stiffness_duration + 0.11*patient_global + 0.09*peripheral_pain_swelling + 0.29*sqrt(esr_mm_h); Lukas 2009 development formula; BASDAI 0-10 items (Q2 back pain, Q6 stiffness duration, Q3 peripheral pain/swelling) and patient global 0-10; ESR mm/h; not ASDAS-CRP; not BASDAI total; no Machado 2011 1.3/2.1/3.5 cuts; magent does not examine the patient or assay ESR",
      "score": 0.0,
      "back_pain": 0.0,
      "morning_stiffness_duration": 0.0,
      "patient_global": 0.0,
      "peripheral_pain_swelling": 0.0,
      "esr_mm_h": 0.0
    },
    {
      "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": "Lukas C, Landewé R, Sieper J, Dougados M, Davis J, Braun J, van der Linden S, van der Heijde D",
        "doi": "10.1136/ard.2008.094870",
        "id": "lukas-2009",
        "pmid": "18625618",
        "source": "Ann Rheum Dis. 2009;68(1):18-24",
        "title": "Development of an ASAS-endorsed disease activity score (ASDAS) in patients with ankylosing spondylitis"
      },
      "formula": "asdas_esr",
      "formula_expression": "ASDAS-ESR = 0.08*back_pain + 0.07*morning_stiffness_duration + 0.11*patient_global + 0.09*peripheral_pain_swelling + 0.29*sqrt(esr_mm_h); Lukas 2009 development formula; BASDAI 0-10 items (Q2 back pain, Q6 stiffness duration, Q3 peripheral pain/swelling) and patient global 0-10; ESR mm/h; not ASDAS-CRP; not BASDAI total; no Machado 2011 1.3/2.1/3.5 cuts; magent does not examine the patient or assay ESR",
      "score": 0.0,
      "back_pain": 0.0,
      "morning_stiffness_duration": 0.0,
      "patient_global": 0.0,
      "peripheral_pain_swelling": 0.0,
      "esr_mm_h": 0.0
    }
  ]
}
```

## Response fields

- `formula` (string): asdas_esr
- `formula_expression` (string): Exact expression used
- `score` (number): Lukas 2009 ASDAS-ESR, 2 decimals. 0.08*back_pain+0.07*morning_stiffness_duration+0.11*patient_global+0.09*peripheral_pain_swelling+0.29*sqrt(esr_mm_h)
- `back_pain` (number): Back pain 0-10 used
- `morning_stiffness_duration` (number): Morning stiffness duration 0-10 used
- `patient_global` (number): Patient global 0-10 used
- `peripheral_pain_swelling` (number): Peripheral pain/swelling 0-10 used
- `esr_mm_h` (number): ESR in mm/h used
- `citation` (object): Lukas et al. Ann Rheum Dis 2009 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Lukas C, Landewé R, Sieper J, Dougados M, Davis J, Braun J, van der Linden S, van der Heijde D",
    "doi": "10.1136/ard.2008.094870",
    "id": "lukas-2009",
    "pmid": "18625618",
    "source": "Ann Rheum Dis. 2009;68(1):18-24",
    "title": "Development of an ASAS-endorsed disease activity score (ASDAS) in patients with ankylosing spondylitis"
  },
  "formula": "asdas_esr",
  "formula_expression": "ASDAS-ESR = 0.08*back_pain + 0.07*morning_stiffness_duration + 0.11*patient_global + 0.09*peripheral_pain_swelling + 0.29*sqrt(esr_mm_h); Lukas 2009 development formula; BASDAI 0-10 items (Q2 back pain, Q6 stiffness duration, Q3 peripheral pain/swelling) and patient global 0-10; ESR mm/h; not ASDAS-CRP; not BASDAI total; no Machado 2011 1.3/2.1/3.5 cuts; magent does not examine the patient or assay ESR",
  "score": 0.0,
  "back_pain": 0.0,
  "morning_stiffness_duration": 0.0,
  "patient_global": 0.0,
  "peripheral_pain_swelling": 0.0,
  "esr_mm_h": 0.0
}
```

## Errors

- HTTP 400 `invalid_asdas_esr`: ASDAS-ESR inputs must match Lukas 2009 back pain, stiffness, patient global, peripheral complaints, and ESR from that paper. 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

- [ASDAS-CRP](https://magentlab.com/docs/asdas-crp) — Compute the van der Heijde 2009 ASAS-preferred ASDAS-CRP from caller-assigned BASDAI 0–10 back pain, morning stiffness duration, peripheral pain/swelling, patient global, and CRP in mg/L.
- [ASAS axial SpA](https://magentlab.com/docs/asas-axial-spa) — Apply the 2009 ASAS classification criteria for axial spondyloarthritis (Rudwaleit set 3a / figure 2): require chronic back pain ≥3 months with age at onset <45, then return whether the imaging arm (sacroiliitis plus ≥1 SpA feature) or the clinical arm (HLA-B27 plus ≥2 other SpA features) classifies axial SpA. Not a diagnosis.
- [DAS28-ESR](https://magentlab.com/docs/das28-esr) — Compute the Prevoo 1995 28-joint DAS with ESR from caller-assigned tender and swollen 28-joint counts, ESR in mm/h, and patient general health on a 0-100 mm VAS. Returns the published score 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.

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