MAGENT

Emergency · LIVE

Leiden undifferentiated arthritis prediction rule

Leiden UA rule

Sum the van der Helm-van Mil 2007 simplified Leiden prediction score for recent-onset undifferentiated arthritis and return the paper’s ≤6 / 6–8 / ≥8 decision band.

LIVE $0.005 USDC GET /api/calc/leiden_arthritis

Markdown: /docs/leiden-arthritis.md · Canonical: https://magentlab.com/docs/leiden-arthritis

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

What it computes

Sum the van der Helm-van Mil 2007 simplified Leiden prediction score for recent-onset undifferentiated arthritis and return the paper’s ≤6 / 6–8 / ≥8 decision band.

When to use

When an agent already has age, sex, caller-assigned joint-distribution flags, 100-mm morning-stiffness VAS, tender and swollen joint counts, CRP in mg/L, and RF/anti-CCP flags and needs the published Leiden UA score, not an RA diagnosis.

When not to use

  • Not a medical device and not a diagnosis of rheumatoid arthritis or a treatment order.
  • magent does not examine joints or assay serologies. Age, sex, distribution flags, 100-mm VAS, joint counts, CRP, RF, and anti-CCP are caller-assigned.
  • Morning stiffness is the published 100-mm VAS severity, not duration in minutes.
  • If upper_and_lower_extremities is true, the 1-point upper_extremities row is ignored (1.5 only). Small-joint and symmetric rows may stack with that extremity row.
  • The total is rounded to the nearest number ending in .0 or .5 (paper Table 3). Bands are the paper decision cutoffs: ≤6 low, >6 and <8 indeterminate, ≥8 high. max_score 14. Not a classification of RA.

Formula

Leiden UA score (van der Helm-van Mil 2007 Figure 1 / Table 2) = age_years*0.02 + female 1 + small_joints_hands_feet 0.5 + symmetric 0.5 + (upper_and_lower_extremities 1.5 else upper_extremities 1) + morning_stiffness_vas_mm (0–25 → 0; 26–90 → 1; >90 → 2) + tender_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + swollen_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + crp_mg_l (0–4 → 0; 5–50 → 0.5; ≥51 → 1.5) + rheumatoid_factor_positive 1 + anti_ccp_positive 2; round to nearest 0.0 or 0.5; ≤6 low, >6 and <8 indeterminate, ≥8 high; max 14; not a diagnosis of RA

Citation

Title
A prediction rule for disease outcome in patients with recent-onset undifferentiated arthritis: how to guide individual treatment decisions
Authors
van der Helm-van Mil AH, le Cessie S, van Dongen H, Breedveld FC, Toes RE, Huizinga TW
Source
Arthritis Rheum. 2007;56(2):433-440
DOI
10.1002/art.22380

Worked example

Age 48 female, RF negative: 7.46 rounds to 7.5 indeterminate

Given: age=48anti_ccp_positive=falsecrp_mg_l=60morning_stiffness_vas_mm=50rheumatoid_factor_positive=falsesex=femalesmall_joints_hands_feet=trueswollen_joint_count=8symmetric=truetender_joint_count=8upper_and_lower_extremities=falseupper_extremities=true

  1. age 48 × 0.02 = 0.96; female 1; small joints 0.5; symmetric 0.5; upper extremities 1; VAS 50 → 1; tender 8 → 0.5; swollen 8 → 0.5; CRP 60 → 1.5; RF 0; anti-CCP 0
  2. unrounded 7.46; round to nearest 0.0 or 0.5 → 7.5; leiden_band indeterminate (>6 and <8)

Same inputs with RF positive: 8.46 rounds to 8.5 high

Given: age=48anti_ccp_positive=falsecrp_mg_l=60morning_stiffness_vas_mm=50rheumatoid_factor_positive=truesex=femalesmall_joints_hands_feet=trueswollen_joint_count=8symmetric=truetender_joint_count=8upper_and_lower_extremities=falseupper_extremities=true

  1. prior unrounded 7.46 + RF 1 = 8.46
  2. round to nearest 0.0 or 0.5 → 8.5; leiden_band high (≥8)

Score 6.0 is low

Given: age=50anti_ccp_positive=falsecrp_mg_l=0morning_stiffness_vas_mm=50rheumatoid_factor_positive=falsesex=femalesmall_joints_hands_feet=trueswollen_joint_count=8symmetric=truetender_joint_count=8upper_and_lower_extremities=falseupper_extremities=true

  1. age 50 × 0.02 = 1; female 1; small 0.5; symmetric 0.5; upper 1; VAS 50 → 1; tender 8 → 0.5; swollen 8 → 0.5; CRP 0; RF 0; anti-CCP 0
  2. score = 6.0 (≤6); leiden_band low

