# DAPT score (Yeh 2016)

DAPT score

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

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

## What it computes

Sum the Yeh 2016 DAPT prediction rule after PCI from exclusive age bands and eight caller-assigned flags and return the published high/low band.

## When to use

When an agent needs the published Yeh 2016 DAPT point total after PCI and must not invent a dual antiplatelet duration or ischemia/bleeding percents.

## When not to use

- Not a medical device and not a prescription for dual antiplatelet therapy duration.
- Not a diagnosis. magent does not interpret the angiogram or assign MI, stent, smoking, CHF, or LVEF; every flag is caller-assigned.
- Age bands are mutually exclusive: younger than 65 scores 0; 65 to younger than 75 scores -1; 75 or older scores -2. Age 75 is -2, not -1.
- Score >=2 is the published high band (continued thienopyridine associated with larger ischemic-event reduction); score <2 is low. Does not return ischemia or bleeding percents.

## Formula

```
DAPT = exclusive age (<65: 0, 65 to <75: -1, >=75: -2) + myocardial_infarction_at_presentation 1 + prior_mi_or_pci 1 + diabetes 1 + stent_diameter_lt_3mm 1 + smoking 1 + paclitaxel_eluting_stent 1 + chf_or_lvef_lt_30 2 + vein_graft_intervention 2; max 10; >=2 high, <2 low (Yeh 2016)
```

## Citation

