# Revised Geneva score

Revised Geneva score

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/revised_geneva`
HTML: https://magentlab.com/docs/revised-geneva
Markdown: https://magentlab.com/docs/revised-geneva.md

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

## What it computes

Compute the Le Gal 2006 revised Geneva score for suspected pulmonary embolism in the emergency department from age, heart rate, and six caller-assigned findings.

## When to use

When an agent needs the published original revised Geneva arithmetic (not simplified Geneva, not Wells) from caller-assigned findings.

## When not to use

- Not a diagnosis of pulmonary embolism. magent does not diagnose PE.
- This tool is the original revised Geneva score (Le Gal 2006), not simplified Geneva (Klok 2008) and not Wells.
- Age 65 does not score; only age older than 65 years scores 1.
- Pain on deep-vein palpation and unilateral edema is a single AND item (4 points), not two separate findings.
- Heart rate 75-94 scores 3; 95 or higher scores 5; never both. The caller assigns findings; magent does not examine the patient.

## Formula

```
revised Geneva = age>65 (1) + previous_dvt_or_pe (3) + surgery_or_fracture_within_1_month (2) + active_malignancy (2) + unilateral_lower_limb_pain (3) + hemoptysis (2) + heart_rate_75_94 (3) or heart_rate_ge_95 (5) + pain_on_deep_vein_palpation_and_unilateral_edema (4); max 22; bands 0-3, 4-10, 11-22
```

## Citation

[Prediction of pulmonary embolism in the emergency department: the revised Geneva score](https://doi.org/10.7326/0003-4819-144-3-200602070-00004)
Le Gal G, Righini M, Roy PM, et al.
Ann Intern Med. 2006;144(3):165-171
DOI: [10.7326/0003-4819-144-3-200602070-00004](https://doi.org/10.7326/0003-4819-144-3-200602070-00004)

## Worked example

### All items absent

Given: `active_malignancy=false, age=50, heart_rate_bpm=70, hemoptysis=false, pain_on_deep_vein_palpation_and_unilateral_edema=false, previous_dvt_or_pe=false, surgery_or_fracture_within_1_month=false, unilateral_lower_limb_pain=false`

1. Age 50 is not >65 → 0; all flags false → 0; heart rate 70 is ≤74 → 0
2. Score = 0 (max 22); geneva_band 0-3


### Heart rate 95 scores 5 (band 4-10)

Given: `active_malignancy=false, age=50, heart_rate_bpm=95, hemoptysis=false, pain_on_deep_vein_palpation_and_unilateral_edema=false, previous_dvt_or_pe=false, surgery_or_fracture_within_1_month=false, unilateral_lower_limb_pain=false`

1. Heart rate 95 ≥ 95 → 5; remaining items absent
2. Score = 5 (max 22); geneva_band 4-10


## Also searched as

- revised Geneva score
- Le Gal revised Geneva
- revised Geneva PE score
- Geneva pulmonary embolism score
- rGeneva score
- Le Gal 2006 Geneva

## Parameters

- `age` (integer, required): Age in years (18-120). Scores 1 when age >65; 65 does not score.
- `previous_dvt_or_pe` (boolean, required): Previous DVT or PE as assigned by the caller. true or false. 3 points if true.
- `surgery_or_fracture_within_1_month` (boolean, required): Surgery under general anesthesia or lower-limb fracture within 1 month (one combined flag). true or false. 2 points if true.
- `active_malignancy` (boolean, required): Solid or hematologic malignancy currently active or considered cured <1 year (caller-applied). true or false. 2 points if true.
- `unilateral_lower_limb_pain` (boolean, required): Unilateral lower-limb pain. true or false. 3 points if true.
- `hemoptysis` (boolean, required): Hemoptysis. true or false. 2 points if true.
- `heart_rate_bpm` (integer, required): Heart rate in beats per minute (integer 30-220). Scores 3 when 75-94 inclusive, 5 when ≥95, and 0 when ≤74. Never both 3 and 5.
- `pain_on_deep_vein_palpation_and_unilateral_edema` (boolean, required): Pain on deep-vein palpation AND unilateral edema as one combined flag. true or false. 4 points if true.

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

Method: `POST /api/calc/revised_geneva`
Max items: 25
Price: unit_amount * n (unit 5000 atomic)
Status: 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:

```json
{
  "items": [
    {
      "active_malignancy": "false",
      "age": "50",
      "heart_rate_bpm": "70",
      "hemoptysis": "false",
      "pain_on_deep_vein_palpation_and_unilateral_edema": "false",
      "previous_dvt_or_pe": "false",
      "surgery_or_fracture_within_1_month": "false",
      "unilateral_lower_limb_pain": "false"
    },
    {
      "active_malignancy": "false",
      "age": "50",
      "heart_rate_bpm": "70",
      "hemoptysis": "false",
      "pain_on_deep_vein_palpation_and_unilateral_edema": "false",
      "previous_dvt_or_pe": "false",
      "surgery_or_fracture_within_1_month": "false",
      "unilateral_lower_limb_pain": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/revised_geneva",
  "items": [
    {
      "components": [
        {
          "value": 50,
          "factor": "age_gt_65",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_dvt_or_pe",
          "points": 0,
          "present": false
        },
        {
          "factor": "surgery_or_fracture_within_1_month",
          "points": 0,
          "present": false
        },
        {
          "factor": "active_malignancy",
          "points": 0,
          "present": false
        },
        {
          "factor": "unilateral_lower_limb_pain",
          "points": 0,
          "present": false
        },
        {
          "factor": "hemoptysis",
          "points": 0,
          "present": false
        },
        {
          "value": 70,
          "factor": "heart_rate_75_94",
          "points": 0,
          "present": false
        },
        {
          "value": 70,
          "factor": "heart_rate_ge_95",
          "points": 0,
          "present": false
        },
        {
          "factor": "pain_on_deep_vein_palpation_and_unilateral_edema",
          "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": "Le Gal G, Righini M, Roy PM, et al.",
        "doi": "10.7326/0003-4819-144-3-200602070-00004",
        "id": "le-gal-2006",
        "source": "Ann Intern Med. 2006;144(3):165-171",
        "title": "Prediction of pulmonary embolism in the emergency department: the revised Geneva score"
      },
      "formula": "revised_geneva",
      "formula_expression": "revised Geneva = age>65 (1) + previous_dvt_or_pe (3) + surgery_or_fracture_within_1_month (2) + active_malignancy (2) + unilateral_lower_limb_pain (3) + hemoptysis (2) + heart_rate_75_94 (3) or heart_rate_ge_95 (5) + pain_on_deep_vein_palpation_and_unilateral_edema (4); max 22; bands 0-3, 4-10, 11-22",
      "max_score": 22,
      "score": 0,
      "age_years": 50,
      "heart_rate_bpm": 70,
      "geneva_band": "0-3"
    },
    {
      "components": [
        {
          "value": 50,
          "factor": "age_gt_65",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_dvt_or_pe",
          "points": 0,
          "present": false
        },
        {
          "factor": "surgery_or_fracture_within_1_month",
          "points": 0,
          "present": false
        },
        {
          "factor": "active_malignancy",
          "points": 0,
          "present": false
        },
        {
          "factor": "unilateral_lower_limb_pain",
          "points": 0,
          "present": false
        },
        {
          "factor": "hemoptysis",
          "points": 0,
          "present": false
        },
        {
          "value": 70,
          "factor": "heart_rate_75_94",
          "points": 0,
          "present": false
        },
        {
          "value": 70,
          "factor": "heart_rate_ge_95",
          "points": 0,
          "present": false
        },
        {
          "factor": "pain_on_deep_vein_palpation_and_unilateral_edema",
          "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": "Le Gal G, Righini M, Roy PM, et al.",
        "doi": "10.7326/0003-4819-144-3-200602070-00004",
        "id": "le-gal-2006",
        "source": "Ann Intern Med. 2006;144(3):165-171",
        "title": "Prediction of pulmonary embolism in the emergency department: the revised Geneva score"
      },
      "formula": "revised_geneva",
      "formula_expression": "revised Geneva = age>65 (1) + previous_dvt_or_pe (3) + surgery_or_fracture_within_1_month (2) + active_malignancy (2) + unilateral_lower_limb_pain (3) + hemoptysis (2) + heart_rate_75_94 (3) or heart_rate_ge_95 (5) + pain_on_deep_vein_palpation_and_unilateral_edema (4); max 22; bands 0-3, 4-10, 11-22",
      "max_score": 22,
      "score": 0,
      "age_years": 50,
      "heart_rate_bpm": 70,
      "geneva_band": "0-3"
    }
  ]
}
```

## Response fields

- `formula` (string): revised_geneva
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points 0-22
- `max_score` (integer): Always 22
- `geneva_band` (string): 0-3, 4-10, or 11-22. Not a diagnosis.
- `age_years` (integer): Age used for the >65 criterion
- `heart_rate_bpm` (integer): Heart rate used for the 75-94 / ≥95 bands
- `components` (array): Per-item points
- `citation` (object): Le Gal 2006 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 50,
      "factor": "age_gt_65",
      "points": 0,
      "present": false
    },
    {
      "factor": "previous_dvt_or_pe",
      "points": 0,
      "present": false
    },
    {
      "factor": "surgery_or_fracture_within_1_month",
      "points": 0,
      "present": false
    },
    {
      "factor": "active_malignancy",
      "points": 0,
      "present": false
    },
    {
      "factor": "unilateral_lower_limb_pain",
      "points": 0,
      "present": false
    },
    {
      "factor": "hemoptysis",
      "points": 0,
      "present": false
    },
    {
      "value": 70,
      "factor": "heart_rate_75_94",
      "points": 0,
      "present": false
    },
    {
      "value": 70,
      "factor": "heart_rate_ge_95",
      "points": 0,
      "present": false
    },
    {
      "factor": "pain_on_deep_vein_palpation_and_unilateral_edema",
      "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": "Le Gal G, Righini M, Roy PM, et al.",
    "doi": "10.7326/0003-4819-144-3-200602070-00004",
    "id": "le-gal-2006",
    "source": "Ann Intern Med. 2006;144(3):165-171",
    "title": "Prediction of pulmonary embolism in the emergency department: the revised Geneva score"
  },
  "formula": "revised_geneva",
  "formula_expression": "revised Geneva = age>65 (1) + previous_dvt_or_pe (3) + surgery_or_fracture_within_1_month (2) + active_malignancy (2) + unilateral_lower_limb_pain (3) + hemoptysis (2) + heart_rate_75_94 (3) or heart_rate_ge_95 (5) + pain_on_deep_vein_palpation_and_unilateral_edema (4); max 22; bands 0-3, 4-10, 11-22",
  "max_score": 22,
  "score": 0,
  "age_years": 50,
  "heart_rate_bpm": 70,
  "geneva_band": "0-3"
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_heart_rate`: heart_rate_bpm must be an integer from 30 to 220 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

- [Wells PE](https://magentlab.com/docs/wells-pe) — Compute the Wells pulmonary-embolism probability score and return three-tier and two-tier bands.
- [PERC rule](https://magentlab.com/docs/perc) — 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.

- 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 EIP-3009 (scheme exact, assetTransferMethod eip3009) with validBefore = now + accepts[0].maxTimeoutSeconds (600 seconds). That window starts when you sign and must cover wallet confirmation plus CDP verify and settle. Magent retries transient facilitator 429/5xx before answering. Do not send upto or batch-settlement payloads; magent does not offer those schemes.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON echoing accepted, payload, and extensions when present).
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. Settlement happens before the tool runs. HTTP 503 settlement_uncertain or settle_failed: retry the same PAYMENT-SIGNATURE. Mint a new 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.

- 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.
- not offered `batch-settlement`: Not offered. Payment-channel vouchers claimed later in batches. Not the same as POST {items} bulk (that is still exact).

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for n times the GET unit. 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

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