GI · LIVE
CholeS elective cholecystectomy duration score
CholeS score
Sum Bharamgoudar 2018 Table 3 points from caller-assigned age, sex, indication, BMI, CBD diameter, gallbladder wall, pre-operative CT, planned intraoperative cholangiogram, previous surgical admissions, and ASA class, and return the numeric total (max 20). Does not classify operative duration or risk bands.
Markdown: /docs/choles-score.md · Canonical: https://magentlab.com/docs/choles-score
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum Bharamgoudar 2018 Table 3 points from caller-assigned age, sex, indication, BMI, CBD diameter, gallbladder wall, pre-operative CT, planned intraoperative cholangiogram, previous surgical admissions, and ASA class, and return the numeric total (max 20). Does not classify operative duration or risk bands.
When to use
When an agent has already assigned Bharamgoudar 2018 Table 3 inputs before elective laparoscopic cholecystectomy and needs the published 0-20 point total, not an operative booking, Nassar difficulty grade, or Tokyo cholecystitis/cholangitis grade.
When not to use
- Not a medical device. This is a published arithmetic total, not an operative booking, cancellation, or theatre-time allocation.
- magent does not image the gallbladder, measure CBD diameter, or assign ASA class; the caller supplies Table 3 tokens and numbers.
- Not Nassar operative difficulty. This tool does not grade difficulty or conversion risk.
- Not Tokyo Guidelines cholecystitis or cholangitis severity. Related Tokyo tools are separate.
- Bharamgoudar 2018 reports cohort percentages lasting >90 min at score 0-3 vs >8; magent returns score and max_score only and does not classify the patient as low or high duration.
Formula
CholeS = age (<40 0, >=40 1.5) + sex (female 0, male 1) + indication (pancreatitis 0, colic_dyskinesia_polyp 0.5, cbd_stone 2, acalculous_cholecystitis 2.5) + bmi_kg_m2 (<25 0, 25-35 inclusive 1, >35 2) + cbd_diameter (normal 0, dilated 2) + gallbladder_wall (normal 0, thick 1.5) + pre_operative_ct (true 1.5) + planned_intraop_cholangiogram (true 3) + previous_surgical_admissions (0 0, 1-2 1, >2 2.5) + asa_class (1 0, 2 1, 3-5 2.5); Bharamgoudar 2018 Table 3; max 20; numeric total only, no duration or risk bands
Citation
- Authors
- Bharamgoudar R, Sonsale A, Hodson J, Griffiths E; CholeS Study Group, West Midlands Research Collaborative
- Source
- Surg Endosc. 2018;32(7):3149-3157
Worked example
All Table 3 zeros (age 35 female pancreatitis BMI 24)
Given:
age=35asa_class=1bmi_kg_m2=24cbd_diameter=normalgallbladder_wall=normalindication=pancreatitisplanned_intraop_cholangiogram=falsepre_operative_ct=falseprevious_surgical_admissions=0sex=female
- Age 35 → 0; female → 0; pancreatitis → 0; BMI 24 → 0
- CBD normal → 0; wall normal → 0; CT false → 0; IOC false → 0; admissions 0 → 0; ASA 1 → 0
- Score = 0 (max 20). No duration band.
All Table 3 maxima (score 20)
Given:
age=40asa_class=3bmi_kg_m2=36cbd_diameter=dilatedgallbladder_wall=thickindication=acalculous_cholecystitisplanned_intraop_cholangiogram=truepre_operative_ct=trueprevious_surgical_admissions=3sex=male
- Age 40 → 1.5; male → 1; acalculous_cholecystitis → 2.5; BMI 36 → 2
- CBD dilated → 2; wall thick → 1.5; CT true → 1.5; IOC true → 3; admissions 3 → 2.5; ASA 3 → 2.5
- Score = 20 (max 20). No duration band.
Also searched as
- CholeS score
- laparoscopic cholecystectomy duration
- Bharamgoudar 2018
- CholeS Study Group score
- elective cholecystectomy duration score
- gallbladder surgery duration points
- CholeS Table 3
- LC duration score
- intraoperative cholangiogram score
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/choles_score?age=35&sex=female&indication=pancreatitis&bmi_kg_m2=24&cbd_diameter=normal&gallbladder_wall=normal&pre_operative_ct=false&planned_intraop_cholangiogram=false&previous_surgical_admissions=0&asa_class=1
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/choles_score?age=35&sex=female&indication=pancreatitis&bmi_kg_m2=24&cbd_diameter=normal&gallbladder_wall=normal&pre_operative_ct=false&planned_intraop_cholangiogram=false&previous_surgical_admissions=0&asa_class=1"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (integer 18-120). Bharamgoudar 2018 Table 3: <40 scores 0; ≥40 scores 1.5. Age 39 scores 0; 40 scores 1.5. |
sex |
string | required · female, male | female or male. Female scores 0; male scores 1 (Bharamgoudar 2018 Table 3). |
indication |
string | required · pancreatitis, colic_dyskinesia_polyp, cbd_stone, acalculous_cholecystitis | Caller-assigned indication for elective laparoscopic cholecystectomy (Bharamgoudar 2018 Table 3). pancreatitis scores 0. colic_dyskinesia_polyp (biliary colic, biliary dyskinesia, or gallbladder polyp) scores 0.5. cbd_stone scores 2. acalculous_cholecystitis scores 2.5. magent does not diagnose the indication. |
bmi_kg_m2 |
number | required | Body-mass index in kg/m^2 (10-80). Caller-supplied; magent does not compute BMI from height and weight. Bharamgoudar 2018 Table 3: <25 scores 0; 25-35 inclusive scores 1; >35 scores 2. 25.0 and 35.0 score 1; 36 scores 2. |
cbd_diameter |
string | required · normal, dilated | Caller-assigned common bile duct diameter (Bharamgoudar 2018 Table 3). normal scores 0; dilated scores 2. magent does not image the gallbladder or measure the CBD. |
gallbladder_wall |
string | required · normal, thick | Caller-assigned gallbladder wall (Bharamgoudar 2018 Table 3). normal scores 0; thick scores 1.5. magent does not image the gallbladder. |
pre_operative_ct |
boolean | required | Pre-operative CT as assigned by the caller (Bharamgoudar 2018 Table 3). true scores 1.5. magent does not read imaging. |
planned_intraop_cholangiogram |
boolean | required | Planned intraoperative cholangiogram as assigned by the caller (Bharamgoudar 2018 Table 3). true scores 3. magent does not plan the operation. |
previous_surgical_admissions |
integer | required | Previous surgical admissions, integer 0-20 (Bharamgoudar 2018 Table 3). 0 scores 0; 1-2 scores 1; >2 scores 2.5. |
asa_class |
integer | required | ASA physical status class, integer 1-5 (Bharamgoudar 2018 Table 3; Gupta 2011 1-5 range). 1 scores 0; 2 scores 1; 3-5 scores 2.5. magent does not assign ASA class. |
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": [
{
"age": "35",
"asa_class": "1",
"bmi_kg_m2": "24",
"cbd_diameter": "normal",
"gallbladder_wall": "normal",
"indication": "pancreatitis",
"planned_intraop_cholangiogram": "false",
"pre_operative_ct": "false",
"previous_surgical_admissions": "0",
"sex": "female"
},
{
"age": "35",
"asa_class": "1",
"bmi_kg_m2": "24",
"cbd_diameter": "normal",
"gallbladder_wall": "normal",
"indication": "pancreatitis",
"planned_intraop_cholangiogram": "false",
"pre_operative_ct": "false",
"previous_surgical_admissions": "0",
"sex": "female"
}
]
}
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/choles_score",
"items": [
{
"components": [
{
"value": 35,
"factor": "age",
"points": 0,
"present": true
},
{
"value": "female",
"factor": "sex",
"points": 0,
"present": true
},
{
"value": "pancreatitis",
"factor": "indication",
"points": 0,
"present": true
},
{
"value": 24.0,
"factor": "bmi_kg_m2",
"points": 0,
"present": true
},
{
"value": "normal",
"factor": "cbd_diameter",
"points": 0,
"present": true
},
{
"value": "normal",
"factor": "gallbladder_wall",
"points": 0,
"present": true
},
{
"factor": "pre_operative_ct",
"points": 0,
"present": true
},
{
"factor": "planned_intraop_cholangiogram",
"points": 0,
"present": true
},
{
"value": 0,
"factor": "previous_surgical_admissions",
"points": 0,
"present": true
},
{
"value": 1,
"factor": "asa_class",
"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": "Bharamgoudar R, Sonsale A, Hodson J, Griffiths E; CholeS Study Group, West Midlands Research Collaborative",
"doi": "10.1007/s00464-018-6030-6",
"id": "bharamgoudar-2018",
"pmid": "29340820",
"source": "Surg Endosc. 2018;32(7):3149-3157",
"title": "The development and validation of a scoring tool to predict the operative duration of elective laparoscopic cholecystectomy"
},
"formula": "choles_score",
"formula_expression": "CholeS = age (<40 0, >=40 1.5) + sex (female 0, male 1) + indication (pancreatitis 0, colic_dyskinesia_polyp 0.5, cbd_stone 2, acalculous_cholecystitis 2.5) + bmi_kg_m2 (<25 0, 25-35 inclusive 1, >35 2) + cbd_diameter (normal 0, dilated 2) + gallbladder_wall (normal 0, thick 1.5) + pre_operative_ct (true 1.5) + planned_intraop_cholangiogram (true 3) + previous_surgical_admissions (0 0, 1-2 1, >2 2.5) + asa_class (1 0, 2 1, 3-5 2.5); Bharamgoudar 2018 Table 3; max 20; numeric total only, no duration or risk bands",
"max_score": 20,
"score": 0,
"age_years": 35,
"sex": "female",
"asa_class": 1,
"bmi_kg_m2": 24.0,
"cbd_diameter": "normal",
"gallbladder_wall": "normal",
"indication": "pancreatitis",
"planned_intraop_cholangiogram": false,
"pre_operative_ct": false,
"previous_surgical_admissions": 0
},
{
"components": [
{
"value": 35,
"factor": "age",
"points": 0,
"present": true
},
{
"value": "female",
"factor": "sex",
"points": 0,
"present": true
},
{
"value": "pancreatitis",
"factor": "indication",
"points": 0,
"present": true
},
{
"value": 24.0,
"factor": "bmi_kg_m2",
"points": 0,
"present": true
},
{
"value": "normal",
"factor": "cbd_diameter",
"points": 0,
"present": true
},
{
"value": "normal",
"factor": "gallbladder_wall",
"points": 0,
"present": true
},
{
"factor": "pre_operative_ct",
"points": 0,
"present": true
},
{
"factor": "planned_intraop_cholangiogram",
"points": 0,
"present": true
},
{
"value": 0,
"factor": "previous_surgical_admissions",
"points": 0,
"present": true
},
{
"value": 1,
"factor": "asa_class",
"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": "Bharamgoudar R, Sonsale A, Hodson J, Griffiths E; CholeS Study Group, West Midlands Research Collaborative",
"doi": "10.1007/s00464-018-6030-6",
"id": "bharamgoudar-2018",
"pmid": "29340820",
"source": "Surg Endosc. 2018;32(7):3149-3157",
"title": "The development and validation of a scoring tool to predict the operative duration of elective laparoscopic cholecystectomy"
},
"formula": "choles_score",
"formula_expression": "CholeS = age (<40 0, >=40 1.5) + sex (female 0, male 1) + indication (pancreatitis 0, colic_dyskinesia_polyp 0.5, cbd_stone 2, acalculous_cholecystitis 2.5) + bmi_kg_m2 (<25 0, 25-35 inclusive 1, >35 2) + cbd_diameter (normal 0, dilated 2) + gallbladder_wall (normal 0, thick 1.5) + pre_operative_ct (true 1.5) + planned_intraop_cholangiogram (true 3) + previous_surgical_admissions (0 0, 1-2 1, >2 2.5) + asa_class (1 0, 2 1, 3-5 2.5); Bharamgoudar 2018 Table 3; max 20; numeric total only, no duration or risk bands",
"max_score": 20,
"score": 0,
"age_years": 35,
"sex": "female",
"asa_class": 1,
"bmi_kg_m2": 24.0,
"cbd_diameter": "normal",
"gallbladder_wall": "normal",
"indication": "pancreatitis",
"planned_intraop_cholangiogram": false,
"pre_operative_ct": false,
"previous_surgical_admissions": 0
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | choles_score |
formula_expression |
string | Exact expression used |
score |
number | Bharamgoudar 2018 Table 3 points 0-20 (half-points allowed; not integer-rounded). Numeric total only; not a duration or risk band. |
max_score |
integer | Always 20 |
age_years |
integer | Age used for the exclusive age band |
sex |
string | female or male used for the sex points |
indication |
string | Exclusive indication used (pancreatitis, colic_dyskinesia_polyp, cbd_stone, or acalculous_cholecystitis) |
bmi_kg_m2 |
number | BMI in kg/m^2 used for the exclusive BMI band |
cbd_diameter |
string | Caller-assigned CBD diameter used (normal or dilated) |
gallbladder_wall |
string | Caller-assigned gallbladder wall used (normal or thick) |
pre_operative_ct |
boolean | Whether pre-operative CT was assigned true |
planned_intraop_cholangiogram |
boolean | Whether planned intraoperative cholangiogram was assigned true |
previous_surgical_admissions |
integer | Previous surgical admissions used (0-20) |
asa_class |
integer | ASA class used (1-5) |
components |
array | Per-factor Bharamgoudar 2018 Table 3 points |
citation |
object | Bharamgoudar et al. Surg Endosc 2018 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 35,
"factor": "age",
"points": 0,
"present": true
},
{
"value": "female",
"factor": "sex",
"points": 0,
"present": true
},
{
"value": "pancreatitis",
"factor": "indication",
"points": 0,
"present": true
},
{
"value": 24.0,
"factor": "bmi_kg_m2",
"points": 0,
"present": true
},
{
"value": "normal",
"factor": "cbd_diameter",
"points": 0,
"present": true
},
{
"value": "normal",
"factor": "gallbladder_wall",
"points": 0,
"present": true
},
{
"factor": "pre_operative_ct",
"points": 0,
"present": true
},
{
"factor": "planned_intraop_cholangiogram",
"points": 0,
"present": true
},
{
"value": 0,
"factor": "previous_surgical_admissions",
"points": 0,
"present": true
},
{
"value": 1,
"factor": "asa_class",
"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": "Bharamgoudar R, Sonsale A, Hodson J, Griffiths E; CholeS Study Group, West Midlands Research Collaborative",
"doi": "10.1007/s00464-018-6030-6",
"id": "bharamgoudar-2018",
"pmid": "29340820",
"source": "Surg Endosc. 2018;32(7):3149-3157",
"title": "The development and validation of a scoring tool to predict the operative duration of elective laparoscopic cholecystectomy"
},
"formula": "choles_score",
"formula_expression": "CholeS = age (<40 0, >=40 1.5) + sex (female 0, male 1) + indication (pancreatitis 0, colic_dyskinesia_polyp 0.5, cbd_stone 2, acalculous_cholecystitis 2.5) + bmi_kg_m2 (<25 0, 25-35 inclusive 1, >35 2) + cbd_diameter (normal 0, dilated 2) + gallbladder_wall (normal 0, thick 1.5) + pre_operative_ct (true 1.5) + planned_intraop_cholangiogram (true 3) + previous_surgical_admissions (0 0, 1-2 1, >2 2.5) + asa_class (1 0, 2 1, 3-5 2.5); Bharamgoudar 2018 Table 3; max 20; numeric total only, no duration or risk bands",
"max_score": 20,
"score": 0,
"age_years": 35,
"sex": "female",
"asa_class": 1,
"bmi_kg_m2": 24.0,
"cbd_diameter": "normal",
"gallbladder_wall": "normal",
"indication": "pancreatitis",
"planned_intraop_cholangiogram": false,
"pre_operative_ct": false,
"previous_surgical_admissions": 0
}
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_sex |
sex must be female or male Returned before settlement; you are not charged. |
| 400 | invalid_bmi_kg_m2 |
bmi_kg_m2 must be a number from 10 to 80. Returned before settlement; you are not charged. |
| 400 | invalid_asa_class |
asa_class must be an integer from 1 to 5 (Gupta 2011 ASA physical status). 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_choles |
indication must be pancreatitis, colic_dyskinesia_polyp, cbd_stone, or acalculous_cholecystitis; cbd_diameter normal or dilated; gallbladder_wall normal or thick; previous_surgical_admissions an integer 0-20 (Bharamgoudar 2018 CholeS Table 3). 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
- Tokyo cholangitis — Apply Kiriyama 2018 Tokyo Guidelines 2018 diagnostic criteria and severity grading of acute cholangitis (unchanged from TG13) and return diagnosis (definite, suspected, or none) and severity (grade_i, grade_ii, grade_iii, or none) from caller-assigned flags and age.
- 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.
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.