Liver · LIVE
BCLC stage (Reig 2022)
BCLC
Apply Reig 2022 BCLC staging and return bclc_stage (0, A, B, C, or D) with the published expected median survival. Stage only. Not a treatment recommendation.
Markdown: /docs/bclc.md · Canonical: https://magentlab.com/docs/bclc
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply Reig 2022 BCLC staging and return bclc_stage (0, A, B, C, or D) with the published expected median survival. Stage only. Not a treatment recommendation.
When to use
When an agent already has cancer-related ECOG PS, caller-assigned preserved liver function, transplant option, vascular invasion, extrahepatic disease, tumor count, and largest diameter as in Reig 2022, and needs the published BCLC stage. magent does not assign ECOG, compute Child-Pugh, or interpret imaging.
When not to use
- Not a medical device.
- Not a treatment recommendation. This tool returns Reig 2022 BCLC stage and expected median survival only. 2022 treatment-stage-migration is out of scope.
- magent does not read imaging or compute Child-Pugh or ALBI. preserved_liver_function, transplant_option, ECOG, vascular_invasion, extrahepatic, tumor_count, and largest_cm are caller-assigned.
- Not UCSF or Milan listing (see related milan).
Formula
bclc_stage D iff ecog > 2 or (not preserved_liver_function and not transplant_option); else C iff preserved_liver_function and ecog <= 2 and (vascular_invasion or extrahepatic or ecog >= 1); else 0 iff ecog == 0 and not vascular_invasion and not extrahepatic and (preserved_liver_function or transplant_option) and tumor_count == 1 and largest_cm <= 2; else A iff same eligibility and ((tumor_count == 1 and largest_cm > 2) or (tumor_count in 2..3 and largest_cm <= 3)); else B iff same eligibility and (tumor_count >= 4 or (tumor_count in 2..3 and largest_cm > 3)); else invalid_bclc_profile (Reig 2022)
Citation
- Authors
- Reig M, Forner A, Rimola J, Ferrer-Fàbrega J, Burrel M, Garcia-Criado Á, Kelley RK, Galle PR, Mazzaferro V, Salem R, Sangro B, Singal AG, Vogel A, Fuster J, Ayuso C, Bruix J
- Source
- J Hepatol. 2022;76(3):681-693
Worked example
Single 1.5 cm tumor, PS 0, preserved liver function (stage 0)
Given:
ecog=0extrahepatic=falselargest_cm=1.5preserved_liver_function=truetransplant_option=falsetumor_count=1vascular_invasion=false
- ecog 0 is not > 2 and preserved_liver_function is true, so not D
- no vascular_invasion, no extrahepatic, ecog 0, so not C
- tumor_count 1 and largest_cm 1.5 <= 2 → stage 0; expected median survival >5 years
Also searched as
- BCLC staging
- Barcelona Clinic Liver Cancer
- BCLC 2022
- Reig 2022 BCLC
- HCC BCLC stage
- BCLC 0 A B C D
- BCLC very early stage
- hepatocellular carcinoma BCLC
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/bclc?ecog=0&preserved_liver_function=true&transplant_option=false&vascular_invasion=false&extrahepatic=false&tumor_count=1&largest_cm=1.5
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/bclc?ecog=0&preserved_liver_function=true&transplant_option=false&vascular_invasion=false&extrahepatic=false&tumor_count=1&largest_cm=1.5"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ecog |
integer | required | Cancer-related ECOG performance status 0-4 as assigned by the caller (Reig 2022: do not count baseline comorbidity PS). Integer 0-4. magent does not assign ECOG. |
preserved_liver_function |
boolean | required | Preserved liver function as assigned by the caller (Reig 2022 abandoned Child-Pugh class for this assignment). true or false. magent does not compute Child-Pugh or ALBI. |
transplant_option |
boolean | required | Option of liver transplantation when liver function is not preserved, as assigned by the caller (Reig 2022). true or false. magent does not list for transplant. |
vascular_invasion |
boolean | required | Vascular (vessel) invasion as assigned by the caller. true or false. magent does not interpret imaging. |
extrahepatic |
boolean | required | Extrahepatic spread as assigned by the caller. true or false. magent does not interpret imaging. |
tumor_count |
integer | required | Number of HCC nodules (integer 1-20) as assigned by the caller. Stage 0 is a single tumor <=2 cm; stage A allows a solitary tumor of any size or 2-3 nodules none >3 cm; four or more nodules are stage B when otherwise 0/A/B-eligible. magent does not interpret imaging. |
largest_cm |
number | required | Largest tumor diameter in centimetres (0.1-30). Stage 0 meets at 2.0 cm and is A at 2.1 when solitary. Two or three nodules meet A at 3.0 cm and are B at 3.1. magent does not interpret imaging. |
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": [
{
"ecog": "0",
"extrahepatic": "false",
"largest_cm": "1.5",
"preserved_liver_function": "true",
"transplant_option": "false",
"tumor_count": "1",
"vascular_invasion": "false"
},
{
"ecog": "0",
"extrahepatic": "false",
"largest_cm": "1.5",
"preserved_liver_function": "true",
"transplant_option": "false",
"tumor_count": "1",
"vascular_invasion": "false"
}
]
}
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/bclc",
"items": [
{
"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": "Reig M, Forner A, Rimola J, Ferrer-Fàbrega J, Burrel M, Garcia-Criado Á, Kelley RK, Galle PR, Mazzaferro V, Salem R, Sangro B, Singal AG, Vogel A, Fuster J, Ayuso C, Bruix J",
"doi": "10.1016/j.jhep.2021.11.018",
"id": "reig-2022",
"pmid": "34801630",
"source": "J Hepatol. 2022;76(3):681-693",
"title": "BCLC strategy for prognosis prediction and treatment recommendation: The 2022 update"
},
"formula": "bclc",
"formula_expression": "bclc_stage D iff ecog > 2 or (not preserved_liver_function and not transplant_option); else C iff preserved_liver_function and ecog <= 2 and (vascular_invasion or extrahepatic or ecog >= 1); else 0 iff ecog == 0 and not vascular_invasion and not extrahepatic and (preserved_liver_function or transplant_option) and tumor_count == 1 and largest_cm <= 2; else A iff same eligibility and ((tumor_count == 1 and largest_cm > 2) or (tumor_count in 2..3 and largest_cm <= 3)); else B iff same eligibility and (tumor_count >= 4 or (tumor_count in 2..3 and largest_cm > 3)); else invalid_bclc_profile (Reig 2022)",
"criteria": [
{
"factor": "ps_gt_2",
"met": false
},
{
"factor": "impaired_liver_without_lt",
"met": false
},
{
"factor": "preserved_liver_function",
"met": true
},
{
"factor": "vascular_invasion",
"met": false
},
{
"factor": "extrahepatic",
"met": false
},
{
"factor": "cancer_related_symptoms",
"met": false
},
{
"factor": "single_leq_2cm",
"met": true
},
{
"factor": "early_solitary_or_upto_3",
"met": false
},
{
"factor": "multifocal_beyond_a",
"met": false
}
],
"bclc_stage": "0",
"ecog": 0,
"expected_median_survival": ">5 years",
"extrahepatic": false,
"largest_cm": 1.5,
"preserved_liver_function": true,
"transplant_option": false,
"tumor_count": 1,
"vascular_invasion": 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": "Reig M, Forner A, Rimola J, Ferrer-Fàbrega J, Burrel M, Garcia-Criado Á, Kelley RK, Galle PR, Mazzaferro V, Salem R, Sangro B, Singal AG, Vogel A, Fuster J, Ayuso C, Bruix J",
"doi": "10.1016/j.jhep.2021.11.018",
"id": "reig-2022",
"pmid": "34801630",
"source": "J Hepatol. 2022;76(3):681-693",
"title": "BCLC strategy for prognosis prediction and treatment recommendation: The 2022 update"
},
"formula": "bclc",
"formula_expression": "bclc_stage D iff ecog > 2 or (not preserved_liver_function and not transplant_option); else C iff preserved_liver_function and ecog <= 2 and (vascular_invasion or extrahepatic or ecog >= 1); else 0 iff ecog == 0 and not vascular_invasion and not extrahepatic and (preserved_liver_function or transplant_option) and tumor_count == 1 and largest_cm <= 2; else A iff same eligibility and ((tumor_count == 1 and largest_cm > 2) or (tumor_count in 2..3 and largest_cm <= 3)); else B iff same eligibility and (tumor_count >= 4 or (tumor_count in 2..3 and largest_cm > 3)); else invalid_bclc_profile (Reig 2022)",
"criteria": [
{
"factor": "ps_gt_2",
"met": false
},
{
"factor": "impaired_liver_without_lt",
"met": false
},
{
"factor": "preserved_liver_function",
"met": true
},
{
"factor": "vascular_invasion",
"met": false
},
{
"factor": "extrahepatic",
"met": false
},
{
"factor": "cancer_related_symptoms",
"met": false
},
{
"factor": "single_leq_2cm",
"met": true
},
{
"factor": "early_solitary_or_upto_3",
"met": false
},
{
"factor": "multifocal_beyond_a",
"met": false
}
],
"bclc_stage": "0",
"ecog": 0,
"expected_median_survival": ">5 years",
"extrahepatic": false,
"largest_cm": 1.5,
"preserved_liver_function": true,
"transplant_option": false,
"tumor_count": 1,
"vascular_invasion": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | bclc |
formula_expression |
string | Reig 2022 first-match BCLC stage 0/A/B/C/D (stage only) |
bclc_stage |
string | Reig 2022 BCLC stage 0, A, B, C, or D. Not a treatment recommendation. |
expected_median_survival |
string | Published expected median survival: >5 years (0 and A), >2.5 years (B), >2 years (C), 3 months (D) |
ecog |
integer | Echo of the caller-assigned cancer-related ECOG PS (0-4) |
preserved_liver_function |
boolean | Echo of the caller-assigned preserved-liver-function flag |
transplant_option |
boolean | Echo of the caller-assigned transplant-option flag |
vascular_invasion |
boolean | Echo of the caller-assigned vascular-invasion flag |
extrahepatic |
boolean | Echo of the caller-assigned extrahepatic-spread flag |
tumor_count |
integer | Echo of the caller-assigned nodule count (1-20) |
largest_cm |
number | Echo of the caller-assigned largest diameter in centimetres |
criteria |
array | Per-factor Tree rows with factor and met for the Reig 2022 first-match predicates |
citation |
object | Reig 2022 J Hepatol citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"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": "Reig M, Forner A, Rimola J, Ferrer-Fàbrega J, Burrel M, Garcia-Criado Á, Kelley RK, Galle PR, Mazzaferro V, Salem R, Sangro B, Singal AG, Vogel A, Fuster J, Ayuso C, Bruix J",
"doi": "10.1016/j.jhep.2021.11.018",
"id": "reig-2022",
"pmid": "34801630",
"source": "J Hepatol. 2022;76(3):681-693",
"title": "BCLC strategy for prognosis prediction and treatment recommendation: The 2022 update"
},
"formula": "bclc",
"formula_expression": "bclc_stage D iff ecog > 2 or (not preserved_liver_function and not transplant_option); else C iff preserved_liver_function and ecog <= 2 and (vascular_invasion or extrahepatic or ecog >= 1); else 0 iff ecog == 0 and not vascular_invasion and not extrahepatic and (preserved_liver_function or transplant_option) and tumor_count == 1 and largest_cm <= 2; else A iff same eligibility and ((tumor_count == 1 and largest_cm > 2) or (tumor_count in 2..3 and largest_cm <= 3)); else B iff same eligibility and (tumor_count >= 4 or (tumor_count in 2..3 and largest_cm > 3)); else invalid_bclc_profile (Reig 2022)",
"criteria": [
{
"factor": "ps_gt_2",
"met": false
},
{
"factor": "impaired_liver_without_lt",
"met": false
},
{
"factor": "preserved_liver_function",
"met": true
},
{
"factor": "vascular_invasion",
"met": false
},
{
"factor": "extrahepatic",
"met": false
},
{
"factor": "cancer_related_symptoms",
"met": false
},
{
"factor": "single_leq_2cm",
"met": true
},
{
"factor": "early_solitary_or_upto_3",
"met": false
},
{
"factor": "multifocal_beyond_a",
"met": false
}
],
"bclc_stage": "0",
"ecog": 0,
"expected_median_survival": ">5 years",
"extrahepatic": false,
"largest_cm": 1.5,
"preserved_liver_function": true,
"transplant_option": false,
"tumor_count": 1,
"vascular_invasion": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_ecog_ps |
ecog must be an integer from 0 to 4 (Oken 1982). Grade 5 (dead) is not scored. 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_tumor_count |
tumor_count must be an integer from 1 to 20 (Mazzaferro 1996). Returned before settlement; you are not charged. |
| 400 | invalid_largest_cm |
largest_cm must be a number from 0.1 to 30 (Mazzaferro 1996). Returned before settlement; you are not charged. |
| 400 | invalid_bclc_profile |
ecog, preserved_liver_function, transplant_option, vascular_invasion, extrahepatic, and tumor burden do not match a Reig 2022 BCLC stage (0, A, B, C, or D). 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
- Child–Pugh — Compute the Child–Turcotte–Pugh cirrhosis severity score from bilirubin, albumin, INR, encephalopathy, and ascites.
- Milan — Apply Mazzaferro 1996 Milan criteria and return whether the published size, count, vascular-invasion, and extrahepatic rules all hold (meets_milan).
- MELD — Compute the Kamath 2001 model for end-stage liver disease (MELD) integer from creatinine, bilirubin, INR, and cholestatic or alcoholic etiology.
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.