Lipids · LIVE
MEDPED US total cholesterol
MEDPED
Apply the Williams 1993 US MEDPED total cholesterol tables and return whether caller-supplied total cholesterol exceeds the cutoff for that age and relative degree. Not a diagnosis.
Markdown: /docs/medped.md · Canonical: https://magentlab.com/docs/medped
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply the Williams 1993 US MEDPED total cholesterol tables and return whether caller-supplied total cholesterol exceeds the cutoff for that age and relative degree. Not a diagnosis.
When to use
When an agent already has age, a caller-assigned relative degree (first, second, third, or general population), and one total cholesterol value, and needs the published US MEDPED cutoff comparison. magent does not assay lipids or take a pedigree.
When not to use
- Not a medical device. Not a diagnosis of familial hypercholesterolemia.
- Williams 1993 US MEDPED total cholesterol tables only. Does not implement Dutch Lipid Clinic Network or Simon Broome criteria.
- Does not use LDL cholesterol cutoffs from later reprints. Total cholesterol only.
- magent does not assay lipids or take a pedigree. The caller assigns relative_degree and supplies exactly one total cholesterol value.
Formula
meets_criteria iff total_cholesterol_mg_dl > cutoff_mg_dl (Williams 1993 US MEDPED total cholesterol); mmol/L converted as mg/dL = mmol/L * 38.67; age <20: first 220, second 230, third 240, general_population 270; 20-29: 240/250/260/290; 30-39: 270/280/290/340; >=40: 290/300/310/360
Citation
- Authors
- Williams RR, Hunt SC, Schumacher MC, Hegele RA, Leppert MF, Ludwig EH, Hopkins PN
- Source
- Am J Cardiol. 1993;72(2):171-176
Worked example
Age 50, general population, total cholesterol 200 mg/dL is below the cutoff
Given:
age=50relative_degree=general_populationtotal_cholesterol_mg_dl=200
- age 50 selects the >=40 row; general_population cutoff is 360 mg/dL
- total_cholesterol_mg_dl 200 is not greater than 360
- meets_criteria false; classification below_cutoff
Also searched as
- MEDPED criteria
- Williams familial hypercholesterolemia
- US MEDPED cholesterol
- Make Early Diagnosis Prevent Early Death
- heterozygous FH cholesterol cutoff
- Williams 1993 FH
- first-degree relative cholesterol FH
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/medped?age=50&relative_degree=general_population&total_cholesterol_mg_dl=200
Full URL: https://api.magentlab.com/api/calc/medped?age=50&relative_degree=general_population&total_cholesterol_mg_dl=200
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/medped?age=50&relative_degree=general_population&total_cholesterol_mg_dl=200"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (integer 1-120). Selects the Williams 1993 US MEDPED total cholesterol row: <20, 20-29, 30-39, or >=40. |
relative_degree |
string | required | Relative degree as assigned by the caller: first, second, third, or general_population (Williams 1993). magent does not take a pedigree. |
total_cholesterol_mg_dl |
number | optional | Total cholesterol in mg/dL (50-800). Provide exactly one of total_cholesterol_mg_dl or total_cholesterol_mmol_l. Meets the published cutoff iff this value is greater than the age- and relative-degree-specific mg/dL cutoff. magent does not assay lipids. |
total_cholesterol_mmol_l |
number | optional | Total cholesterol in mmol/L (1.3-20). Converted as mg/dL = mmol/L * 38.67, then compared with the US MEDPED mg/dL cutoff. Provide exactly one lipid parameter. |
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": "50",
"relative_degree": "general_population",
"total_cholesterol_mg_dl": "200"
},
{
"age": "50",
"relative_degree": "general_population",
"total_cholesterol_mg_dl": "200"
}
]
}
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/medped",
"items": [
{
"age": 50,
"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": "Williams RR, Hunt SC, Schumacher MC, Hegele RA, Leppert MF, Ludwig EH, Hopkins PN",
"doi": "10.1016/0002-9149(93)90155-6",
"id": "williams-1993",
"pmid": "8328379",
"source": "Am J Cardiol. 1993;72(2):171-176",
"title": "Diagnosing heterozygous familial hypercholesterolemia using new practical criteria validated by molecular genetics"
},
"formula": "medped",
"formula_expression": "meets_criteria iff total_cholesterol_mg_dl > cutoff_mg_dl (Williams 1993 US MEDPED total cholesterol); mmol/L converted as mg/dL = mmol/L * 38.67; age <20: first 220, second 230, third 240, general_population 270; 20-29: 240/250/260/290; 30-39: 270/280/290/340; >=40: 290/300/310/360",
"criteria": [
{
"value": 200.0,
"factor": "total_cholesterol_gt_cutoff",
"met": false,
"cutoff_mg_dl": 360
}
],
"total_cholesterol_mg_dl": 200.0,
"classification": "below_cutoff",
"cutoff_mg_dl": 360,
"meets_criteria": false,
"relative_degree": "general_population"
},
{
"age": 50,
"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": "Williams RR, Hunt SC, Schumacher MC, Hegele RA, Leppert MF, Ludwig EH, Hopkins PN",
"doi": "10.1016/0002-9149(93)90155-6",
"id": "williams-1993",
"pmid": "8328379",
"source": "Am J Cardiol. 1993;72(2):171-176",
"title": "Diagnosing heterozygous familial hypercholesterolemia using new practical criteria validated by molecular genetics"
},
"formula": "medped",
"formula_expression": "meets_criteria iff total_cholesterol_mg_dl > cutoff_mg_dl (Williams 1993 US MEDPED total cholesterol); mmol/L converted as mg/dL = mmol/L * 38.67; age <20: first 220, second 230, third 240, general_population 270; 20-29: 240/250/260/290; 30-39: 270/280/290/340; >=40: 290/300/310/360",
"criteria": [
{
"value": 200.0,
"factor": "total_cholesterol_gt_cutoff",
"met": false,
"cutoff_mg_dl": 360
}
],
"total_cholesterol_mg_dl": 200.0,
"classification": "below_cutoff",
"cutoff_mg_dl": 360,
"meets_criteria": false,
"relative_degree": "general_population"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | medped |
formula_expression |
string | Williams 1993 US MEDPED total cholesterol cutoffs |
age |
integer | Echo of the caller-assigned age in years |
relative_degree |
string | first, second, third, or general_population |
total_cholesterol_mg_dl |
number | Total cholesterol in mg/dL (converted when a mmol/L key is used) |
cutoff_mg_dl |
integer | Williams 1993 US MEDPED total cholesterol cutoff in mg/dL for that age and relative degree |
meets_criteria |
boolean | true iff total_cholesterol_mg_dl is greater than cutoff_mg_dl. Equality does not meet. Not a diagnosis. |
classification |
string | meets_criteria when the cutoff is exceeded; otherwise below_cutoff. Not a diagnosis. |
criteria |
array | Tree row for total_cholesterol_gt_cutoff with factor, met, value, and cutoff_mg_dl |
citation |
object | Williams 1993 Am J Cardiol citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"age": 50,
"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": "Williams RR, Hunt SC, Schumacher MC, Hegele RA, Leppert MF, Ludwig EH, Hopkins PN",
"doi": "10.1016/0002-9149(93)90155-6",
"id": "williams-1993",
"pmid": "8328379",
"source": "Am J Cardiol. 1993;72(2):171-176",
"title": "Diagnosing heterozygous familial hypercholesterolemia using new practical criteria validated by molecular genetics"
},
"formula": "medped",
"formula_expression": "meets_criteria iff total_cholesterol_mg_dl > cutoff_mg_dl (Williams 1993 US MEDPED total cholesterol); mmol/L converted as mg/dL = mmol/L * 38.67; age <20: first 220, second 230, third 240, general_population 270; 20-29: 240/250/260/290; 30-39: 270/280/290/340; >=40: 290/300/310/360",
"criteria": [
{
"value": 200.0,
"factor": "total_cholesterol_gt_cutoff",
"met": false,
"cutoff_mg_dl": 360
}
],
"total_cholesterol_mg_dl": 200.0,
"classification": "below_cutoff",
"cutoff_mg_dl": 360,
"meets_criteria": false,
"relative_degree": "general_population"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_medped_age |
age must be an integer from 1 to 120 (Williams 1993). Returned before settlement; you are not charged. |
| 400 | invalid_medped_relation |
relative_degree must be first, second, third, or general_population (Williams 1993). Returned before settlement; you are not charged. |
| 400 | invalid_medped_lipid |
provide exactly one of total_cholesterol_mg_dl (50-800) or total_cholesterol_mmol_l (1.3-20). 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
- Simon Broome — Apply the 1991 Simon Broome Register adult definite familial hypercholesterolaemia rule and return definite or not_definite from one lipid value plus a caller-assigned tendon-xanthoma flag.
- Friedewald LDL-C — Estimate LDL-C from total cholesterol, HDL, and triglycerides using Friedewald 1972.
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.