GI · LIVE
TG18 acute cholecystitis
Tokyo cholecystitis
Apply Yokoe 2018 Tokyo Guidelines 2018 diagnostic criteria and severity grading of acute cholecystitis (unchanged from TG13) and return diagnosis (definite, suspected, or none) and severity (grade_i, grade_ii, grade_iii, or none) from caller-assigned flags.
Markdown: /docs/tokyo-cholecystitis.md · Canonical: https://magentlab.com/docs/tokyo-cholecystitis
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply Yokoe 2018 Tokyo Guidelines 2018 diagnostic criteria and severity grading of acute cholecystitis (unchanged from TG13) and return diagnosis (definite, suspected, or none) and severity (grade_i, grade_ii, grade_iii, or none) from caller-assigned flags.
When to use
When an agent already has caller-assigned local signs, systemic signs, imaging findings, and organ-dysfunction or Grade II flags and needs the published TG18 (=TG13) cholecystitis classification. magent does not examine the patient, assay CRP or WBC, or read imaging. Not TG18 cholangitis. Not Alvarado or RIPASA.
When not to use
- Not a medical device and not a diagnosis of acute cholecystitis that replaces imaging.
- TG18 diagnostic criteria and severity grading of acute cholecystitis are unchanged from TG13 (Yokoe 2018).
- This tool is acute cholecystitis only. It is not TG18 acute cholangitis and not Alvarado or RIPASA (appendicitis scores).
- magent does not examine the patient, assay CRP or WBC, or read imaging. The caller assigns every flag.
- Not a cholecystectomy order. Severity is none when diagnosis is none. Grade III beats Grade II.
Formula
definite iff local_signs and systemic_signs and imaging_findings; suspected iff local_signs and systemic_signs without imaging_findings; else none. local_signs iff murphy or ruq_mass_pain_tenderness; systemic_signs iff fever or elevated_crp or elevated_wbc. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any Grade II flag (wbc_gt_18000, palpable_tender_ruq_mass, duration_gt_72h, marked_local_inflammation), else grade_i. When diagnosis is none, severity is none (Yokoe 2018 TG18 = TG13 unmodified)
Citation
- Authors
- Yokoe M, Hata J, Takada T, et al.
- Source
- J Hepatobiliary Pancreat Sci. 2018;25(1):41-54
- DOI
- 10.1002/jhbp.515
Worked example
No local, systemic, or imaging findings
Given:
decreased_consciousness=falseduration_gt_72h=falseelevated_crp=falseelevated_wbc=falsefever=falsehypotension_vasopressors=falseimaging_findings=falsemarked_local_inflammation=falsemurphy=falseoliguria_or_creatinine_gt_2=falsepalpable_tender_ruq_mass=falsepfr_lt_300=falseplatelets_lt_100k=falsept_inr_gt_1_5=falseruq_mass_pain_tenderness=falsewbc_gt_18000=false
- local_signs, systemic_signs, and imaging_findings are all false
- diagnosis is none; severity is none (Grade I is not reported without cholecystitis)
Murphy and fever without imaging is suspected Grade I
Given:
decreased_consciousness=falseduration_gt_72h=falseelevated_crp=falseelevated_wbc=falsefever=truehypotension_vasopressors=falseimaging_findings=falsemarked_local_inflammation=falsemurphy=trueoliguria_or_creatinine_gt_2=falsepalpable_tender_ruq_mass=falsepfr_lt_300=falseplatelets_lt_100k=falsept_inr_gt_1_5=falseruq_mass_pain_tenderness=falsewbc_gt_18000=false
- local_signs and systemic_signs hold; imaging_findings is false
- diagnosis is suspected; no Grade II or Grade III flag, so severity is grade_i
Also searched as
- Tokyo Guidelines 2018 cholecystitis
- TG18 acute cholecystitis
- TG13 cholecystitis
- Yokoe 2018
- acute cholecystitis diagnostic criteria
- Tokyo cholecystitis severity grade
- Murphy sign cholecystitis
- TG18 Grade III cholecystitis
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/tokyo_cholecystitis?murphy=false&ruq_mass_pain_tenderness=false&fever=false&elevated_crp=false&elevated_wbc=false&imaging_findings=false&hypotension_vasopressors=false&decreased_consciousness=false&pfr_lt_300=false&oliguria_or_creatinine_gt_2=false&pt_inr_gt_1_5=false&platelets_lt_100k=false&wbc_gt_18000=false&palpable_tender_ruq_mass=false&duration_gt_72h=false&marked_local_inflammation=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/tokyo_cholecystitis?murphy=false&ruq_mass_pain_tenderness=false&fever=false&elevated_crp=false&elevated_wbc=false&imaging_findings=false&hypotension_vasopressors=false&decreased_consciousness=false&pfr_lt_300=false&oliguria_or_creatinine_gt_2=false&pt_inr_gt_1_5=false&platelets_lt_100k=false&wbc_gt_18000=false&palpable_tender_ruq_mass=false&duration_gt_72h=false&marked_local_inflammation=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
murphy |
boolean | required | Murphy's sign as assigned by the caller (Yokoe 2018 TG18 local sign of inflammation A). true or false. magent does not examine the patient. |
ruq_mass_pain_tenderness |
boolean | required | Right upper quadrant mass, pain, or tenderness as assigned by the caller (Yokoe 2018 TG18 local sign of inflammation A). true or false. magent does not examine the patient. |
fever |
boolean | required | Fever as assigned by the caller (Yokoe 2018 TG18 systemic sign of inflammation B). true or false. magent does not measure temperature. |
elevated_crp |
boolean | required | Elevated C-reactive protein as assigned by the caller (Yokoe 2018 TG18 systemic sign of inflammation B). true or false. magent does not assay CRP. |
elevated_wbc |
boolean | required | Elevated white blood cell count as assigned by the caller (Yokoe 2018 TG18 systemic sign of inflammation B). true or false. magent does not assay WBC. |
imaging_findings |
boolean | required | Imaging findings characteristic of acute cholecystitis as assigned by the caller (Yokoe 2018 TG18 diagnostic criterion C). true or false. magent does not read imaging. |
hypotension_vasopressors |
boolean | required | Hypotension requiring dopamine ≥5 µg/kg/min or any norepinephrine as assigned by the caller (Yokoe 2018 TG18 Grade III cardiovascular dysfunction). true or false. magent does not measure blood pressure or order vasopressors. |
decreased_consciousness |
boolean | required | Decreased level of consciousness as assigned by the caller (Yokoe 2018 TG18 Grade III neurological dysfunction). true or false. magent does not examine the patient. |
pfr_lt_300 |
boolean | required | PaO2/FiO2 <300 as assigned by the caller (Yokoe 2018 TG18 Grade III respiratory dysfunction). true or false. magent does not interpret blood gas or ventilator settings. |
oliguria_or_creatinine_gt_2 |
boolean | required | Oliguria or creatinine >2.0 mg/dL as assigned by the caller (Yokoe 2018 TG18 Grade III renal dysfunction). true or false. magent does not assay creatinine or measure urine output. |
pt_inr_gt_1_5 |
boolean | required | PT-INR >1.5 as assigned by the caller (Yokoe 2018 TG18 Grade III hepatic dysfunction). true or false. magent does not interpret coagulation assays. |
platelets_lt_100k |
boolean | required | Platelet count <100,000/mm³ as assigned by the caller (Yokoe 2018 TG18 Grade III hematological dysfunction). true or false. magent does not assay platelets. |
wbc_gt_18000 |
boolean | required | White blood cell count >18,000/mm³ as assigned by the caller (Yokoe 2018 TG18 Grade II). true or false. magent does not assay WBC. |
palpable_tender_ruq_mass |
boolean | required | Palpable tender mass in the right upper quadrant as assigned by the caller (Yokoe 2018 TG18 Grade II). true or false. magent does not examine the patient. |
duration_gt_72h |
boolean | required | Duration of complaints >72 h as assigned by the caller (Yokoe 2018 TG18 Grade II). true or false. magent does not take a history. |
marked_local_inflammation |
boolean | required | Marked local inflammation (gangrenous cholecystitis, pericholecystic abscess, hepatic abscess, biliary peritonitis, or emphysematous cholecystitis) as assigned by the caller (Yokoe 2018 TG18 Grade II). true or false. magent does not interpret imaging or operative findings. |
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": [
{
"decreased_consciousness": "false",
"duration_gt_72h": "false",
"elevated_crp": "false",
"elevated_wbc": "false",
"fever": "false",
"hypotension_vasopressors": "false",
"imaging_findings": "false",
"marked_local_inflammation": "false",
"murphy": "false",
"oliguria_or_creatinine_gt_2": "false",
"palpable_tender_ruq_mass": "false",
"pfr_lt_300": "false",
"platelets_lt_100k": "false",
"pt_inr_gt_1_5": "false",
"ruq_mass_pain_tenderness": "false",
"wbc_gt_18000": "false"
},
{
"decreased_consciousness": "false",
"duration_gt_72h": "false",
"elevated_crp": "false",
"elevated_wbc": "false",
"fever": "false",
"hypotension_vasopressors": "false",
"imaging_findings": "false",
"marked_local_inflammation": "false",
"murphy": "false",
"oliguria_or_creatinine_gt_2": "false",
"palpable_tender_ruq_mass": "false",
"pfr_lt_300": "false",
"platelets_lt_100k": "false",
"pt_inr_gt_1_5": "false",
"ruq_mass_pain_tenderness": "false",
"wbc_gt_18000": "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/tokyo_cholecystitis",
"items": [
{
"severity": "none",
"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": "Yokoe M, Hata J, Takada T, et al.",
"doi": "10.1002/jhbp.515",
"id": "yokoe-2018",
"pmid": "29032636",
"source": "J Hepatobiliary Pancreat Sci. 2018;25(1):41-54",
"title": "Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholecystitis (with videos)."
},
"formula": "tokyo_cholecystitis",
"formula_expression": "definite iff local_signs and systemic_signs and imaging_findings; suspected iff local_signs and systemic_signs without imaging_findings; else none. local_signs iff murphy or ruq_mass_pain_tenderness; systemic_signs iff fever or elevated_crp or elevated_wbc. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any Grade II flag (wbc_gt_18000, palpable_tender_ruq_mass, duration_gt_72h, marked_local_inflammation), else grade_i. When diagnosis is none, severity is none (Yokoe 2018 TG18 = TG13 unmodified)",
"criteria": [
{
"factor": "local_signs",
"met": false
},
{
"factor": "systemic_signs",
"met": false
},
{
"factor": "imaging_findings",
"met": false
},
{
"factor": "grade_iii_any",
"met": false
},
{
"factor": "grade_ii_any",
"met": false
},
{
"factor": "murphy",
"met": false
},
{
"factor": "ruq_mass_pain_tenderness",
"met": false
},
{
"factor": "fever",
"met": false
},
{
"factor": "elevated_crp",
"met": false
},
{
"factor": "elevated_wbc",
"met": false
},
{
"factor": "hypotension_vasopressors",
"met": false
},
{
"factor": "decreased_consciousness",
"met": false
},
{
"factor": "pfr_lt_300",
"met": false
},
{
"factor": "oliguria_or_creatinine_gt_2",
"met": false
},
{
"factor": "pt_inr_gt_1_5",
"met": false
},
{
"factor": "platelets_lt_100k",
"met": false
},
{
"factor": "wbc_gt_18000",
"met": false
},
{
"factor": "palpable_tender_ruq_mass",
"met": false
},
{
"factor": "duration_gt_72h",
"met": false
},
{
"factor": "marked_local_inflammation",
"met": false
}
],
"diagnosis": "none"
},
{
"severity": "none",
"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": "Yokoe M, Hata J, Takada T, et al.",
"doi": "10.1002/jhbp.515",
"id": "yokoe-2018",
"pmid": "29032636",
"source": "J Hepatobiliary Pancreat Sci. 2018;25(1):41-54",
"title": "Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholecystitis (with videos)."
},
"formula": "tokyo_cholecystitis",
"formula_expression": "definite iff local_signs and systemic_signs and imaging_findings; suspected iff local_signs and systemic_signs without imaging_findings; else none. local_signs iff murphy or ruq_mass_pain_tenderness; systemic_signs iff fever or elevated_crp or elevated_wbc. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any Grade II flag (wbc_gt_18000, palpable_tender_ruq_mass, duration_gt_72h, marked_local_inflammation), else grade_i. When diagnosis is none, severity is none (Yokoe 2018 TG18 = TG13 unmodified)",
"criteria": [
{
"factor": "local_signs",
"met": false
},
{
"factor": "systemic_signs",
"met": false
},
{
"factor": "imaging_findings",
"met": false
},
{
"factor": "grade_iii_any",
"met": false
},
{
"factor": "grade_ii_any",
"met": false
},
{
"factor": "murphy",
"met": false
},
{
"factor": "ruq_mass_pain_tenderness",
"met": false
},
{
"factor": "fever",
"met": false
},
{
"factor": "elevated_crp",
"met": false
},
{
"factor": "elevated_wbc",
"met": false
},
{
"factor": "hypotension_vasopressors",
"met": false
},
{
"factor": "decreased_consciousness",
"met": false
},
{
"factor": "pfr_lt_300",
"met": false
},
{
"factor": "oliguria_or_creatinine_gt_2",
"met": false
},
{
"factor": "pt_inr_gt_1_5",
"met": false
},
{
"factor": "platelets_lt_100k",
"met": false
},
{
"factor": "wbc_gt_18000",
"met": false
},
{
"factor": "palpable_tender_ruq_mass",
"met": false
},
{
"factor": "duration_gt_72h",
"met": false
},
{
"factor": "marked_local_inflammation",
"met": false
}
],
"diagnosis": "none"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | tokyo_cholecystitis |
formula_expression |
string | Yokoe 2018 TG18 (=TG13) acute cholecystitis diagnostic criteria and severity grading |
diagnosis |
string | definite when local_signs, systemic_signs, and imaging_findings all hold; suspected when local_signs and systemic_signs hold without imaging_findings; otherwise none. Not a diagnosis that replaces imaging. |
severity |
string | none when diagnosis is none; otherwise grade_iii if any organ-dysfunction flag, else grade_ii if any Grade II flag, else grade_i. Grade III beats Grade II. Not a cholecystectomy order. |
criteria |
array | Rows for local_signs (A), systemic_signs (B), imaging_findings (C), grade_iii_any, grade_ii_any, then each remaining caller-assigned flag (factor and met) |
citation |
object | Yokoe 2018 J Hepatobiliary Pancreat Sci citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"severity": "none",
"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": "Yokoe M, Hata J, Takada T, et al.",
"doi": "10.1002/jhbp.515",
"id": "yokoe-2018",
"pmid": "29032636",
"source": "J Hepatobiliary Pancreat Sci. 2018;25(1):41-54",
"title": "Tokyo Guidelines 2018: diagnostic criteria and severity grading of acute cholecystitis (with videos)."
},
"formula": "tokyo_cholecystitis",
"formula_expression": "definite iff local_signs and systemic_signs and imaging_findings; suspected iff local_signs and systemic_signs without imaging_findings; else none. local_signs iff murphy or ruq_mass_pain_tenderness; systemic_signs iff fever or elevated_crp or elevated_wbc. When diagnosis is suspected or definite: grade_iii if any organ-dysfunction flag (hypotension_vasopressors, decreased_consciousness, pfr_lt_300, oliguria_or_creatinine_gt_2, pt_inr_gt_1_5, platelets_lt_100k), else grade_ii if any Grade II flag (wbc_gt_18000, palpable_tender_ruq_mass, duration_gt_72h, marked_local_inflammation), else grade_i. When diagnosis is none, severity is none (Yokoe 2018 TG18 = TG13 unmodified)",
"criteria": [
{
"factor": "local_signs",
"met": false
},
{
"factor": "systemic_signs",
"met": false
},
{
"factor": "imaging_findings",
"met": false
},
{
"factor": "grade_iii_any",
"met": false
},
{
"factor": "grade_ii_any",
"met": false
},
{
"factor": "murphy",
"met": false
},
{
"factor": "ruq_mass_pain_tenderness",
"met": false
},
{
"factor": "fever",
"met": false
},
{
"factor": "elevated_crp",
"met": false
},
{
"factor": "elevated_wbc",
"met": false
},
{
"factor": "hypotension_vasopressors",
"met": false
},
{
"factor": "decreased_consciousness",
"met": false
},
{
"factor": "pfr_lt_300",
"met": false
},
{
"factor": "oliguria_or_creatinine_gt_2",
"met": false
},
{
"factor": "pt_inr_gt_1_5",
"met": false
},
{
"factor": "platelets_lt_100k",
"met": false
},
{
"factor": "wbc_gt_18000",
"met": false
},
{
"factor": "palpable_tender_ruq_mass",
"met": false
},
{
"factor": "duration_gt_72h",
"met": false
},
{
"factor": "marked_local_inflammation",
"met": false
}
],
"diagnosis": "none"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 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
- Alvarado score — Compute the Alvarado 1986 MANTRELS score from caller-assigned findings, temperature, WBC, and neutrophil percent.
- RIPASA score — Sum the Chong 2010 RIPASA points from 15 caller-assigned findings and return below_cutoff (<7.5) or at_or_above_cutoff (≥7.5) from the derivation ROC only.
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.