# PASCAL classification

PASCAL

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

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

## What it computes

Apply the Kent 2021 PASCAL classification (Table 1) from a caller-assigned RoPE total and large-shunt plus atrial-septal-aneurysm flags, and return probable, possible, or unlikely PFO-related stroke likelihood.

## When to use

When an agent already has a caller-assigned RoPE total (0-10) and caller-assigned large-shunt and ASA flags after cryptogenic stroke with PFO, and must not invent a closure order, recompute RoPE, or apply ESUS.

## When not to use

- Not a medical device. Not a PFO diagnosis and not a closure or device-indication order.
- rope_score is the caller-assigned Kent 2013 RoPE total (0-10). magent does not recompute RoPE; use the related rope tool for that index.
- large_shunt and atrial_septal_aneurysm are caller-assigned. magent does not read echocardiography and does not echo those flags.
- This is Kent 2021 PASCAL, not RoPE itself and not the Hart 2014 ESUS construct.
- Pooled-trial ages were 18-60 years. That eligibility is a limitation, not an HTTP 400; RoPE already encodes age.

## Formula

```
high_rope iff rope_score >= 7; high_risk_pfo iff large_shunt or atrial_septal_aneurysm; probable iff both; possible iff exactly one; unlikely iff neither (Kent 2021 Table 1 PASCAL). magent does not recompute RoPE
```

## Citation

