MAGENT

Atrial fibrillation · LIVE

DOAC Score (Aggarwal)

DOAC Score

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.

LIVE $0.005 USDC GET /api/calc/doac_score

Markdown: /docs/doac-score.md · Canonical: https://magentlab.com/docs/doac-score

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

Title
Development and Validation of the DOAC Score: A Novel Bleeding Risk Prediction Tool for Patients With Atrial Fibrillation on Direct-Acting Oral Anticoagulants
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
Source
Circulation. 2023;148(12):936-946
DOI
10.1161/CIRCULATIONAHA.123.064556

Worked example

Age 65, CrCl 70, no other factors

Given: age=65antiplatelet=nonebleeding_history=falsecrcl_or_egfr_ml_min=70diabetes=falsehypertension=falseliver_disease=falsensaid_use=falsestroke_tia_embolism_history=falseunderweight=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=70antiplatelet=dualbleeding_history=falsecrcl_or_egfr_ml_min=70diabetes=falsehypertension=falseliver_disease=falsensaid_use=falsestroke_tia_embolism_history=falseunderweight=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

Try

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

/api/calc/doac_score?age=65&crcl_or_egfr_ml_min=70&underweight=false&stroke_tia_embolism_history=false&diabetes=false&hypertension=false&antiplatelet=none&nsaid_use=false&bleeding_history=false&liver_disease=false

Full URL: https://api.magentlab.com/api/calc/doac_score?age=65&crcl_or_egfr_ml_min=70&underweight=false&stroke_tia_embolism_history=false&diabetes=false&hypertension=false&antiplatelet=none&nsaid_use=false&bleeding_history=false&liver_disease=false

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/doac_score?age=65&crcl_or_egfr_ml_min=70&underweight=false&stroke_tia_embolism_history=false&diabetes=false&hypertension=false&antiplatelet=none&nsaid_use=false&bleeding_history=false&liver_disease=false"

Parameters

Name Type Required Description
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 · none, aspirin, dual 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.

POST /api/calc/doac_score Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 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 (fixture)

{
  "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"
    }
  ]
}

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

Field Type Description
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

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

{
  "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
}

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_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.
400 invalid_flag boolean clinical flags must be true or false 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

  • HAS-BLED — Compute the HAS-BLED bleeding-risk score from discrete clinical flags.
  • CHA2DS2-VASc — Compute the CHA2DS2-VASc stroke-risk score from discrete clinical flags.
  • ORBIT bleeding score — 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. 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

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