# DOAC Score (Aggarwal)

DOAC Score

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

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

## What it computes

Compute the Aggarwal 2023 DOAC Score from age, CrCl or eGFR, and caller-assigned Table 2 flags for patients with atrial fibrillation on a DOAC.

## When to use

When an agent needs the published Circulation Table 2 DOAC Score arithmetic for AF on DOACs and must not invent HAS-BLED, a DOAC dose, or a warfarin score.

## When not to use

- Not a medical device. Not a diagnosis. Not a treatment or anticoagulation recommendation.
- Not HAS-BLED. Not a DOAC dosing tool. Not for warfarin.
- Intended primarily for atrial fibrillation on DOACs. Derivation was RE-LY (dabigatran 150 mg twice daily). Age <65 scores 0 and is not rejected.
- Circulation Table 2 is the score card: CrCl/eGFR 30-60 inclusive scores 1 and <30 scores 2 (not the body-text 30-59 / ≤30 wording).
- magent does not compute BMI. underweight is the caller-assigned Table 2 BMI <18.5 kg/m² flag.
- liver_disease is caller-assigned. Table 2 footnote: AST, ALT, or ALP ≥3× ULN, ALP ≥2× ULN, or cirrhosis. magent does not assay labs or assign Child-Pugh.

## Formula

```
DOAC Score (Aggarwal 2023 Circulation Table 2) = age (65-69 2, 70-74 3, 75-79 4, >=80 5; <65 0) + crcl_or_egfr_ml_min (30-60 inclusive 1, <30 2, >60 0) + underweight 1 + stroke_tia_embolism_history 1 + diabetes 1 + hypertension 1 + antiplatelet (none 0, aspirin 2, dual 3) + nsaid_use 1 + bleeding_history 3 + liver_disease 2; score = min(raw_sum, 10); bands 0-3 very_low, 4-5 low, 6-7 moderate, 8-9 high, 10 very_high; not HAS-BLED; not DOAC dosing; not warfarin
```

## Citation