Also searched as

  • Leiden prediction rule
  • Leiden UA rule
  • undifferentiated arthritis score
  • van der Helm-van Mil 2007
  • early arthritis prediction rule
  • Leiden RA prediction score

Try

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

/api/calc/leiden_arthritis?age=48&sex=female&small_joints_hands_feet=true&symmetric=true&upper_extremities=true&upper_and_lower_extremities=false&morning_stiffness_vas_mm=50&tender_joint_count=8&swollen_joint_count=8&crp_mg_l=60&rheumatoid_factor_positive=false&anti_ccp_positive=false

Full URL: https://api.magentlab.com/api/calc/leiden_arthritis?age=48&sex=female&small_joints_hands_feet=true&symmetric=true&upper_extremities=true&upper_and_lower_extremities=false&morning_stiffness_vas_mm=50&tender_joint_count=8&swollen_joint_count=8&crp_mg_l=60&rheumatoid_factor_positive=false&anti_ccp_positive=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/leiden_arthritis?age=48&sex=female&small_joints_hands_feet=true&symmetric=true&upper_extremities=true&upper_and_lower_extremities=false&morning_stiffness_vas_mm=50&tender_joint_count=8&swollen_joint_count=8&crp_mg_l=60&rheumatoid_factor_positive=false&anti_ccp_positive=false"

Parameters

