MAGENT

Kidney · LIVE

Thakar ARF score after cardiac surgery

Thakar ARF score

Sum the Thakar 2005 preoperative points for dialysis-requiring acute renal failure after open-heart surgery and return the integer score (max 17) and published category (0–2 / 3–5 / 6–8 / 9–13).

LIVE $0.005 USDC GET /api/calc/thakar

Markdown: /docs/thakar.md · Canonical: https://magentlab.com/docs/thakar

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

What it computes

Sum the Thakar 2005 preoperative points for dialysis-requiring acute renal failure after open-heart surgery and return the integer score (max 17) and published category (0–2 / 3–5 / 6–8 / 9–13).

When to use

When an agent has caller-assigned sex, surgery type, preoperative creatinine, and the published boolean risk factors and needs the Thakar 2005 point total. Not a dialysis order. magent does not examine the patient.

When not to use

  • Not a medical device and not a dialysis order.
  • Not AKIN or RIFLE staging of a current creatinine change. This is a preoperative score for dialysis-requiring ARF after open-heart surgery.
  • magent does not examine the patient. Sex, surgery type, CHF, LVEF <35%, preoperative IABP, COPD requiring medical therapy, insulin-requiring diabetes, previous cardiac surgery, and emergency surgery are caller-assigned.
  • Creatinine bands follow the Thakar 2005 scoring table: <1.2 mg/dL scores 0; 1.2 to <2.1 scores 2; >=2.1 scores 5. 2.0 mg/dL scores 2. magent does not assay creatinine.
  • Published categories are 0–2, 3–5, 6–8, and 9–13 (formed arbitrarily in the paper). Scores >=9 map to 9–13; the paper observed no patients above 13. Theoretical max is 17.

Formula

Thakar 2005 = female(1) + congestive_heart_failure(1) + lvef_lt_35(1) + preoperative_iabp(2) + copd(1) + insulin_diabetes(1) + previous_cardiac_surgery(1) + emergency_surgery(2) + surgery_type(cabg 0, valve 1, cabg_valve 2, other 2) + creatinine_mg_dl(<1.2: 0, 1.2 to <2.1: 2, >=2.1: 5); max 17; categories 0-2 / 3-5 / 6-8 / 9-13

Citation

Title
A clinical score to predict acute renal failure after cardiac surgery
Authors
Thakar CV, Arrigain S, Worley S, Yared JP, Paganini EP
Source
J Am Soc Nephrol. 2005;16(1):162-168
DOI
10.1681/ASN.2004040331

Worked example

Male CABG, creatinine 1.0 mg/dL, no flags

Given: congestive_heart_failure=falsecopd=falsecreatinine_mg_dl=1.0emergency_surgery=falseinsulin_diabetes=falselvef_lt_35=falsepreoperative_iabp=falseprevious_cardiac_surgery=falsesex=malesurgery_type=cabg

  1. Male 0; CABG-only 0; creatinine 1.0 <1.2 → 0; all flags false → 0
  2. Score = 0 (max 17); thakar_category = 0_to_2

Female CABG+valve, creatinine 2.1, IABP, emergency

Given: congestive_heart_failure=falsecopd=falsecreatinine_mg_dl=2.1emergency_surgery=trueinsulin_diabetes=falselvef_lt_35=falsepreoperative_iabp=trueprevious_cardiac_surgery=falsesex=femalesurgery_type=cabg_valve

  1. Female +1; CABG+valve +2; creatinine 2.1 >=2.1 → +5; IABP +2; emergency +2
  2. Score = 12 (max 17); thakar_category = 9_to_13

Also searched as

  • Thakar score
  • Thakar ARF score
  • cardiac surgery ARF score
  • Thakar 2005
  • acute renal failure after cardiac surgery
  • dialysis risk after open-heart surgery
  • Thakar renal failure score

Try

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

/api/calc/thakar?sex=male&surgery_type=cabg&creatinine_mg_dl=1.0&congestive_heart_failure=false&lvef_lt_35=false&preoperative_iabp=false&copd=false&insulin_diabetes=false&previous_cardiac_surgery=false&emergency_surgery=false

Full URL: https://api.magentlab.com/api/calc/thakar?sex=male&surgery_type=cabg&creatinine_mg_dl=1.0&congestive_heart_failure=false&lvef_lt_35=false&preoperative_iabp=false&copd=false&insulin_diabetes=false&previous_cardiac_surgery=false&emergency_surgery=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/thakar?sex=male&surgery_type=cabg&creatinine_mg_dl=1.0&congestive_heart_failure=false&lvef_lt_35=false&preoperative_iabp=false&copd=false&insulin_diabetes=false&previous_cardiac_surgery=false&emergency_surgery=false"

Parameters