[Development and Validation of the DOAC Score: A Novel Bleeding Risk Prediction Tool for Patients With Atrial Fibrillation on Direct-Acting Oral Anticoagulants](https://doi.org/10.1161/CIRCULATIONAHA.123.064556)
Aggarwal R, Ruff CT, Virdone S, Perreault S, Kakkar AK, Palazzolo MG, Dorais M, Kayani G, Singer DE, Secemsky E, Piccini J, Tahir UA, Shen C, Yeh RW
Circulation. 2023;148(12):936-946
DOI: [10.1161/CIRCULATIONAHA.123.064556](https://doi.org/10.1161/CIRCULATIONAHA.123.064556)

## Worked example

### Age 65, CrCl 70, no other factors

Given: `age=65, antiplatelet=none, bleeding_history=false, crcl_or_egfr_ml_min=70, diabetes=false, hypertension=false, liver_disease=false, nsaid_use=false, stroke_tia_embolism_history=false, underweight=false`

1. Age 65-69 → 2; CrCl 70 >60 → 0; underweight, stroke/TIA/embolism, diabetes, hypertension, NSAID, bleeding, and liver false; antiplatelet none → 0
2. raw_sum = 2; score = min(2, 10) = 2; band very_low


### Age 70 plus dual antiplatelet is moderate

Given: `age=70, antiplatelet=dual, bleeding_history=false, crcl_or_egfr_ml_min=70, diabetes=false, hypertension=false, liver_disease=false, nsaid_use=false, stroke_tia_embolism_history=false, underweight=false`

1. Age 70-74 → 3; dual antiplatelet → 3
2. raw_sum = 6; score = 6; band moderate


## Also searched as

- DOAC Score
- Aggarwal DOAC Score
- DOAC bleeding score
- AF DOAC bleed
- direct oral anticoagulant score

## Parameters

- `age` (integer, required): Age in years (18-120). Table 2: 65-69 scores 2; 70-74 scores 3; 75-79 scores 4; ≥80 scores 5; age <65 scores 0 and is accepted.
- `crcl_or_egfr_ml_min` (number, required): Creatinine clearance or eGFR in mL/min (5-200). Table 2: 30-60 inclusive scores 1; <30 scores 2; >60 scores 0. Exactly 30 and exactly 60 score 1.
- `underweight` (boolean, required): Caller-assigned BMI <18.5 kg/m² (Table 2 underweight). true or false. Scores 1. magent does not compute BMI.
- `stroke_tia_embolism_history` (boolean, required): History of stroke, TIA, or embolism as assigned by the caller. true or false. Scores 1.
- `diabetes` (boolean, required): Diabetes as assigned by the caller. true or false. Scores 1.
- `hypertension` (boolean, required): Hypertension as assigned by the caller. true or false. Scores 1.
- `antiplatelet` (string, required): Antiplatelet use: none (0), aspirin (2), or dual (aspirin + P2Y12; 3). Table 2.
- `nsaid_use` (boolean, required): NSAID use as assigned by the caller. true or false. Scores 1.
- `bleeding_history` (boolean, required): Bleeding history as assigned by the caller. true or false. Scores 3.
- `liver_disease` (boolean, required): Liver disease as assigned by the caller (Table 2 footnote: AST, ALT, or ALP ≥3× ULN, ALP ≥2× ULN, or cirrhosis). true or false. Scores 2. magent does not assay labs or assign Child-Pugh.

## 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/doac_score`
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": "65",
      "antiplatelet": "none",
      "bleeding_history": "false",
      "crcl_or_egfr_ml_min": "70",
      "diabetes": "false",
      "hypertension": "false",
      "liver_disease": "false",
      "nsaid_use": "false",
      "stroke_tia_embolism_history": "false",
      "underweight": "false"
    },
    {
      "age": "65",
      "antiplatelet": "none",
      "bleeding_history": "false",
      "crcl_or_egfr_ml_min": "70",
      "diabetes": "false",
      "hypertension": "false",
      "liver_disease": "false",
      "nsaid_use": "false",
      "stroke_tia_embolism_history": "false",
      "underweight": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/doac_score",
  "items": [
    {
      "band": "very_low",
      "components": [
        {
          "value": 65,
          "factor": "age",
          "points": 2,
          "present": true
        },
        {
          "value": 70.0,
          "factor": "crcl_or_egfr",
          "points": 0,
          "present": false
        },
        {
          "factor": "underweight",
          "points": 0,
          "present": false
        },
        {
          "factor": "stroke_tia_embolism_history",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypertension",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "antiplatelet",
          "points": 0,
          "present": false
        },
        {
          "factor": "nsaid_use",
          "points": 0,
          "present": false
        },
        {
          "factor": "bleeding_history",
          "points": 0,
          "present": false
        },
        {
          "factor": "liver_disease",
          "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": "Aggarwal R, Ruff CT, Virdone S, Perreault S, Kakkar AK, Palazzolo MG, Dorais M, Kayani G, Singer DE, Secemsky E, Piccini J, Tahir UA, Shen C, Yeh RW",
        "doi": "10.1161/CIRCULATIONAHA.123.064556",
        "id": "aggarwal-2023",
        "pmid": "37621213",
        "source": "Circulation. 2023;148(12):936-946",
        "title": "Development and Validation of the DOAC Score: A Novel Bleeding Risk Prediction Tool for Patients With Atrial Fibrillation on Direct-Acting Oral Anticoagulants"
      },
      "formula": "doac_score",
      "formula_expression": "DOAC Score (Aggarwal 2023 Circulation Table 2) = age (65-69 2, 70-74 3, 75-79 4, >=80 5; <65 0) + crcl_or_egfr_ml_min (30-60 inclusive 1, <30 2, >60 0) + underweight 1 + stroke_tia_embolism_history 1 + diabetes 1 + hypertension 1 + antiplatelet (none 0, aspirin 2, dual 3) + nsaid_use 1 + bleeding_history 3 + liver_disease 2; score = min(raw_sum, 10); bands 0-3 very_low, 4-5 low, 6-7 moderate, 8-9 high, 10 very_high; not HAS-BLED; not DOAC dosing; not warfarin",
      "age_years": 65,
      "max_score": 10,
      "score": 2,
      "antiplatelet": "none",
      "crcl_or_egfr_ml_min": 70.0,
      "uncapped_sum": 2
    },
    {
      "band": "very_low",
      "components": [
        {
          "value": 65,
          "factor": "age",
          "points": 2,
          "present": true
        },
        {
          "value": 70.0,
          "factor": "crcl_or_egfr",
          "points": 0,
          "present": false
        },
        {
          "factor": "underweight",
          "points": 0,
          "present": false
        },
        {
          "factor": "stroke_tia_embolism_history",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypertension",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "antiplatelet",
          "points": 0,
          "present": false
        },
        {
          "factor": "nsaid_use",
          "points": 0,
          "present": false
        },
        {
          "factor": "bleeding_history",
          "points": 0,
          "present": false
        },
        {
          "factor": "liver_disease",
          "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": "Aggarwal R, Ruff CT, Virdone S, Perreault S, Kakkar AK, Palazzolo MG, Dorais M, Kayani G, Singer DE, Secemsky E, Piccini J, Tahir UA, Shen C, Yeh RW",
        "doi": "10.1161/CIRCULATIONAHA.123.064556",
        "id": "aggarwal-2023",
        "pmid": "37621213",
        "source": "Circulation. 2023;148(12):936-946",
        "title": "Development and Validation of the DOAC Score: A Novel Bleeding Risk Prediction Tool for Patients With Atrial Fibrillation on Direct-Acting Oral Anticoagulants"
      },
      "formula": "doac_score",
      "formula_expression": "DOAC Score (Aggarwal 2023 Circulation Table 2) = age (65-69 2, 70-74 3, 75-79 4, >=80 5; <65 0) + crcl_or_egfr_ml_min (30-60 inclusive 1, <30 2, >60 0) + underweight 1 + stroke_tia_embolism_history 1 + diabetes 1 + hypertension 1 + antiplatelet (none 0, aspirin 2, dual 3) + nsaid_use 1 + bleeding_history 3 + liver_disease 2; score = min(raw_sum, 10); bands 0-3 very_low, 4-5 low, 6-7 moderate, 8-9 high, 10 very_high; not HAS-BLED; not DOAC dosing; not warfarin",
      "age_years": 65,
      "max_score": 10,
      "score": 2,
      "antiplatelet": "none",
      "crcl_or_egfr_ml_min": 70.0,
      "uncapped_sum": 2
    }
  ]
}
```

## Response fields

- `formula` (string): doac_score
- `formula_expression` (string): Exact expression used
- `score` (integer): Capped Table 2 total (min of raw_sum and 10)
- `uncapped_sum` (integer): Uncapped factor sum before the Table 2 maximum of 10
- `max_score` (integer): Always 10
- `band` (string): Aggarwal clinical risk group: very_low (0-3), low (4-5), moderate (6-7), high (8-9), very_high (10). Not a diagnosis.
- `age_years` (integer): Age used for the Table 2 age points
- `crcl_or_egfr_ml_min` (number): CrCl or eGFR used for the Table 2 kidney points
- `antiplatelet` (string): none, aspirin, or dual as parsed
- `components` (array): Per-factor points
- `citation` (object): Aggarwal 2023 Circulation citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "band": "very_low",
  "components": [
    {
      "value": 65,
      "factor": "age",
      "points": 2,
      "present": true
    },
    {
      "value": 70.0,
      "factor": "crcl_or_egfr",
      "points": 0,
      "present": false
    },
    {
      "factor": "underweight",
      "points": 0,
      "present": false
    },
    {
      "factor": "stroke_tia_embolism_history",
      "points": 0,
      "present": false
    },
    {
      "factor": "diabetes",
      "points": 0,
      "present": false
    },
    {
      "factor": "hypertension",
      "points": 0,
      "present": false
    },
    {
      "value": "none",
      "factor": "antiplatelet",
      "points": 0,
      "present": false
    },
    {
      "factor": "nsaid_use",
      "points": 0,
      "present": false
    },
    {
      "factor": "bleeding_history",
      "points": 0,
      "present": false
    },
    {
      "factor": "liver_disease",
      "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": "Aggarwal R, Ruff CT, Virdone S, Perreault S, Kakkar AK, Palazzolo MG, Dorais M, Kayani G, Singer DE, Secemsky E, Piccini J, Tahir UA, Shen C, Yeh RW",
    "doi": "10.1161/CIRCULATIONAHA.123.064556",
    "id": "aggarwal-2023",
    "pmid": "37621213",
    "source": "Circulation. 2023;148(12):936-946",
    "title": "Development and Validation of the DOAC Score: A Novel Bleeding Risk Prediction Tool for Patients With Atrial Fibrillation on Direct-Acting Oral Anticoagulants"
  },
  "formula": "doac_score",
  "formula_expression": "DOAC Score (Aggarwal 2023 Circulation Table 2) = age (65-69 2, 70-74 3, 75-79 4, >=80 5; <65 0) + crcl_or_egfr_ml_min (30-60 inclusive 1, <30 2, >60 0) + underweight 1 + stroke_tia_embolism_history 1 + diabetes 1 + hypertension 1 + antiplatelet (none 0, aspirin 2, dual 3) + nsaid_use 1 + bleeding_history 3 + liver_disease 2; score = min(raw_sum, 10); bands 0-3 very_low, 4-5 low, 6-7 moderate, 8-9 high, 10 very_high; not HAS-BLED; not DOAC dosing; not warfarin",
  "age_years": 65,
  "max_score": 10,
  "score": 2,
  "antiplatelet": "none",
  "crcl_or_egfr_ml_min": 70.0,
  "uncapped_sum": 2
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_doac`: antiplatelet must be none, aspirin, or dual; crcl_or_egfr_ml_min must be a number from 5 to 200 (Aggarwal 2023 DOAC Score Table 2). 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

- [HAS-BLED](https://magentlab.com/docs/has-bled) — Compute the HAS-BLED bleeding-risk score from discrete clinical flags.
- [CHA2DS2-VASc](https://magentlab.com/docs/cha2ds2-vasc) — Compute the CHA2DS2-VASc stroke-risk score from discrete clinical flags.
- [ORBIT bleeding score](https://magentlab.com/docs/orbit) — Compute the O'Brien 2015 ORBIT bleeding score from age and caller-assigned anemia, bleeding history, insufficient kidney, and antiplatelet flags.

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