Name Type Required Description
age integer required Age in years as an integer from 18 to 120 (van der Helm-van Mil 2007). Scores age_years × 0.02. magent does not assign age.
sex string required · female, male Caller-assigned sex (van der Helm-van Mil 2007). female scores 1; male scores 0. magent does not assign sex.
small_joints_hands_feet boolean required Involvement of small joints of the hands or feet (van der Helm-van Mil 2007). true scores 0.5 and may stack with symmetric and the extremity row. magent does not examine joints.
symmetric boolean required Symmetric joint involvement (van der Helm-van Mil 2007). true scores 0.5 and may stack with small-joint and extremity rows. magent does not examine joints.
upper_extremities boolean required Involvement of upper extremities only (van der Helm-van Mil 2007). true scores 1 unless upper_and_lower_extremities is true, in which case this row is ignored. Mutually exclusive with the 1.5 upper-and-lower row. magent does not examine joints.
upper_and_lower_extremities boolean required Involvement of upper and lower extremities (van der Helm-van Mil 2007). true scores 1.5 and ignores upper_extremities. magent does not examine joints.
morning_stiffness_vas_mm number required Morning-stiffness severity on a 100-mm VAS (van der Helm-van Mil 2007), not duration in minutes. Number 0–100. 0–25 scores 0; 26–90 scores 1; >90 scores 2. magent does not take a history.
tender_joint_count integer required Caller-assigned tender joint count (van der Helm-van Mil 2007). Integer 0–68. <4 scores 0; 4–10 scores 0.5; ≥11 scores 1. magent does not examine joints.
swollen_joint_count integer required Caller-assigned swollen joint count (van der Helm-van Mil 2007). Integer 0–66. <4 scores 0; 4–10 scores 0.5; ≥11 scores 1. magent does not examine joints.
crp_mg_l number required Caller-assigned C-reactive protein in mg/L (van der Helm-van Mil 2007). Number 0–500. 0–4 scores 0; 5–50 scores 0.5; ≥51 scores 1.5. magent does not assay CRP.
rheumatoid_factor_positive boolean required Caller-assigned rheumatoid factor positivity (van der Helm-van Mil 2007). true scores 1. magent does not assay serologies.
anti_ccp_positive boolean required Caller-assigned anti-CCP (ACPA) positivity (van der Helm-van Mil 2007). true scores 2. magent does not assay serologies.

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/leiden_arthritis 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": [
    {
      "age": "48",
      "anti_ccp_positive": "false",
      "crp_mg_l": "60",
      "morning_stiffness_vas_mm": "50",
      "rheumatoid_factor_positive": "false",
      "sex": "female",
      "small_joints_hands_feet": "true",
      "swollen_joint_count": "8",
      "symmetric": "true",
      "tender_joint_count": "8",
      "upper_and_lower_extremities": "false",
      "upper_extremities": "true"
    },
    {
      "age": "48",
      "anti_ccp_positive": "false",
      "crp_mg_l": "60",
      "morning_stiffness_vas_mm": "50",
      "rheumatoid_factor_positive": "false",
      "sex": "female",
      "small_joints_hands_feet": "true",
      "swollen_joint_count": "8",
      "symmetric": "true",
      "tender_joint_count": "8",
      "upper_and_lower_extremities": "false",
      "upper_extremities": "true"
    }
  ]
}

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/leiden_arthritis",
  "items": [
    {
      "components": [
        {
          "value": 48,
          "factor": "age",
          "points": 0.96,
          "present": true
        },
        {
          "value": "female",
          "factor": "female",
          "points": 1,
          "present": true
        },
        {
          "factor": "small_joints_hands_feet",
          "points": 0.5,
          "present": true
        },
        {
          "factor": "symmetric",
          "points": 0.5,
          "present": true
        },
        {
          "factor": "upper_and_lower_extremities",
          "points": 0.0,
          "present": false
        },
        {
          "factor": "upper_extremities",
          "points": 1.0,
          "present": true
        },
        {
          "value": 50.0,
          "factor": "morning_stiffness_vas_mm",
          "points": 1,
          "present": true
        },
        {
          "value": 8,
          "factor": "tender_joint_count",
          "points": 0.5,
          "present": true
        },
        {
          "value": 8,
          "factor": "swollen_joint_count",
          "points": 0.5,
          "present": true
        },
        {
          "value": 60.0,
          "factor": "crp_mg_l",
          "points": 1.5,
          "present": true
        },
        {
          "factor": "rheumatoid_factor_positive",
          "points": 0,
          "present": false
        },
        {
          "factor": "anti_ccp_positive",
          "points": 0,
          "present": 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": "van der Helm-van Mil AH, le Cessie S, van Dongen H, Breedveld FC, Toes RE, Huizinga TW",
        "doi": "10.1002/art.22380",
        "id": "van-der-helm-van-mil-2007",
        "pmid": "17265478",
        "source": "Arthritis Rheum. 2007;56(2):433-440",
        "title": "A prediction rule for disease outcome in patients with recent-onset undifferentiated arthritis: how to guide individual treatment decisions"
      },
      "formula": "leiden_arthritis",
      "formula_expression": "Leiden UA score (van der Helm-van Mil 2007 Figure 1 / Table 2) = age_years*0.02 + female 1 + small_joints_hands_feet 0.5 + symmetric 0.5 + (upper_and_lower_extremities 1.5 else upper_extremities 1) + morning_stiffness_vas_mm (0–25 → 0; 26–90 → 1; >90 → 2) + tender_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + swollen_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + crp_mg_l (0–4 → 0; 5–50 → 0.5; ≥51 → 1.5) + rheumatoid_factor_positive 1 + anti_ccp_positive 2; round to nearest 0.0 or 0.5; ≤6 low, >6 and <8 indeterminate, ≥8 high; max 14; not a diagnosis of RA",
      "max_score": 14,
      "score": 7.5,
      "leiden_band": "indeterminate"
    },
    {
      "components": [
        {
          "value": 48,
          "factor": "age",
          "points": 0.96,
          "present": true
        },
        {
          "value": "female",
          "factor": "female",
          "points": 1,
          "present": true
        },
        {
          "factor": "small_joints_hands_feet",
          "points": 0.5,
          "present": true
        },
        {
          "factor": "symmetric",
          "points": 0.5,
          "present": true
        },
        {
          "factor": "upper_and_lower_extremities",
          "points": 0.0,
          "present": false
        },
        {
          "factor": "upper_extremities",
          "points": 1.0,
          "present": true
        },
        {
          "value": 50.0,
          "factor": "morning_stiffness_vas_mm",
          "points": 1,
          "present": true
        },
        {
          "value": 8,
          "factor": "tender_joint_count",
          "points": 0.5,
          "present": true
        },
        {
          "value": 8,
          "factor": "swollen_joint_count",
          "points": 0.5,
          "present": true
        },
        {
          "value": 60.0,
          "factor": "crp_mg_l",
          "points": 1.5,
          "present": true
        },
        {
          "factor": "rheumatoid_factor_positive",
          "points": 0,
          "present": false
        },
        {
          "factor": "anti_ccp_positive",
          "points": 0,
          "present": 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": "van der Helm-van Mil AH, le Cessie S, van Dongen H, Breedveld FC, Toes RE, Huizinga TW",
        "doi": "10.1002/art.22380",
        "id": "van-der-helm-van-mil-2007",
        "pmid": "17265478",
        "source": "Arthritis Rheum. 2007;56(2):433-440",
        "title": "A prediction rule for disease outcome in patients with recent-onset undifferentiated arthritis: how to guide individual treatment decisions"
      },
      "formula": "leiden_arthritis",
      "formula_expression": "Leiden UA score (van der Helm-van Mil 2007 Figure 1 / Table 2) = age_years*0.02 + female 1 + small_joints_hands_feet 0.5 + symmetric 0.5 + (upper_and_lower_extremities 1.5 else upper_extremities 1) + morning_stiffness_vas_mm (0–25 → 0; 26–90 → 1; >90 → 2) + tender_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + swollen_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + crp_mg_l (0–4 → 0; 5–50 → 0.5; ≥51 → 1.5) + rheumatoid_factor_positive 1 + anti_ccp_positive 2; round to nearest 0.0 or 0.5; ≤6 low, >6 and <8 indeterminate, ≥8 high; max 14; not a diagnosis of RA",
      "max_score": 14,
      "score": 7.5,
      "leiden_band": "indeterminate"
    }
  ]
}

Response

Field Type Description
formula string leiden_arthritis
formula_expression string Exact expression used
score number van der Helm-van Mil 2007 simplified prediction score rounded to the nearest 0.0 or 0.5 (Table 3 grouping). Half-points allowed.
max_score integer 14
leiden_band string Paper decision cutoffs on the rounded score: low (≤6), indeterminate (>6 and <8), or high (≥8). Not a diagnosis of RA.
components array Per-factor points before rounding
citation object van der Helm-van Mil et al. Arthritis Rheum 2007 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "value": 48,
      "factor": "age",
      "points": 0.96,
      "present": true
    },
    {
      "value": "female",
      "factor": "female",
      "points": 1,
      "present": true
    },
    {
      "factor": "small_joints_hands_feet",
      "points": 0.5,
      "present": true
    },
    {
      "factor": "symmetric",
      "points": 0.5,
      "present": true
    },
    {
      "factor": "upper_and_lower_extremities",
      "points": 0.0,
      "present": false
    },
    {
      "factor": "upper_extremities",
      "points": 1.0,
      "present": true
    },
    {
      "value": 50.0,
      "factor": "morning_stiffness_vas_mm",
      "points": 1,
      "present": true
    },
    {
      "value": 8,
      "factor": "tender_joint_count",
      "points": 0.5,
      "present": true
    },
    {
      "value": 8,
      "factor": "swollen_joint_count",
      "points": 0.5,
      "present": true
    },
    {
      "value": 60.0,
      "factor": "crp_mg_l",
      "points": 1.5,
      "present": true
    },
    {
      "factor": "rheumatoid_factor_positive",
      "points": 0,
      "present": false
    },
    {
      "factor": "anti_ccp_positive",
      "points": 0,
      "present": 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": "van der Helm-van Mil AH, le Cessie S, van Dongen H, Breedveld FC, Toes RE, Huizinga TW",
    "doi": "10.1002/art.22380",
    "id": "van-der-helm-van-mil-2007",
    "pmid": "17265478",
    "source": "Arthritis Rheum. 2007;56(2):433-440",
    "title": "A prediction rule for disease outcome in patients with recent-onset undifferentiated arthritis: how to guide individual treatment decisions"
  },
  "formula": "leiden_arthritis",
  "formula_expression": "Leiden UA score (van der Helm-van Mil 2007 Figure 1 / Table 2) = age_years*0.02 + female 1 + small_joints_hands_feet 0.5 + symmetric 0.5 + (upper_and_lower_extremities 1.5 else upper_extremities 1) + morning_stiffness_vas_mm (0–25 → 0; 26–90 → 1; >90 → 2) + tender_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + swollen_joint_count (<4 → 0; 4–10 → 0.5; ≥11 → 1) + crp_mg_l (0–4 → 0; 5–50 → 0.5; ≥51 → 1.5) + rheumatoid_factor_positive 1 + anti_ccp_positive 2; round to nearest 0.0 or 0.5; ≤6 low, >6 and <8 indeterminate, ≥8 high; max 14; not a diagnosis of RA",
  "max_score": 14,
  "score": 7.5,
  "leiden_band": "indeterminate"
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_age age must be an integer from 18 to 120 Returned before settlement; you are not charged.
400 invalid_sex sex must be female or male Returned before settlement; you are not charged.
400 invalid_leiden morning_stiffness_vas_mm must be 0–100; tender_joint_count an integer 0–68; swollen_joint_count an integer 0–66; crp_mg_l a number 0–500 (van der Helm-van Mil 2007 Leiden UA rule). 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

  • ACR/EULAR gout — Apply the 2015 ACR/EULAR gout classification criteria (Neogi Table 2): require the entry episode, classify immediately if MSU crystals are present, otherwise return the Step 3 score (max 23) and whether score ≥8 classifies gout. Not a gout diagnosis.
  • SDAI — Sum caller-assigned 28-joint swollen and tender counts, 0–10 cm patient and evaluator globals, and CRP in mg/dL, and return the Aletaha 2005 SDAI with the newly proposed activity state.
  • ACR/EULAR PMR — Apply the 2012 EULAR/ACR polymyalgia rheumatica classification criteria (Dasgupta Table 4): require age ≥50, bilateral shoulder aching, and abnormal CRP and/or ESR, then return the clinical score with or without optional ultrasound and whether the published cut point classifies PMR. Not a PMR diagnosis.

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.