Infection / VTE · LIVE
Shapiro blood culture rule
Apply the Shapiro 2008 major/minor blood-culture prediction rule and return whether culture is indicated from caller-assigned findings and labs.
Markdown: /docs/shapiro.md · Canonical: https://magentlab.com/docs/shapiro
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply the Shapiro 2008 major/minor blood-culture prediction rule and return whether culture is indicated from caller-assigned findings and labs.
When to use
When an agent has caller-assigned adult ED findings and labs and needs the Shapiro 2008 prediction rule for whether blood culture is indicated, not a culture order and not a sepsis diagnosis.
When not to use
- Not a medical device. Not a diagnosis of bacteremia, sepsis, or endocarditis. magent does not examine the patient.
- magent does not draw blood cultures or order cultures. culture_indicated is the published 2008 rule only.
- Shapiro 2008 major/minor rule only (indicated if ≥1 major or ≥2 minor). Not a later point encoding of the same items.
- Temperature major (>39.5 °C) and minor (38.3–39.4 °C) are derived from one temperature_c; they cannot both be true. 39.5 °C is neither band.
- Age >65 is a minor; 65 is not. Hypotension is a caller-assigned flag for systolic blood pressure <90 mm Hg; magent does not take a blood pressure.
- The caller assigns every flag and lab. magent does not inspect catheters, diagnose endocarditis, or assay a CBC or creatinine.
- Published for adults ≥18 years undergoing ED blood-culture decisions. Not SIRS, not qSOFA, and not a sepsis protocol.
Formula
culture indicated if ≥1 major (temperature_c > 39.5, catheter, suspected_endocarditis) or ≥2 minor (temperature_c 38.3–39.4, age > 65, chills, vomiting, hypotension, neutrophil_percent > 80, wbc_k > 18, bands_percent > 5, platelets_k < 150, creatinine_mg_dl > 2.0) (Shapiro 2008)
Citation
- Authors
- Shapiro NI, Wolfe RE, Wright SB, Moore R, Bates DW
- Source
- J Emerg Med. 2008;35(3):255-264
Worked example
No major or minor criteria
Given:
age=40bands_percent=2catheter=falsechills=falsecreatinine_mg_dl=1.0hypotension=falseneutrophil_percent=70platelets_k=250suspected_endocarditis=falsetemperature_c=37.0vomiting=falsewbc_k=10
- Age 40 is not >65; temperature 37.0 °C is neither >39.5 nor 38.3–39.4
- Catheter, endocarditis suspicion, chills, vomiting, and hypotension are false
- Labs are outside every minor cutoff (0 major, 0 minor)
- Culture is not indicated
One major (indwelling catheter)
Given:
age=40bands_percent=2catheter=truechills=falsecreatinine_mg_dl=1.0hypotension=falseneutrophil_percent=70platelets_k=250suspected_endocarditis=falsetemperature_c=37.0vomiting=falsewbc_k=10
- Indwelling vascular catheter is a major criterion
- Culture is indicated (≥1 major)
Two minors without a major
Given:
age=40bands_percent=2catheter=falsechills=truecreatinine_mg_dl=1.0hypotension=falseneutrophil_percent=70platelets_k=250suspected_endocarditis=falsetemperature_c=37.0vomiting=truewbc_k=10
- No major criterion
- Chills and vomiting are two minor criteria
- Culture is indicated (≥2 minor)
Also searched as
- Shapiro blood culture rule
- Shapiro bacteremia rule
- who needs a blood culture
- blood culture prediction rule
- Shapiro 2008 criteria
- major minor blood culture criteria
- ED blood culture rule
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/shapiro?age=40&temperature_c=37.0&catheter=false&suspected_endocarditis=false&chills=false&vomiting=false&hypotension=false&neutrophil_percent=70&wbc_k=10&bands_percent=2&platelets_k=250&creatinine_mg_dl=1.0
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/shapiro?age=40&temperature_c=37.0&catheter=false&suspected_endocarditis=false&chills=false&vomiting=false&hypotension=false&neutrophil_percent=70&wbc_k=10&bands_percent=2&platelets_k=250&creatinine_mg_dl=1.0"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (integer 18-120). Age >65 is a Shapiro 2008 minor criterion; 65 is not. The published rule is for adults ≥18 years. |
temperature_c |
number | required | Temperature in °C (30.0-45.0). Major when >39.5 (39.5 is not). Minor when 38.3–39.4 inclusive. magent does not measure temperature. |
catheter |
boolean | required | Indwelling vascular catheter (Shapiro 2008 major). true or false as assigned by the caller. magent does not inspect lines. |
suspected_endocarditis |
boolean | required | Clinical suspicion of endocarditis (Shapiro 2008 major). true or false as assigned by the caller. magent does not diagnose endocarditis. |
chills |
boolean | required | Chills (Shapiro 2008 minor). true or false as assigned by the caller. magent does not take a history. |
vomiting |
boolean | required | Vomiting (Shapiro 2008 minor). true or false as assigned by the caller. magent does not observe vomiting. |
hypotension |
boolean | required | Hypotension (Shapiro 2008 minor: systolic blood pressure < 90 mm Hg). true or false as assigned by the caller. magent does not measure blood pressure. |
neutrophil_percent |
number | required | Neutrophil percent (0-100). Shapiro 2008 minor when >80 (80 does not). magent does not assay a CBC. |
wbc_k |
number | required | White blood cell count in thousands (0-500; same as 10^3/µL). Shapiro 2008 minor when >18 (18 does not). magent does not assay a CBC. |
bands_percent |
number | required | Band percent (0-100). Shapiro 2008 minor when >5 (5 does not). magent does not assay a CBC. |
platelets_k |
number | required | Platelet count in thousands (0-2000; same as 10^3/µL). Shapiro 2008 minor when <150 (150 does not). magent does not assay a CBC. |
creatinine_mg_dl |
number | required | Creatinine in mg/dL (0.1-20.0). Shapiro 2008 minor when >2.0 (2.0 does not). magent does not assay creatinine. |
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": "40",
"bands_percent": "2",
"catheter": "false",
"chills": "false",
"creatinine_mg_dl": "1.0",
"hypotension": "false",
"neutrophil_percent": "70",
"platelets_k": "250",
"suspected_endocarditis": "false",
"temperature_c": "37.0",
"vomiting": "false",
"wbc_k": "10"
},
{
"age": "40",
"bands_percent": "2",
"catheter": "false",
"chills": "false",
"creatinine_mg_dl": "1.0",
"hypotension": "false",
"neutrophil_percent": "70",
"platelets_k": "250",
"suspected_endocarditis": "false",
"temperature_c": "37.0",
"vomiting": "false",
"wbc_k": "10"
}
]
}
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/shapiro",
"items": [
{
"age": 40,
"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": "Shapiro NI, Wolfe RE, Wright SB, Moore R, Bates DW",
"doi": "10.1016/j.jemermed.2008.04.001",
"id": "shapiro-2008",
"pmid": "18486413",
"source": "J Emerg Med. 2008;35(3):255-264",
"title": "Who needs a blood culture? A prospectively derived and validated prediction rule"
},
"formula": "shapiro",
"formula_expression": "culture indicated if ≥1 major (temperature_c > 39.5, catheter, suspected_endocarditis) or ≥2 minor (temperature_c 38.3–39.4, age > 65, chills, vomiting, hypotension, neutrophil_percent > 80, wbc_k > 18, bands_percent > 5, platelets_k < 150, creatinine_mg_dl > 2.0) (Shapiro 2008)",
"temperature_c": 37.0,
"criteria": [
{
"value": 37.0,
"factor": "temperature_gt_39_5",
"met": false
},
{
"factor": "catheter",
"met": false
},
{
"factor": "suspected_endocarditis",
"met": false
},
{
"value": 37.0,
"factor": "temperature_38_3_to_39_4",
"met": false
},
{
"value": 40,
"factor": "age_gt_65",
"met": false
},
{
"factor": "chills",
"met": false
},
{
"factor": "vomiting",
"met": false
},
{
"factor": "hypotension",
"met": false
},
{
"value": 70.0,
"factor": "neutrophil_gt_80",
"met": false
},
{
"value": 10.0,
"factor": "wbc_gt_18k",
"met": false
},
{
"value": 2.0,
"factor": "bands_gt_5",
"met": false
},
{
"value": 250.0,
"factor": "platelets_lt_150k",
"met": false
},
{
"value": 1.0,
"factor": "creatinine_gt_2",
"met": false
}
],
"major_count": 0,
"minor_count": 0,
"culture_indicated": false
},
{
"age": 40,
"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": "Shapiro NI, Wolfe RE, Wright SB, Moore R, Bates DW",
"doi": "10.1016/j.jemermed.2008.04.001",
"id": "shapiro-2008",
"pmid": "18486413",
"source": "J Emerg Med. 2008;35(3):255-264",
"title": "Who needs a blood culture? A prospectively derived and validated prediction rule"
},
"formula": "shapiro",
"formula_expression": "culture indicated if ≥1 major (temperature_c > 39.5, catheter, suspected_endocarditis) or ≥2 minor (temperature_c 38.3–39.4, age > 65, chills, vomiting, hypotension, neutrophil_percent > 80, wbc_k > 18, bands_percent > 5, platelets_k < 150, creatinine_mg_dl > 2.0) (Shapiro 2008)",
"temperature_c": 37.0,
"criteria": [
{
"value": 37.0,
"factor": "temperature_gt_39_5",
"met": false
},
{
"factor": "catheter",
"met": false
},
{
"factor": "suspected_endocarditis",
"met": false
},
{
"value": 37.0,
"factor": "temperature_38_3_to_39_4",
"met": false
},
{
"value": 40,
"factor": "age_gt_65",
"met": false
},
{
"factor": "chills",
"met": false
},
{
"factor": "vomiting",
"met": false
},
{
"factor": "hypotension",
"met": false
},
{
"value": 70.0,
"factor": "neutrophil_gt_80",
"met": false
},
{
"value": 10.0,
"factor": "wbc_gt_18k",
"met": false
},
{
"value": 2.0,
"factor": "bands_gt_5",
"met": false
},
{
"value": 250.0,
"factor": "platelets_lt_150k",
"met": false
},
{
"value": 1.0,
"factor": "creatinine_gt_2",
"met": false
}
],
"major_count": 0,
"minor_count": 0,
"culture_indicated": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | shapiro |
formula_expression |
string | Shapiro 2008 rule: culture if ≥1 major or ≥2 minor |
culture_indicated |
boolean | true when ≥1 major criterion or ≥2 minor criteria are met (Shapiro 2008). Not a diagnosis and not a culture order. |
major_count |
integer | Count of major criteria met (0-3) |
minor_count |
integer | Count of minor criteria met (0-10) |
age |
integer | Age used for the age >65 minor criterion |
temperature_c |
number | Temperature in °C used for the >39.5 major and 38.3–39.4 minor bands |
criteria |
array | Per-factor rows with factor and met; temperature, age, and lab rows include value |
citation |
object | Shapiro 2008 J Emerg Med citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"age": 40,
"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": "Shapiro NI, Wolfe RE, Wright SB, Moore R, Bates DW",
"doi": "10.1016/j.jemermed.2008.04.001",
"id": "shapiro-2008",
"pmid": "18486413",
"source": "J Emerg Med. 2008;35(3):255-264",
"title": "Who needs a blood culture? A prospectively derived and validated prediction rule"
},
"formula": "shapiro",
"formula_expression": "culture indicated if ≥1 major (temperature_c > 39.5, catheter, suspected_endocarditis) or ≥2 minor (temperature_c 38.3–39.4, age > 65, chills, vomiting, hypotension, neutrophil_percent > 80, wbc_k > 18, bands_percent > 5, platelets_k < 150, creatinine_mg_dl > 2.0) (Shapiro 2008)",
"temperature_c": 37.0,
"criteria": [
{
"value": 37.0,
"factor": "temperature_gt_39_5",
"met": false
},
{
"factor": "catheter",
"met": false
},
{
"factor": "suspected_endocarditis",
"met": false
},
{
"value": 37.0,
"factor": "temperature_38_3_to_39_4",
"met": false
},
{
"value": 40,
"factor": "age_gt_65",
"met": false
},
{
"factor": "chills",
"met": false
},
{
"factor": "vomiting",
"met": false
},
{
"factor": "hypotension",
"met": false
},
{
"value": 70.0,
"factor": "neutrophil_gt_80",
"met": false
},
{
"value": 10.0,
"factor": "wbc_gt_18k",
"met": false
},
{
"value": 2.0,
"factor": "bands_gt_5",
"met": false
},
{
"value": 250.0,
"factor": "platelets_lt_150k",
"met": false
},
{
"value": 1.0,
"factor": "creatinine_gt_2",
"met": false
}
],
"major_count": 0,
"minor_count": 0,
"culture_indicated": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_shapiro |
Shapiro-rule inputs must be the 2008 major and minor bacteremia criteria (temperature, catheter, endocarditis suspicion, age, chills, vomiting, hypotension, and listed labs). 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
- SIRS — Compute the Bone 1992 ACCP/SCCM SIRS criteria from temperature, heart rate, respiratory rate, and WBC, with optional PaCO2 and band percent.
- qSOFA — Compute the Sepsis-3 qSOFA score from respiratory rate, caller-assigned altered mentation, and systolic blood pressure.
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.