MAGENT

LIVE

PESI

Compute the Aujesky 2005 Pulmonary Embolism Severity Index (PESI) from age, sex, comorbidities, vital signs, and altered mental status.

Also searched as

  • PESI
  • Pulmonary Embolism Severity Index
  • Aujesky PESI
  • PESI score
  • original PESI
  • PE severity index
  • Aujesky 2005 PESI

LIVE $0.005 USDC GET /api/calc/pesi

Markdown: /docs/pesi.md · Canonical: https://magentlab.com/docs/pesi

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

What it computes

Compute the Aujesky 2005 Pulmonary Embolism Severity Index (PESI) from age, sex, comorbidities, vital signs, and altered mental status.

When to use

When an agent already has a diagnosis of pulmonary embolism, as in the paper, and needs the published 11-variable PESI total and class I-V.

When not to use

  • Not a diagnosis or outpatient-treatment protocol. magent does not diagnose PE.
  • Only for patients with already diagnosed pulmonary embolism, as in Aujesky 2005.
  • This tool is original PESI (Aujesky 2005), not sPESI. Heart failure and chronic lung disease are separate items.
  • This is the 11-variable point score, not the 17-variable laboratory model.
  • The caller assigns age, sex, comorbidities, vital signs, and altered mental status. magent does not examine the patient.

Formula

PESI = age_in_years + 10*male + 30*cancer + 10*heart_failure + 10*chronic_lung_disease + 20*(HR>=110) + 30*(SBP<100) + 20*(RR>=30) + 20*(temp<36) + 60*altered_mentation + 20*(SpO2<90); classes I <=65, II 66-85, III 86-105, IV 106-125, V >125

Citation

Title
Derivation and validation of a prognostic model for pulmonary embolism
Authors
Aujesky D, Obrosky DS, Stone RA, et al.
Source
Am J Respir Crit Care Med. 2005;172(8):1041-1046
DOI
10.1164/rccm.200506-862OC

Worked example

Age 50, female, all other items absent

Given: age=50altered_mentation=falsecancer=falsechronic_lung_disease=falseheart_failure=falseheart_rate_bpm=80respiratory_rate=16sex=femalespo2_percent=96systolic_mm_hg=120temperature_c=37.0

  1. Age 50 → 50; female → 0; cancer, heart failure, chronic lung disease false → 0
  2. HR 80 is not ≥110 → 0; SBP 120 is not <100 → 0; RR 16 is not ≥30 → 0
  3. Temp 37.0 is not <36 → 0; altered mentation false → 0; SpO2 96 is not <90 → 0
  4. Score = 50; pesi_class I

Age 80, male, cancer, altered mentation (class V)

Given: age=80altered_mentation=truecancer=truechronic_lung_disease=falseheart_failure=falseheart_rate_bpm=80respiratory_rate=16sex=malespo2_percent=96systolic_mm_hg=120temperature_c=37.0

  1. Age 80 → 80; male → 10; cancer → 30; altered mentation → 60
  2. Remaining items absent
  3. Score = 180; pesi_class V

Try

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

/api/calc/pesi?age=50&sex=female&cancer=false&heart_failure=false&chronic_lung_disease=false&heart_rate_bpm=80&systolic_mm_hg=120&respiratory_rate=16&temperature_c=37.0&altered_mentation=false&spo2_percent=96

Full URL: https://api.magentlab.com/api/calc/pesi?age=50&sex=female&cancer=false&heart_failure=false&chronic_lung_disease=false&heart_rate_bpm=80&systolic_mm_hg=120&respiratory_rate=16&temperature_c=37.0&altered_mentation=false&spo2_percent=96

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/pesi?age=50&sex=female&cancer=false&heart_failure=false&chronic_lung_disease=false&heart_rate_bpm=80&systolic_mm_hg=120&respiratory_rate=16&temperature_c=37.0&altered_mentation=false&spo2_percent=96"

Parameters