Name Type Required Description
sex string required · female, male female or male (Thakar 2005). Female scores 1. Male scores 0. Assigned by the caller.
surgery_type string required · cabg, valve, cabg_valve, other cabg (CABG only, reference, 0), valve (valve only, +1), cabg_valve (CABG + valve, +2), or other (other cardiac surgeries such as ventricular aneurysm repair or pericardiectomy, +2). Thakar 2005. Assigned by the caller.
creatinine_mg_dl number optional Preoperative serum creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l, not both. Thakar 2005 scoring table: <1.2 scores 0; 1.2 to <2.1 scores 2; >=2.1 scores 5. 2.0 mg/dL scores 2. magent does not assay creatinine.
creatinine_umol_l number optional Preoperative serum creatinine in µmol/L (9-1768). Converted as mg/dL = µmol/L / 88.42.
congestive_heart_failure boolean required Congestive heart failure as assigned by the caller (Thakar 2005). true scores 1. true or false. magent does not examine the patient.
lvef_lt_35 boolean required Left-ventricular ejection fraction <35% as assigned by the caller (Thakar 2005). true scores 1. Flag only; do not send an LVEF number. magent does not measure ejection fraction.
preoperative_iabp boolean required Preoperative intra-aortic balloon pump as assigned by the caller (Thakar 2005). true scores 2. true or false.
copd boolean required COPD requiring medical therapy as assigned by the caller (Thakar 2005). true scores 1. true or false.
insulin_diabetes boolean required Insulin-requiring diabetes as assigned by the caller (Thakar 2005). true scores 1. true or false.
previous_cardiac_surgery boolean required Previous cardiac surgery as assigned by the caller (Thakar 2005). true scores 1. true or false.
emergency_surgery boolean required Emergency surgery as assigned by the caller (Thakar 2005). true scores 2. true or false.

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/thakar 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": [
    {
      "congestive_heart_failure": "false",
      "copd": "false",
      "creatinine_mg_dl": "1.0",
      "emergency_surgery": "false",
      "insulin_diabetes": "false",
      "lvef_lt_35": "false",
      "preoperative_iabp": "false",
      "previous_cardiac_surgery": "false",
      "sex": "male",
      "surgery_type": "cabg"
    },
    {
      "congestive_heart_failure": "false",
      "copd": "false",
      "creatinine_mg_dl": "1.0",
      "emergency_surgery": "false",
      "insulin_diabetes": "false",
      "lvef_lt_35": "false",
      "preoperative_iabp": "false",
      "previous_cardiac_surgery": "false",
      "sex": "male",
      "surgery_type": "cabg"
    }
  ]
}

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/thakar",
  "items": [
    {
      "components": [
        {
          "factor": "female",
          "points": 0,
          "present": false
        },
        {
          "factor": "congestive_heart_failure",
          "points": 0,
          "present": false
        },
        {
          "factor": "lvef_lt_35",
          "points": 0,
          "present": false
        },
        {
          "factor": "preoperative_iabp",
          "points": 0,
          "present": false
        },
        {
          "factor": "copd",
          "points": 0,
          "present": false
        },
        {
          "factor": "insulin_diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_cardiac_surgery",
          "points": 0,
          "present": false
        },
        {
          "factor": "emergency_surgery",
          "points": 0,
          "present": false
        },
        {
          "value": "cabg",
          "factor": "surgery_type",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "creatinine_mg_dl",
          "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": "Thakar CV, Arrigain S, Worley S, Yared JP, Paganini EP",
        "doi": "10.1681/ASN.2004040331",
        "id": "thakar-2005",
        "pmid": "15563569",
        "source": "J Am Soc Nephrol. 2005;16(1):162-168",
        "title": "A clinical score to predict acute renal failure after cardiac surgery"
      },
      "formula": "thakar",
      "formula_expression": "Thakar 2005 = female(1) + congestive_heart_failure(1) + lvef_lt_35(1) + preoperative_iabp(2) + copd(1) + insulin_diabetes(1) + previous_cardiac_surgery(1) + emergency_surgery(2) + surgery_type(cabg 0, valve 1, cabg_valve 2, other 2) + creatinine_mg_dl(<1.2: 0, 1.2 to <2.1: 2, >=2.1: 5); max 17; categories 0-2 / 3-5 / 6-8 / 9-13",
      "max_score": 17,
      "score": 0,
      "creatinine_mg_dl": 1.0,
      "sex": "male",
      "surgery_type": "cabg",
      "thakar_category": "0_to_2"
    },
    {
      "components": [
        {
          "factor": "female",
          "points": 0,
          "present": false
        },
        {
          "factor": "congestive_heart_failure",
          "points": 0,
          "present": false
        },
        {
          "factor": "lvef_lt_35",
          "points": 0,
          "present": false
        },
        {
          "factor": "preoperative_iabp",
          "points": 0,
          "present": false
        },
        {
          "factor": "copd",
          "points": 0,
          "present": false
        },
        {
          "factor": "insulin_diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_cardiac_surgery",
          "points": 0,
          "present": false
        },
        {
          "factor": "emergency_surgery",
          "points": 0,
          "present": false
        },
        {
          "value": "cabg",
          "factor": "surgery_type",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "creatinine_mg_dl",
          "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": "Thakar CV, Arrigain S, Worley S, Yared JP, Paganini EP",
        "doi": "10.1681/ASN.2004040331",
        "id": "thakar-2005",
        "pmid": "15563569",
        "source": "J Am Soc Nephrol. 2005;16(1):162-168",
        "title": "A clinical score to predict acute renal failure after cardiac surgery"
      },
      "formula": "thakar",
      "formula_expression": "Thakar 2005 = female(1) + congestive_heart_failure(1) + lvef_lt_35(1) + preoperative_iabp(2) + copd(1) + insulin_diabetes(1) + previous_cardiac_surgery(1) + emergency_surgery(2) + surgery_type(cabg 0, valve 1, cabg_valve 2, other 2) + creatinine_mg_dl(<1.2: 0, 1.2 to <2.1: 2, >=2.1: 5); max 17; categories 0-2 / 3-5 / 6-8 / 9-13",
      "max_score": 17,
      "score": 0,
      "creatinine_mg_dl": 1.0,
      "sex": "male",
      "surgery_type": "cabg",
      "thakar_category": "0_to_2"
    }
  ]
}

Response

Field Type Description
formula string thakar
formula_expression string Thakar 2005 scoring-table integer expression
score integer Thakar points 0-17
max_score integer 17
thakar_category string Published Thakar 2005 risk category: 0_to_2, 3_to_5, 6_to_8, or 9_to_13. Scores >=9 map to 9_to_13. Not a dialysis order.
sex string female or male used
surgery_type string cabg, valve, cabg_valve, or other used
creatinine_mg_dl number Preoperative serum creatinine used in mg/dL (after conversion)
components array Per-factor Thakar 2005 points
citation object Thakar 2005 JASN citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "factor": "female",
      "points": 0,
      "present": false
    },
    {
      "factor": "congestive_heart_failure",
      "points": 0,
      "present": false
    },
    {
      "factor": "lvef_lt_35",
      "points": 0,
      "present": false
    },
    {
      "factor": "preoperative_iabp",
      "points": 0,
      "present": false
    },
    {
      "factor": "copd",
      "points": 0,
      "present": false
    },
    {
      "factor": "insulin_diabetes",
      "points": 0,
      "present": false
    },
    {
      "factor": "previous_cardiac_surgery",
      "points": 0,
      "present": false
    },
    {
      "factor": "emergency_surgery",
      "points": 0,
      "present": false
    },
    {
      "value": "cabg",
      "factor": "surgery_type",
      "points": 0,
      "present": false
    },
    {
      "value": 1.0,
      "factor": "creatinine_mg_dl",
      "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": "Thakar CV, Arrigain S, Worley S, Yared JP, Paganini EP",
    "doi": "10.1681/ASN.2004040331",
    "id": "thakar-2005",
    "pmid": "15563569",
    "source": "J Am Soc Nephrol. 2005;16(1):162-168",
    "title": "A clinical score to predict acute renal failure after cardiac surgery"
  },
  "formula": "thakar",
  "formula_expression": "Thakar 2005 = female(1) + congestive_heart_failure(1) + lvef_lt_35(1) + preoperative_iabp(2) + copd(1) + insulin_diabetes(1) + previous_cardiac_surgery(1) + emergency_surgery(2) + surgery_type(cabg 0, valve 1, cabg_valve 2, other 2) + creatinine_mg_dl(<1.2: 0, 1.2 to <2.1: 2, >=2.1: 5); max 17; categories 0-2 / 3-5 / 6-8 / 9-13",
  "max_score": 17,
  "score": 0,
  "creatinine_mg_dl": 1.0,
  "sex": "male",
  "surgery_type": "cabg",
  "thakar_category": "0_to_2"
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_thakar_surgery surgery_type must be cabg, valve, cabg_valve, or other (Thakar 2005; CABG-only is the reference). Returned before settlement; you are not charged.
400 invalid_sex sex must be female or male Returned before settlement; you are not charged.
400 invalid_creatinine creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required 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

  • AKIN — Apply Mehta 2007 Table 2 AKIN staging and return stage 0-3 as the worse of the creatinine and urine-output limbs, with initiated renal replacement therapy mapping to stage 3.
  • RIFLE — Apply Bellomo 2004 Fig. 1 RIFLE classification and return the worse of the creatinine and urine-output limbs (none, risk, injury, failure), with persistent ARF beyond 4 weeks mapping to loss and ESRD beyond 3 months mapping to esrd.
  • Mehran CIN risk score — Sum the Mehran 2004 eGFR model B integer score for contrast-induced nephropathy after PCI and return low (≤5), moderate (6–10), high (11–15), or very_high (≥16) with the development-set CIN percent.

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.