[Development and Validation of a Prediction Rule for Benefit and Harm of Dual Antiplatelet Therapy Beyond 1 Year After Percutaneous Coronary Intervention](https://doi.org/10.1001/jama.2016.3775)
Yeh RW, Secemsky EA, Kereiakes DJ, et al
JAMA. 2016;315(16):1735-1749
DOI: [10.1001/jama.2016.3775](https://doi.org/10.1001/jama.2016.3775)

## Worked example

### Age 60, all flags false

Given: `age=60, chf_or_lvef_lt_30=false, diabetes=false, myocardial_infarction_at_presentation=false, paclitaxel_eluting_stent=false, prior_mi_or_pci=false, smoking=false, stent_diameter_lt_3mm=false, vein_graft_intervention=false`

1. Age 60 is younger than 65 → 0; all flags false → 0
2. Score = 0 (max 10); risk_band low


### Age 60, CHF or LVEF <30%

Given: `age=60, chf_or_lvef_lt_30=true, diabetes=false, myocardial_infarction_at_presentation=false, paclitaxel_eluting_stent=false, prior_mi_or_pci=false, smoking=false, stent_diameter_lt_3mm=false, vein_graft_intervention=false`

1. Age 60 → 0; chf_or_lvef_lt_30 → 2
2. Score = 2 (max 10); risk_band high


## Also searched as

- DAPT score
- Dual antiplatelet therapy score
- Yeh DAPT
- DAPT prediction rule
- Yeh 2016 DAPT
- prolonged DAPT score
- DAPT after PCI

## Parameters

- `age` (integer, required): Age in years (18-120). Yeh 2016 exclusive bands: younger than 65 scores 0; 65 to younger than 75 scores -1; 75 or older scores -2. Age 75 is -2, not -1.
- `myocardial_infarction_at_presentation` (boolean, required): Myocardial infarction at presentation as assigned by the caller (Yeh 2016). true scores 1. magent does not diagnose MI.
- `prior_mi_or_pci` (boolean, required): Prior myocardial infarction or prior PCI as assigned by the caller (Yeh 2016). true scores 1.
- `diabetes` (boolean, required): Diabetes mellitus as assigned by the caller (Yeh 2016). true scores 1.
- `stent_diameter_lt_3mm` (boolean, required): Stent diameter <3 mm as assigned by the caller (Yeh 2016). true scores 1. magent does not measure the stent.
- `smoking` (boolean, required): Current cigarette smoking or smoking within the past year as assigned by the caller (Yeh 2016). true scores 1.
- `paclitaxel_eluting_stent` (boolean, required): Paclitaxel-eluting stent as assigned by the caller (Yeh 2016). true scores 1.
- `chf_or_lvef_lt_30` (boolean, required): Congestive heart failure or LVEF <30% as assigned by the caller (Yeh 2016). true scores 2. magent does not measure LVEF.
- `vein_graft_intervention` (boolean, required): Vein-graft PCI as assigned by the caller (Yeh 2016). true scores 2. magent does not interpret the angiogram.

## 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/dapt`
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": [
    {
      "age": "60",
      "chf_or_lvef_lt_30": "false",
      "diabetes": "false",
      "myocardial_infarction_at_presentation": "false",
      "paclitaxel_eluting_stent": "false",
      "prior_mi_or_pci": "false",
      "smoking": "false",
      "stent_diameter_lt_3mm": "false",
      "vein_graft_intervention": "false"
    },
    {
      "age": "60",
      "chf_or_lvef_lt_30": "false",
      "diabetes": "false",
      "myocardial_infarction_at_presentation": "false",
      "paclitaxel_eluting_stent": "false",
      "prior_mi_or_pci": "false",
      "smoking": "false",
      "stent_diameter_lt_3mm": "false",
      "vein_graft_intervention": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/dapt",
  "items": [
    {
      "components": [
        {
          "value": 60,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "myocardial_infarction_at_presentation",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_mi_or_pci",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "stent_diameter_lt_3mm",
          "points": 0,
          "present": false
        },
        {
          "factor": "smoking",
          "points": 0,
          "present": false
        },
        {
          "factor": "paclitaxel_eluting_stent",
          "points": 0,
          "present": false
        },
        {
          "factor": "chf_or_lvef_lt_30",
          "points": 0,
          "present": false
        },
        {
          "factor": "vein_graft_intervention",
          "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": "Yeh RW, Secemsky EA, Kereiakes DJ, et al",
        "doi": "10.1001/jama.2016.3775",
        "id": "yeh-2016",
        "pmid": "27022822",
        "source": "JAMA. 2016;315(16):1735-1749",
        "title": "Development and Validation of a Prediction Rule for Benefit and Harm of Dual Antiplatelet Therapy Beyond 1 Year After Percutaneous Coronary Intervention"
      },
      "formula": "dapt",
      "formula_expression": "DAPT = exclusive age (<65: 0, 65 to <75: -1, >=75: -2) + myocardial_infarction_at_presentation 1 + prior_mi_or_pci 1 + diabetes 1 + stent_diameter_lt_3mm 1 + smoking 1 + paclitaxel_eluting_stent 1 + chf_or_lvef_lt_30 2 + vein_graft_intervention 2; max 10; >=2 high, <2 low (Yeh 2016)",
      "age_years": 60,
      "max_score": 10,
      "score": 0,
      "risk_band": "low"
    },
    {
      "components": [
        {
          "value": 60,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "myocardial_infarction_at_presentation",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_mi_or_pci",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "stent_diameter_lt_3mm",
          "points": 0,
          "present": false
        },
        {
          "factor": "smoking",
          "points": 0,
          "present": false
        },
        {
          "factor": "paclitaxel_eluting_stent",
          "points": 0,
          "present": false
        },
        {
          "factor": "chf_or_lvef_lt_30",
          "points": 0,
          "present": false
        },
        {
          "factor": "vein_graft_intervention",
          "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": "Yeh RW, Secemsky EA, Kereiakes DJ, et al",
        "doi": "10.1001/jama.2016.3775",
        "id": "yeh-2016",
        "pmid": "27022822",
        "source": "JAMA. 2016;315(16):1735-1749",
        "title": "Development and Validation of a Prediction Rule for Benefit and Harm of Dual Antiplatelet Therapy Beyond 1 Year After Percutaneous Coronary Intervention"
      },
      "formula": "dapt",
      "formula_expression": "DAPT = exclusive age (<65: 0, 65 to <75: -1, >=75: -2) + myocardial_infarction_at_presentation 1 + prior_mi_or_pci 1 + diabetes 1 + stent_diameter_lt_3mm 1 + smoking 1 + paclitaxel_eluting_stent 1 + chf_or_lvef_lt_30 2 + vein_graft_intervention 2; max 10; >=2 high, <2 low (Yeh 2016)",
      "age_years": 60,
      "max_score": 10,
      "score": 0,
      "risk_band": "low"
    }
  ]
}
```

## Response fields

- `formula` (string): dapt
- `formula_expression` (string): Exact expression used
- `score` (integer): Yeh 2016 DAPT points -2 to 10
- `max_score` (integer): 10
- `risk_band` (string): Yeh 2016 band: high if score >=2 (continued thienopyridine associated with larger ischemic-event reduction); low if score <2. A band, not a duration order or diagnosis.
- `age_years` (integer): Age used for the exclusive age band
- `components` (array): Per-factor points
- `citation` (object): Yeh et al. JAMA 2016 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 60,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "factor": "myocardial_infarction_at_presentation",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_mi_or_pci",
      "points": 0,
      "present": false
    },
    {
      "factor": "diabetes",
      "points": 0,
      "present": false
    },
    {
      "factor": "stent_diameter_lt_3mm",
      "points": 0,
      "present": false
    },
    {
      "factor": "smoking",
      "points": 0,
      "present": false
    },
    {
      "factor": "paclitaxel_eluting_stent",
      "points": 0,
      "present": false
    },
    {
      "factor": "chf_or_lvef_lt_30",
      "points": 0,
      "present": false
    },
    {
      "factor": "vein_graft_intervention",
      "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": "Yeh RW, Secemsky EA, Kereiakes DJ, et al",
    "doi": "10.1001/jama.2016.3775",
    "id": "yeh-2016",
    "pmid": "27022822",
    "source": "JAMA. 2016;315(16):1735-1749",
    "title": "Development and Validation of a Prediction Rule for Benefit and Harm of Dual Antiplatelet Therapy Beyond 1 Year After Percutaneous Coronary Intervention"
  },
  "formula": "dapt",
  "formula_expression": "DAPT = exclusive age (<65: 0, 65 to <75: -1, >=75: -2) + myocardial_infarction_at_presentation 1 + prior_mi_or_pci 1 + diabetes 1 + stent_diameter_lt_3mm 1 + smoking 1 + paclitaxel_eluting_stent 1 + chf_or_lvef_lt_30 2 + vein_graft_intervention 2; max 10; >=2 high, <2 low (Yeh 2016)",
  "age_years": 60,
  "max_score": 10,
  "score": 0,
  "risk_band": "low"
}
```

## 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_dapt`: each DAPT 2016 item must be a published value for that field. 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

- [CRUSADE bleeding score](https://magentlab.com/docs/crusade) — Compute the CRUSADE in-hospital major bleeding score from hematocrit, caller-assigned Cockcroft–Gault creatinine clearance, heart rate, sex, signs of CHF, prior vascular disease, diabetes, and systolic BP (Subherwal 2009 Table 4).

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