GI · LIVE
Fistula Risk Score after pancreatoduodenectomy
Fistula Risk Score
Sum the Callery 2013 Fistula Risk Score from caller-assigned gland texture, pathology, pancreatic duct diameter, and estimated blood loss, and return the published 0–10 total and fistula band.
Markdown: /docs/fistula-risk.md · Canonical: https://magentlab.com/docs/fistula-risk
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum the Callery 2013 Fistula Risk Score from caller-assigned gland texture, pathology, pancreatic duct diameter, and estimated blood loss, and return the published 0–10 total and fistula band.
When to use
When an agent has already assigned Callery 2013 intraoperative inputs after pancreatoduodenectomy and needs the published integer FRS total and band, not a CR-POPF diagnosis, ISGPS grade, Ranson, or BISAP score.
When not to use
- Not a medical device. magent does not palpate the gland or measure EBL. Gland texture, pathology, duct diameter, and EBL are caller-assigned intraoperative values.
- Intraoperative assignment: Callery 2013 is scored at pancreatoduodenectomy, not from a preoperative chart.
- Does not grade CR-POPF and is not an ISGPS grade. The score is a published risk total, not a fistula diagnosis.
- Not Ranson and not BISAP. This tool is the Callery 2013 Fistula Risk Score only.
Formula
FRS = gland_texture (firm 0, soft 2) + pathology (pdac_or_pancreatitis 0, other 1) + duct_mm (>=5 0, >=4 1, >=3 2, >=2 3, else 4) + ebl_ml (<=400 0, <=700 1, <=1000 2, else 3); Callery 2013; max 10; negligible 0, low 1-2, intermediate 3-6, high 7-10
Citation
- Authors
- Callery MP, Pratt WB, Kent TS, Chaikof EL, Vollmer CM
- Source
- J Am Coll Surg. 2013;216(1):1-14
Worked example
Firm PDAC, 5 mm duct, EBL 300 mL
Given:
duct_mm=5ebl_ml=300gland_texture=firmpathology=pdac_or_pancreatitis
- firm → 0; pdac_or_pancreatitis → 0; duct 5 mm → 0; EBL 300 → 0
- Score = 0 (max 10); fistula_band negligible
Soft other pathology, 1 mm duct, EBL 1100 mL
Given:
duct_mm=1ebl_ml=1100gland_texture=softpathology=other
- soft → 2; other → 1; duct 1 mm → 4; EBL 1100 → 3
- Score = 10 (max 10); fistula_band high
Also searched as
- Fistula Risk Score
- Callery FRS
- pancreatic fistula risk
- CR-POPF risk score
- Callery 2013 score
- pancreatoduodenectomy fistula
- soft pancreas fistula score
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/fistula_risk?gland_texture=firm&pathology=pdac_or_pancreatitis&duct_mm=5&ebl_ml=300
Full URL: https://api.magentlab.com/api/calc/fistula_risk?gland_texture=firm&pathology=pdac_or_pancreatitis&duct_mm=5&ebl_ml=300
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/fistula_risk?gland_texture=firm&pathology=pdac_or_pancreatitis&duct_mm=5&ebl_ml=300"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
gland_texture |
string | required · firm, soft | Caller-assigned pancreatic gland texture at pancreatoduodenectomy (Callery 2013). firm or soft. firm scores 0; soft scores 2. magent does not palpate the gland. |
pathology |
string | required · pdac_or_pancreatitis, other | Caller-assigned pathology (Callery 2013). pdac_or_pancreatitis (pancreatic ductal adenocarcinoma or pancreatitis) scores 0. other (ampullary, duodenal, cystic, or islet cell) scores 1. |
duct_mm |
number | required | Caller-assigned pancreatic duct diameter in mm, number 0.5–20 (Callery 2013 integer-mm table). ≥5 scores 0; ≥4 scores 1; ≥3 scores 2; ≥2 scores 3; else 4 (so 4.0–4.999 scores 1; 1.5 and ≤1 score 4). magent does not measure the duct. |
ebl_ml |
number | required | Caller-assigned estimated blood loss in mL, number 0–10000 (Callery 2013). ≤400 scores 0; 401–700 scores 1; 701–1000 scores 2; >1000 scores 3. magent does not measure EBL. |
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.
- 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": [
{
"duct_mm": "5",
"ebl_ml": "300",
"gland_texture": "firm",
"pathology": "pdac_or_pancreatitis"
},
{
"duct_mm": "5",
"ebl_ml": "300",
"gland_texture": "firm",
"pathology": "pdac_or_pancreatitis"
}
]
}
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/fistula_risk",
"items": [
{
"components": [
{
"value": "firm",
"factor": "gland_texture",
"points": 0,
"present": true
},
{
"value": "pdac_or_pancreatitis",
"factor": "pathology",
"points": 0,
"present": true
},
{
"value": 5.0,
"factor": "duct_mm",
"points": 0,
"present": true
},
{
"value": 300.0,
"factor": "ebl_ml",
"points": 0,
"present": true
}
],
"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": "Callery MP, Pratt WB, Kent TS, Chaikof EL, Vollmer CM",
"doi": "10.1016/j.jamcollsurg.2012.09.002",
"id": "callery-2013",
"pmid": "23122535",
"source": "J Am Coll Surg. 2013;216(1):1-14",
"title": "A prospectively validated clinical risk score accurately predicts pancreatic fistula after pancreatoduodenectomy."
},
"formula": "fistula_risk",
"formula_expression": "FRS = gland_texture (firm 0, soft 2) + pathology (pdac_or_pancreatitis 0, other 1) + duct_mm (>=5 0, >=4 1, >=3 2, >=2 3, else 4) + ebl_ml (<=400 0, <=700 1, <=1000 2, else 3); Callery 2013; max 10; negligible 0, low 1-2, intermediate 3-6, high 7-10",
"max_score": 10,
"score": 0,
"duct_mm": 5.0,
"ebl_ml": 300.0,
"fistula_band": "negligible",
"gland_texture": "firm",
"pathology": "pdac_or_pancreatitis"
},
{
"components": [
{
"value": "firm",
"factor": "gland_texture",
"points": 0,
"present": true
},
{
"value": "pdac_or_pancreatitis",
"factor": "pathology",
"points": 0,
"present": true
},
{
"value": 5.0,
"factor": "duct_mm",
"points": 0,
"present": true
},
{
"value": 300.0,
"factor": "ebl_ml",
"points": 0,
"present": true
}
],
"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": "Callery MP, Pratt WB, Kent TS, Chaikof EL, Vollmer CM",
"doi": "10.1016/j.jamcollsurg.2012.09.002",
"id": "callery-2013",
"pmid": "23122535",
"source": "J Am Coll Surg. 2013;216(1):1-14",
"title": "A prospectively validated clinical risk score accurately predicts pancreatic fistula after pancreatoduodenectomy."
},
"formula": "fistula_risk",
"formula_expression": "FRS = gland_texture (firm 0, soft 2) + pathology (pdac_or_pancreatitis 0, other 1) + duct_mm (>=5 0, >=4 1, >=3 2, >=2 3, else 4) + ebl_ml (<=400 0, <=700 1, <=1000 2, else 3); Callery 2013; max 10; negligible 0, low 1-2, intermediate 3-6, high 7-10",
"max_score": 10,
"score": 0,
"duct_mm": 5.0,
"ebl_ml": 300.0,
"fistula_band": "negligible",
"gland_texture": "firm",
"pathology": "pdac_or_pancreatitis"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | fistula_risk |
formula_expression |
string | Exact expression used |
score |
integer | Callery 2013 Fistula Risk Score 0-10 |
max_score |
integer | 10 |
fistula_band |
string | Callery 2013 band: negligible (0), low (1-2), intermediate (3-6), or high (7-10). Not a CR-POPF diagnosis and not an ISGPS grade. |
gland_texture |
string | Caller-assigned gland texture used (firm or soft) |
pathology |
string | Caller-assigned pathology used (pdac_or_pancreatitis or other) |
duct_mm |
number | Pancreatic duct diameter in mm used |
ebl_ml |
number | Estimated blood loss in mL used |
components |
array | Per-factor Callery 2013 points |
citation |
object | Callery et al. J Am Coll Surg 2013 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": "firm",
"factor": "gland_texture",
"points": 0,
"present": true
},
{
"value": "pdac_or_pancreatitis",
"factor": "pathology",
"points": 0,
"present": true
},
{
"value": 5.0,
"factor": "duct_mm",
"points": 0,
"present": true
},
{
"value": 300.0,
"factor": "ebl_ml",
"points": 0,
"present": true
}
],
"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": "Callery MP, Pratt WB, Kent TS, Chaikof EL, Vollmer CM",
"doi": "10.1016/j.jamcollsurg.2012.09.002",
"id": "callery-2013",
"pmid": "23122535",
"source": "J Am Coll Surg. 2013;216(1):1-14",
"title": "A prospectively validated clinical risk score accurately predicts pancreatic fistula after pancreatoduodenectomy."
},
"formula": "fistula_risk",
"formula_expression": "FRS = gland_texture (firm 0, soft 2) + pathology (pdac_or_pancreatitis 0, other 1) + duct_mm (>=5 0, >=4 1, >=3 2, >=2 3, else 4) + ebl_ml (<=400 0, <=700 1, <=1000 2, else 3); Callery 2013; max 10; negligible 0, low 1-2, intermediate 3-6, high 7-10",
"max_score": 10,
"score": 0,
"duct_mm": 5.0,
"ebl_ml": 300.0,
"fistula_band": "negligible",
"gland_texture": "firm",
"pathology": "pdac_or_pancreatitis"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_fistula_risk |
gland_texture must be firm or soft, pathology pdac_or_pancreatitis or other, duct_mm a number 0.5-20, and ebl_ml a number 0-10000 (Callery 2013 Fistula Risk Score). 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
- Ranson — Sum the eleven Ranson 1974 prognostic signs (five at admission, six during the first 48 hours) and return the published mortality band.
- BISAP — Compute the Wu 2008 BISAP score for early prediction of mortality in acute pancreatitis from BUN, caller-assigned impaired mental status, caller-assigned SIRS, age, and caller-assigned pleural effusion.
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.