[Heterogeneity of Treatment Effects in an Analysis of Pooled Individual Patient Data From Randomized Trials of Device Closure of Patent Foramen Ovale After Stroke](https://doi.org/10.1001/jama.2021.20956)
Kent DM, Saver JL, Kasner SE, Nelson J, Carroll JD, Chatellier G, Derumeaux G, Furlan AJ, Herrmann HC, Jüni P, Kim JS, Koethe B, Lee PH, Lefebvre B, Mattle HP, Meier B, Reisman M, Smalling RW, Soendergaard L, Song JK, Mas JL, Thaler DE
JAMA. 2021;326(22):2277-2286
DOI: [10.1001/jama.2021.20956](https://doi.org/10.1001/jama.2021.20956)

## Worked example

### RoPE 8 with large shunt

Given: `atrial_septal_aneurysm=false, large_shunt=true, rope_score=8`

1. rope_score 8 is >= 7 → high_rope true
2. large_shunt true and atrial_septal_aneurysm false → high_risk_pfo true
3. both true → pascal_class probable


### RoPE 7 with ASA, no large shunt

Given: `atrial_septal_aneurysm=true, large_shunt=false, rope_score=7`

1. rope_score 7 is >= 7 → high_rope true (Table 1 uses ≥7, not >7)
2. atrial_septal_aneurysm true → high_risk_pfo true
3. pascal_class probable


### High RoPE without a high-risk PFO feature

Given: `atrial_septal_aneurysm=false, large_shunt=false, rope_score=8`

1. rope_score 8 is >= 7 → high_rope true
2. neither large_shunt nor ASA → high_risk_pfo false
3. exactly one → pascal_class possible


## Also searched as

- PASCAL classification
- PFO-Associated Stroke Causal Likelihood
- Kent PASCAL
- high-risk PFO
- RoPE score PASCAL
- patent foramen ovale causal likelihood
- Kent 2021 PASCAL
- large shunt ASA PFO
- PFO-related stroke likelihood

## Parameters

- `rope_score` (integer, required): Caller-assigned RoPE total integer 0-10 (Kent 2013 components already summed; related tool rope). magent does not recompute RoPE. high_rope is true when rope_score is 7 or greater (Kent 2021 Table 1 / NCBI reprint; not greater-than-7 only).
- `large_shunt` (boolean, required): Large-sized shunt as assigned by the caller (Kent 2021 Table 1 high-risk PFO feature). true or false. high_risk_pfo is true if this flag or atrial_septal_aneurysm is true. magent does not echo this flag and does not read echocardiography.
- `atrial_septal_aneurysm` (boolean, required): Atrial septal aneurysm (ASA) as assigned by the caller (Kent 2021 Table 1 high-risk PFO feature). true or false. high_risk_pfo is true if this flag or large_shunt is true. magent does not echo this flag and does not read echocardiography.

## 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/pascal`
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": [
    {
      "atrial_septal_aneurysm": "false",
      "large_shunt": "true",
      "rope_score": "8"
    },
    {
      "atrial_septal_aneurysm": "false",
      "large_shunt": "true",
      "rope_score": "8"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/pascal",
  "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": "Kent DM, Saver JL, Kasner SE, Nelson J, Carroll JD, Chatellier G, Derumeaux G, Furlan AJ, Herrmann HC, Jüni P, Kim JS, Koethe B, Lee PH, Lefebvre B, Mattle HP, Meier B, Reisman M, Smalling RW, Soendergaard L, Song JK, Mas JL, Thaler DE",
        "doi": "10.1001/jama.2021.20956",
        "id": "kent-2021",
        "pmid": "34905030",
        "source": "JAMA. 2021;326(22):2277-2286",
        "title": "Heterogeneity of Treatment Effects in an Analysis of Pooled Individual Patient Data From Randomized Trials of Device Closure of Patent Foramen Ovale After Stroke"
      },
      "formula": "pascal",
      "formula_expression": "high_rope iff rope_score >= 7; high_risk_pfo iff large_shunt or atrial_septal_aneurysm; probable iff both; possible iff exactly one; unlikely iff neither (Kent 2021 Table 1 PASCAL). magent does not recompute RoPE",
      "criteria": [
        {
          "value": 8,
          "factor": "high_rope",
          "met": true
        },
        {
          "factor": "high_risk_pfo",
          "met": true
        }
      ],
      "high_risk_pfo": true,
      "high_rope": true,
      "pascal_class": "probable",
      "rope_score": 8
    },
    {
      "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": "Kent DM, Saver JL, Kasner SE, Nelson J, Carroll JD, Chatellier G, Derumeaux G, Furlan AJ, Herrmann HC, Jüni P, Kim JS, Koethe B, Lee PH, Lefebvre B, Mattle HP, Meier B, Reisman M, Smalling RW, Soendergaard L, Song JK, Mas JL, Thaler DE",
        "doi": "10.1001/jama.2021.20956",
        "id": "kent-2021",
        "pmid": "34905030",
        "source": "JAMA. 2021;326(22):2277-2286",
        "title": "Heterogeneity of Treatment Effects in an Analysis of Pooled Individual Patient Data From Randomized Trials of Device Closure of Patent Foramen Ovale After Stroke"
      },
      "formula": "pascal",
      "formula_expression": "high_rope iff rope_score >= 7; high_risk_pfo iff large_shunt or atrial_septal_aneurysm; probable iff both; possible iff exactly one; unlikely iff neither (Kent 2021 Table 1 PASCAL). magent does not recompute RoPE",
      "criteria": [
        {
          "value": 8,
          "factor": "high_rope",
          "met": true
        },
        {
          "factor": "high_risk_pfo",
          "met": true
        }
      ],
      "high_risk_pfo": true,
      "high_rope": true,
      "pascal_class": "probable",
      "rope_score": 8
    }
  ]
}
```

## Response fields

- `formula` (string): pascal
- `formula_expression` (string): Kent 2021 Table 1 PASCAL classification
- `pascal_class` (string): probable if high_rope and high_risk_pfo; possible if exactly one; unlikely if neither. Not a closure order.
- `high_rope` (boolean): true when the caller-assigned rope_score is 7 or greater (not greater-than-7 only)
- `high_risk_pfo` (boolean): true when large_shunt or atrial_septal_aneurysm is true (large-sized shunt and/or ASA). Input flags are not echoed.
- `rope_score` (integer): Echo of the caller-assigned RoPE total 0-10. Not a RoPE recomputation.
- `criteria` (array): Rows for high_rope (with rope_score value) and high_risk_pfo with factor and met
- `citation` (object): Kent 2021 JAMA 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": "Kent DM, Saver JL, Kasner SE, Nelson J, Carroll JD, Chatellier G, Derumeaux G, Furlan AJ, Herrmann HC, Jüni P, Kim JS, Koethe B, Lee PH, Lefebvre B, Mattle HP, Meier B, Reisman M, Smalling RW, Soendergaard L, Song JK, Mas JL, Thaler DE",
    "doi": "10.1001/jama.2021.20956",
    "id": "kent-2021",
    "pmid": "34905030",
    "source": "JAMA. 2021;326(22):2277-2286",
    "title": "Heterogeneity of Treatment Effects in an Analysis of Pooled Individual Patient Data From Randomized Trials of Device Closure of Patent Foramen Ovale After Stroke"
  },
  "formula": "pascal",
  "formula_expression": "high_rope iff rope_score >= 7; high_risk_pfo iff large_shunt or atrial_septal_aneurysm; probable iff both; possible iff exactly one; unlikely iff neither (Kent 2021 Table 1 PASCAL). magent does not recompute RoPE",
  "criteria": [
    {
      "value": 8,
      "factor": "high_rope",
      "met": true
    },
    {
      "factor": "high_risk_pfo",
      "met": true
    }
  ],
  "high_risk_pfo": true,
  "high_rope": true,
  "pascal_class": "probable",
  "rope_score": 8
}
```

## Errors

- HTTP 400 `invalid_pascal`: rope_score must be an integer from 0 to 10 (Kent 2021 PASCAL; magent does not recompute RoPE). 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_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

- [ROPE](https://magentlab.com/docs/rope) — Compute the Kent 2013 Risk of Paradoxical Embolism (ROPE) index from Table 4 age decades and five caller-assigned vascular and infarct flags.
- [ESUS](https://magentlab.com/docs/esus) — Apply the Hart 2014 ESUS construct (Panel 2 criteria plus Panel 3 minimum diagnostic assessment) and return whether caller-assigned flags meet embolic stroke of undetermined source.
- [ABCD2 score](https://magentlab.com/docs/abcd2) — Compute the ABCD2 score as age, blood pressure, caller-assigned clinical features, symptom duration, and diabetes.

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