Name Type Required Description
age integer required Age in years (18-120). Adds 1 point per year (the age integer itself).
sex string required Sex (female or male). Male scores +10.
cancer boolean required Cancer as assigned by the caller. true or false. +30 if true.
heart_failure boolean required Heart failure as assigned by the caller (separate from chronic lung disease). true or false. +10 if true.
chronic_lung_disease boolean required Chronic lung disease as assigned by the caller (separate from heart failure). true or false. +10 if true.
heart_rate_bpm integer required Heart rate in beats per minute (integer 30-220). Scores +20 when ≥110; 109 does not score.
systolic_mm_hg number required Systolic blood pressure in mm Hg (50-250). Scores +30 when <100; 100 does not score.
respiratory_rate integer required Respiratory rate in breaths/min (integer 4-80). Scores +20 when ≥30; 29 does not score.
temperature_c number required Temperature in °C (30-45). Scores +20 when <36; 36.0 does not score.
altered_mentation boolean required Altered mental status as assigned by the caller. true or false. +60 if true.
spo2_percent number required Arterial oxygen saturation percent (50-100). Scores +20 when <90; 90 does not score.

Bulk (POST)

POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.

POST /api/calc/pesi Max 25 unit_amount * n PREVIEW

  • 1 to 25 items. Each item uses the same keys as the GET query parameters.
  • 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": "50",
      "altered_mentation": "false",
      "cancer": "false",
      "chronic_lung_disease": "false",
      "heart_failure": "false",
      "heart_rate_bpm": "80",
      "respiratory_rate": "16",
      "sex": "female",
      "spo2_percent": "96",
      "systolic_mm_hg": "120",
      "temperature_c": "37.0"
    },
    {
      "age": "50",
      "altered_mentation": "false",
      "cancer": "false",
      "chronic_lung_disease": "false",
      "heart_failure": "false",
      "heart_rate_bpm": "80",
      "respiratory_rate": "16",
      "sex": "female",
      "spo2_percent": "96",
      "systolic_mm_hg": "120",
      "temperature_c": "37.0"
    }
  ]
}

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/pesi",
  "items": [
    {
      "components": [
        {
          "value": 50,
          "factor": "age",
          "points": 50,
          "present": true
        },
        {
          "value": "female",
          "factor": "male_sex",
          "points": 0,
          "present": false
        },
        {
          "factor": "cancer",
          "points": 0,
          "present": false
        },
        {
          "factor": "heart_failure",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_lung_disease",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate_ge_110",
          "points": 0,
          "present": false
        },
        {
          "value": 120.0,
          "factor": "systolic_mm_hg_lt_100",
          "points": 0,
          "present": false
        },
        {
          "value": 16,
          "factor": "respiratory_rate_ge_30",
          "points": 0,
          "present": false
        },
        {
          "value": 37.0,
          "factor": "temperature_lt_36",
          "points": 0,
          "present": false
        },
        {
          "factor": "altered_mentation",
          "points": 0,
          "present": false
        },
        {
          "value": 96.0,
          "factor": "spo2_lt_90",
          "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": "Aujesky D, Obrosky DS, Stone RA, et al.",
        "doi": "10.1164/rccm.200506-862OC",
        "id": "aujesky-2005",
        "source": "Am J Respir Crit Care Med. 2005;172(8):1041-1046",
        "title": "Derivation and validation of a prognostic model for pulmonary embolism"
      },
      "formula": "pesi",
      "formula_expression": "PESI = age_in_years + 10*male + 30*cancer + 10*heart_failure + 10*chronic_lung_disease + 20*(HR>=110) + 30*(SBP<100) + 20*(RR>=30) + 20*(temp<36) + 60*altered_mentation + 20*(SpO2<90); classes I <=65, II 66-85, III 86-105, IV 106-125, V >125",
      "score": 50,
      "age_years": 50,
      "pesi_class": "I"
    },
    {
      "components": [
        {
          "value": 50,
          "factor": "age",
          "points": 50,
          "present": true
        },
        {
          "value": "female",
          "factor": "male_sex",
          "points": 0,
          "present": false
        },
        {
          "factor": "cancer",
          "points": 0,
          "present": false
        },
        {
          "factor": "heart_failure",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_lung_disease",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate_ge_110",
          "points": 0,
          "present": false
        },
        {
          "value": 120.0,
          "factor": "systolic_mm_hg_lt_100",
          "points": 0,
          "present": false
        },
        {
          "value": 16,
          "factor": "respiratory_rate_ge_30",
          "points": 0,
          "present": false
        },
        {
          "value": 37.0,
          "factor": "temperature_lt_36",
          "points": 0,
          "present": false
        },
        {
          "factor": "altered_mentation",
          "points": 0,
          "present": false
        },
        {
          "value": 96.0,
          "factor": "spo2_lt_90",
          "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": "Aujesky D, Obrosky DS, Stone RA, et al.",
        "doi": "10.1164/rccm.200506-862OC",
        "id": "aujesky-2005",
        "source": "Am J Respir Crit Care Med. 2005;172(8):1041-1046",
        "title": "Derivation and validation of a prognostic model for pulmonary embolism"
      },
      "formula": "pesi",
      "formula_expression": "PESI = age_in_years + 10*male + 30*cancer + 10*heart_failure + 10*chronic_lung_disease + 20*(HR>=110) + 30*(SBP<100) + 20*(RR>=30) + 20*(temp<36) + 60*altered_mentation + 20*(SpO2<90); classes I <=65, II 66-85, III 86-105, IV 106-125, V >125",
      "score": 50,
      "age_years": 50,
      "pesi_class": "I"
    }
  ]
}

Response

Field Type Description
formula string pesi
formula_expression string Exact expression used
score integer Total points (age in years plus weights)
pesi_class string I if score ≤65; II 66-85; III 86-105; IV 106-125; V if >125
age_years integer Age added as points
components array Per-factor points
citation object Aujesky 2005 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "value": 50,
      "factor": "age",
      "points": 50,
      "present": true
    },
    {
      "value": "female",
      "factor": "male_sex",
      "points": 0,
      "present": false
    },
    {
      "factor": "cancer",
      "points": 0,
      "present": false
    },
    {
      "factor": "heart_failure",
      "points": 0,
      "present": false
    },
    {
      "factor": "chronic_lung_disease",
      "points": 0,
      "present": false
    },
    {
      "value": 80,
      "factor": "heart_rate_ge_110",
      "points": 0,
      "present": false
    },
    {
      "value": 120.0,
      "factor": "systolic_mm_hg_lt_100",
      "points": 0,
      "present": false
    },
    {
      "value": 16,
      "factor": "respiratory_rate_ge_30",
      "points": 0,
      "present": false
    },
    {
      "value": 37.0,
      "factor": "temperature_lt_36",
      "points": 0,
      "present": false
    },
    {
      "factor": "altered_mentation",
      "points": 0,
      "present": false
    },
    {
      "value": 96.0,
      "factor": "spo2_lt_90",
      "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": "Aujesky D, Obrosky DS, Stone RA, et al.",
    "doi": "10.1164/rccm.200506-862OC",
    "id": "aujesky-2005",
    "source": "Am J Respir Crit Care Med. 2005;172(8):1041-1046",
    "title": "Derivation and validation of a prognostic model for pulmonary embolism"
  },
  "formula": "pesi",
  "formula_expression": "PESI = age_in_years + 10*male + 30*cancer + 10*heart_failure + 10*chronic_lung_disease + 20*(HR>=110) + 30*(SBP<100) + 20*(RR>=30) + 20*(temp<36) + 60*altered_mentation + 20*(SpO2<90); classes I <=65, II 66-85, III 86-105, IV 106-125, V >125",
  "score": 50,
  "age_years": 50,
  "pesi_class": "I"
}

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_flag boolean clinical flags must be true or false Returned before settlement; you are not charged.
400 invalid_heart_rate heart_rate_bpm must be an integer from 30 to 220 Returned before settlement; you are not charged.
400 invalid_systolic_bp systolic_mm_hg or systolic_bp_mm_hg must be a number from 50 to 250. Returned before settlement; you are not charged.
400 invalid_respiratory_rate respiratory_rate must be an integer from 4 to 80. Returned before settlement; you are not charged.
400 invalid_temperature temperature_c must be a number from 30.0 to 45.0. Returned before settlement; you are not charged.
400 invalid_spo2 spo2_percent must be a number from 50 to 100. 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

  • sPESI — Compute the Jiménez 2010 simplified Pulmonary Embolism Severity Index (sPESI) from age and five caller-assigned findings.
  • PERC rule — Apply the Kline 2004 eight-factor pulmonary embolism rule-out criteria and return whether all eight are met (PERC-negative).

Payment

Required query parameters must be present and valid. 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

  • Invalid query parameters return HTTP 400 before settlement. You are not charged.
  • Settlement finishes before the tool executes (paymentFlow upfront). 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.