ACS · LIVE
HEAR score
Compute the HEAR score as age points plus caller-assigned history, ECG, and risk factors (each 0-2). No troponin.
Markdown: /docs/hear.md · Canonical: https://magentlab.com/docs/hear
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute the HEAR score as age points plus caller-assigned history, ECG, and risk factors (each 0-2). No troponin.
When to use
When an agent needs the published Smith 2020 HEAR total (HEART without troponin) and must not invent history, ECG, or risk-factor points from a tracing.
When not to use
- Not a medical device. Not a diagnosis or discharge protocol.
- history, ecg, and risk_factors are caller-assigned integers 0-2. magent does not interpret the history, count risk factors, or read an ECG.
- This is HEAR without troponin (Smith 2020), not the HEART score (Six 2008) and not HEART Pathway. Scores 0 and 1 are the very-low-risk group in that paper (MACE ~0.9%). Do not apply HEART bands 0-3 / 4-6 / 7-10.
Formula
HEAR = history + ECG + age_points + risk_factors; each 0-2; age <45 0, 45-64 1, >=65 2; very_low_risk iff score 0 or 1 (Smith 2020); max 8
Citation
- Authors
- Smith LM, Ashburn NP, Snavely AC, Mahler SA
- Source
- Emerg Med J. 2020;37(11):690-695
Worked example
Age 40, all components 0
Given:
age=40ecg=0history=0risk_factors=0
- Age 40 (<45) → 0; history 0; ECG 0; risk_factors 0
- Score = 0; max 8; very_low_risk true (Smith 2020 scores 0 and 1)
Also searched as
- HEAR score
- History ECG Age Risk
- HEAR chest pain score
- Smith 2020 HEAR
- HEAR without troponin
- very low-risk chest pain HEAR
- HEAR score no troponin
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/hear?age=40&history=0&ecg=0&risk_factors=0
Full URL: https://api.magentlab.com/api/calc/hear?age=40&history=0&ecg=0&risk_factors=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/hear?age=40&history=0&ecg=0&risk_factors=0"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (18-120). Younger than 45 scores 0; 45-64 scores 1; 65 or older scores 2 (same cuts as Six 2008 HEART). |
history |
integer | required | Caller-assigned history. 0 nonspecific, 1 moderately suspicious, 2 highly suspicious. magent does not interpret the history. |
ecg |
integer | required | Caller-assigned ECG. 0 normal; 1 repolarization without significant ST depression (including BBB, LVH, digoxin, or known unchanged); 2 significant ST depression or elevation without those confounders. magent does not read an ECG. |
risk_factors |
integer | required | Caller-assigned risk-factor points. 0 none, 1 = 1-2 risk factors, 2 = ≥3 or atherosclerotic disease. magent does not count diabetes, smoking, or other factors. |
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",
"ecg": "0",
"history": "0",
"risk_factors": "0"
},
{
"age": "40",
"ecg": "0",
"history": "0",
"risk_factors": "0"
}
]
}
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/hear",
"items": [
{
"components": [
{
"value": 0,
"factor": "history",
"points": 0,
"present": false
},
{
"value": 0,
"factor": "ecg",
"points": 0,
"present": false
},
{
"value": 40,
"factor": "age",
"points": 0,
"present": false
},
{
"value": 0,
"factor": "risk_factors",
"points": 0,
"present": false
}
],
"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": "Smith LM, Ashburn NP, Snavely AC, Mahler SA",
"doi": "10.1136/emermed-2020-209698",
"id": "smith-2020",
"pmid": "32753395",
"source": "Emerg Med J. 2020;37(11):690-695",
"title": "Identification of very low-risk acute chest pain patients without troponin testing"
},
"formula": "hear",
"formula_expression": "HEAR = history + ECG + age_points + risk_factors; each 0-2; age <45 0, 45-64 1, >=65 2; very_low_risk iff score 0 or 1 (Smith 2020); max 8",
"age_years": 40,
"max_score": 8,
"score": 0,
"very_low_risk": true
},
{
"components": [
{
"value": 0,
"factor": "history",
"points": 0,
"present": false
},
{
"value": 0,
"factor": "ecg",
"points": 0,
"present": false
},
{
"value": 40,
"factor": "age",
"points": 0,
"present": false
},
{
"value": 0,
"factor": "risk_factors",
"points": 0,
"present": false
}
],
"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": "Smith LM, Ashburn NP, Snavely AC, Mahler SA",
"doi": "10.1136/emermed-2020-209698",
"id": "smith-2020",
"pmid": "32753395",
"source": "Emerg Med J. 2020;37(11):690-695",
"title": "Identification of very low-risk acute chest pain patients without troponin testing"
},
"formula": "hear",
"formula_expression": "HEAR = history + ECG + age_points + risk_factors; each 0-2; age <45 0, 45-64 1, >=65 2; very_low_risk iff score 0 or 1 (Smith 2020); max 8",
"age_years": 40,
"max_score": 8,
"score": 0,
"very_low_risk": true
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | hear |
formula_expression |
string | Exact expression used |
score |
integer | Total points 0-8 |
max_score |
integer | Always 8 |
very_low_risk |
boolean | true when score is 0 or 1 (Smith 2020 very-low-risk group; MACE ~0.9% in that paper). false when score is 2-8. Not HEART bands 0-3 / 4-6 / 7-10. |
age_years |
integer | Age used for the <45 / 45-64 / ≥65 bands |
components |
array | Per-factor 0-2 points |
citation |
object | Smith 2020 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 0,
"factor": "history",
"points": 0,
"present": false
},
{
"value": 0,
"factor": "ecg",
"points": 0,
"present": false
},
{
"value": 40,
"factor": "age",
"points": 0,
"present": false
},
{
"value": 0,
"factor": "risk_factors",
"points": 0,
"present": false
}
],
"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": "Smith LM, Ashburn NP, Snavely AC, Mahler SA",
"doi": "10.1136/emermed-2020-209698",
"id": "smith-2020",
"pmid": "32753395",
"source": "Emerg Med J. 2020;37(11):690-695",
"title": "Identification of very low-risk acute chest pain patients without troponin testing"
},
"formula": "hear",
"formula_expression": "HEAR = history + ECG + age_points + risk_factors; each 0-2; age <45 0, 45-64 1, >=65 2; very_low_risk iff score 0 or 1 (Smith 2020); max 8",
"age_years": 40,
"max_score": 8,
"score": 0,
"very_low_risk": true
}
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_hear |
HEAR inputs must match Smith 2020 history, ECG, age, and risk-factor components from that paper. 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
- HEART score — Compute the HEART score as age points plus caller-assigned history, ECG, risk factors, and troponin (each 0-2).
- HEART Pathway — Apply the Mahler 2015 HEART Pathway and return whether a caller-assigned HEART score plus 0-hour and 3-hour troponin flags meet the published early-discharge rule.
- TIMI risk score for STEMI — Compute the TIMI risk score for ST-elevation myocardial infarction from published bedside factors at presentation.
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.