GI · LIVE
Los Angeles classification of oesophagitis
LA grading
Apply Lundell 1999 Table 1 Los Angeles classification of oesophagitis and return la_grade (none, A, B, C, or D) from four caller-assigned endoscopic flags.
Markdown: /docs/la-grading.md · Canonical: https://magentlab.com/docs/la-grading
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply Lundell 1999 Table 1 Los Angeles classification of oesophagitis and return la_grade (none, A, B, C, or D) from four caller-assigned endoscopic flags.
When to use
When an agent already has endoscopic mucosal-break flags as assigned at endoscopy (presence of a mucosal break, longest break more than 5 mm, continuity between fold tops, and at least 75% circumference) and needs the published 1999 LA grade. magent does not interpret endoscopy images.
When not to use
- Not a medical device.
- Not a GERD diagnosis. magent does not diagnose gastro-oesophageal reflux disease.
- The caller assigns the four endoscopic flags. magent does not interpret endoscopy images.
- This tool is Lundell 1999 Table 1 Los Angeles classification only. Not Savary-Miller. Not Barrett or stricture grading (the paper records those separately). Not the 1994 proposed LA system (grade D was fully circumferential; 1999 changed D to at least 75% of circumference).
- Absence of a mucosal break returns none. That is not a minimal changes grade; Lundell 1999 found those changes unreliable.
Formula
la_grade is none if mucosal_break is false (no LA A-D; not minimal changes); else D if circumference_ge_75_percent (mucosal break(s) involve at least 75% of the oesophageal circumference); else C if continuous_between_folds (continuous between the tops of two or more mucosal folds but less than 75% of circumference); else B if longest_break_gt_5_mm (one or more breaks more than 5 mm that do not extend between the tops of two mucosal folds); else A (one or more breaks no longer than 5 mm that do not extend between the tops of two mucosal folds) (Lundell 1999 Table 1 Los Angeles classification)
Citation
- Authors
- Lundell LR, Dent J, Bennett JR, Blum AL, Armstrong D, Galmiche JP, Johnson F, Hongo M, Richter JE, Spechler SJ, Tytgat GN, Wallin L
- Source
- Gut. 1999;45(2):172-180
Worked example
No mucosal break
Given:
circumference_ge_75_percent=falsecontinuous_between_folds=falselongest_break_gt_5_mm=falsemucosal_break=false
- mucosal_break is false (no mucosal break as assigned)
- longest_break_gt_5_mm, continuous_between_folds, and circumference_ge_75_percent are required and false; they do not change the result
- la_grade is none (no LA A-D; not minimal changes)
Mucosal breaks no longer than 5 mm, not between fold tops
Given:
circumference_ge_75_percent=falsecontinuous_between_folds=falselongest_break_gt_5_mm=falsemucosal_break=true
- mucosal_break is true
- circumference_ge_75_percent is false (not D)
- continuous_between_folds is false (not C)
- longest_break_gt_5_mm is false (not B)
- la_grade is A
Also searched as
- Los Angeles classification
- LA grade oesophagitis
- Lundell 1999
- Los Angeles esophagitis
- LA classification A B C D
- mucosal break oesophagitis
- reflux oesophagitis LA grade
- LA 1999 oesophagitis
- Los Angeles grading
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/la_grading?mucosal_break=false&longest_break_gt_5_mm=false&continuous_between_folds=false&circumference_ge_75_percent=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/la_grading?mucosal_break=false&longest_break_gt_5_mm=false&continuous_between_folds=false&circumference_ge_75_percent=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
mucosal_break |
boolean | required | One or more mucosal breaks present, as assigned by the caller. Lundell 1999 defines a mucosal break as an area of slough or erythema with a discrete line of demarcation from adjacent more normal-looking mucosa. true or false. If false, la_grade is none (no LA A-D; not minimal changes). magent does not interpret endoscopy images. |
longest_break_gt_5_mm |
boolean | required | Longest mucosal break more than 5 mm long, as assigned by the caller (Lundell 1999 Table 1 grade B vs A). true or false. Required even when mucosal_break is false (does not change none). magent does not measure lesions. |
continuous_between_folds |
boolean | required | A mucosal break is continuous between the tops of two or more mucosal folds, as assigned by the caller (Lundell 1999 Table 1 grade C). true or false. Required even when mucosal_break is false (does not change none). magent does not interpret endoscopy images. |
circumference_ge_75_percent |
boolean | required | Mucosal break(s) involve at least 75% of the oesophageal circumference, as assigned by the caller (Lundell 1999 Table 1 grade D; the 1999 revision, not the 1994 fully circumferential proposal). true or false. Required even when mucosal_break is false (does not change none). magent does not interpret endoscopy images. |
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": [
{
"circumference_ge_75_percent": "false",
"continuous_between_folds": "false",
"longest_break_gt_5_mm": "false",
"mucosal_break": "false"
},
{
"circumference_ge_75_percent": "false",
"continuous_between_folds": "false",
"longest_break_gt_5_mm": "false",
"mucosal_break": "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/la_grading",
"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": "Lundell LR, Dent J, Bennett JR, Blum AL, Armstrong D, Galmiche JP, Johnson F, Hongo M, Richter JE, Spechler SJ, Tytgat GN, Wallin L",
"doi": "10.1136/gut.45.2.172",
"id": "lundell-1999",
"pmid": "10403727",
"source": "Gut. 1999;45(2):172-180",
"title": "Endoscopic assessment of oesophagitis: clinical and functional correlates and further validation of the Los Angeles classification"
},
"formula": "la_grading",
"formula_expression": "la_grade is none if mucosal_break is false (no LA A-D; not minimal changes); else D if circumference_ge_75_percent (mucosal break(s) involve at least 75% of the oesophageal circumference); else C if continuous_between_folds (continuous between the tops of two or more mucosal folds but less than 75% of circumference); else B if longest_break_gt_5_mm (one or more breaks more than 5 mm that do not extend between the tops of two mucosal folds); else A (one or more breaks no longer than 5 mm that do not extend between the tops of two mucosal folds) (Lundell 1999 Table 1 Los Angeles classification)",
"criteria": [
{
"factor": "mucosal_break",
"met": false
},
{
"factor": "longest_break_gt_5_mm",
"met": false
},
{
"factor": "continuous_between_folds",
"met": false
},
{
"factor": "circumference_ge_75_percent",
"met": false
},
{
"factor": "none",
"met": true
},
{
"factor": "A",
"met": false
},
{
"factor": "B",
"met": false
},
{
"factor": "C",
"met": false
},
{
"factor": "D",
"met": false
}
],
"la_grade": "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": "Lundell LR, Dent J, Bennett JR, Blum AL, Armstrong D, Galmiche JP, Johnson F, Hongo M, Richter JE, Spechler SJ, Tytgat GN, Wallin L",
"doi": "10.1136/gut.45.2.172",
"id": "lundell-1999",
"pmid": "10403727",
"source": "Gut. 1999;45(2):172-180",
"title": "Endoscopic assessment of oesophagitis: clinical and functional correlates and further validation of the Los Angeles classification"
},
"formula": "la_grading",
"formula_expression": "la_grade is none if mucosal_break is false (no LA A-D; not minimal changes); else D if circumference_ge_75_percent (mucosal break(s) involve at least 75% of the oesophageal circumference); else C if continuous_between_folds (continuous between the tops of two or more mucosal folds but less than 75% of circumference); else B if longest_break_gt_5_mm (one or more breaks more than 5 mm that do not extend between the tops of two mucosal folds); else A (one or more breaks no longer than 5 mm that do not extend between the tops of two mucosal folds) (Lundell 1999 Table 1 Los Angeles classification)",
"criteria": [
{
"factor": "mucosal_break",
"met": false
},
{
"factor": "longest_break_gt_5_mm",
"met": false
},
{
"factor": "continuous_between_folds",
"met": false
},
{
"factor": "circumference_ge_75_percent",
"met": false
},
{
"factor": "none",
"met": true
},
{
"factor": "A",
"met": false
},
{
"factor": "B",
"met": false
},
{
"factor": "C",
"met": false
},
{
"factor": "D",
"met": false
}
],
"la_grade": "none"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | la_grading |
formula_expression |
string | Published Lundell 1999 Table 1 Los Angeles classification rule |
la_grade |
string | none, A, B, C, or D. none if no mucosal break; D if break(s) involve at least 75% of circumference; C if continuous between fold tops but less than 75%; B if longest break more than 5 mm and not between fold tops; A if break(s) no longer than 5 mm and not between fold tops. Not a GERD diagnosis. |
criteria |
array | Per-factor rows with factor and met for the four caller-assigned flags and exclusive grades none, A, B, C, D; exactly one grade row is met |
citation |
object | Lundell 1999 Gut 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": "Lundell LR, Dent J, Bennett JR, Blum AL, Armstrong D, Galmiche JP, Johnson F, Hongo M, Richter JE, Spechler SJ, Tytgat GN, Wallin L",
"doi": "10.1136/gut.45.2.172",
"id": "lundell-1999",
"pmid": "10403727",
"source": "Gut. 1999;45(2):172-180",
"title": "Endoscopic assessment of oesophagitis: clinical and functional correlates and further validation of the Los Angeles classification"
},
"formula": "la_grading",
"formula_expression": "la_grade is none if mucosal_break is false (no LA A-D; not minimal changes); else D if circumference_ge_75_percent (mucosal break(s) involve at least 75% of the oesophageal circumference); else C if continuous_between_folds (continuous between the tops of two or more mucosal folds but less than 75% of circumference); else B if longest_break_gt_5_mm (one or more breaks more than 5 mm that do not extend between the tops of two mucosal folds); else A (one or more breaks no longer than 5 mm that do not extend between the tops of two mucosal folds) (Lundell 1999 Table 1 Los Angeles classification)",
"criteria": [
{
"factor": "mucosal_break",
"met": false
},
{
"factor": "longest_break_gt_5_mm",
"met": false
},
{
"factor": "continuous_between_folds",
"met": false
},
{
"factor": "circumference_ge_75_percent",
"met": false
},
{
"factor": "none",
"met": true
},
{
"factor": "A",
"met": false
},
{
"factor": "B",
"met": false
},
{
"factor": "C",
"met": false
},
{
"factor": "D",
"met": false
}
],
"la_grade": "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
- Forrest — Return the Forrest 1974 endoscopic lesion class (ia, ib, iia, iib, iic, or iii) and published description from a caller-assigned token.
- Rome IV FD — Apply the Stanghellini 2016 Rome IV B1 functional dyspepsia criteria and return whether PDS (B1a), EPS (B1b), and the published FD box hold (rome_iv_fd).
- Travis criteria — Apply the Travis 1996 day-3 of intravenous corticosteroids rule for severe ulcerative colitis and return travis_high from stools_per_day and crp_mg_l.
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.