{"uid":"cap_a7JUfORZIfIjh0GV2lvKM","slug":"ehmrg-7-day-ed-mortality-risk-calculator-lee-2012-c27a0c70","name":"EHMRG 7-Day ED Mortality Risk Calculator (Lee 2012)","description":"Deterministic published-formula arithmetic plus ICD-10-CM, RxNorm, and LOINC. Pay in USDC on Base via x402.","url":"https://api.magentlab.com/api/calc/ehmrg?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object"}},"additionalProperties":false}}},"responseSchema":{"type":"json","example":{"path":"/api/calc/ehmrg","count":2,"items":[{"formula":"ehmrg","citation":{"id":"lee-2012","doi":"10.7326/0003-4819-156-11-201206050-00003","pmid":"22665814","title":"Prediction of heart failure mortality in emergent care: a cohort study","source":"Ann Intern Med. 2012;156(11):767-775","authors":"Lee DS, Stitt A, Austin PC, Stukel TA, Schull MJ, Chong A, Newton GE, Lee JS, Tu JV"},"age_years":70,"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.","metolazone":false,"risk_group":"1","ehmrg_score":-92,"spo2_percent":92,"active_cancer":false,"ems_transport":false,"heart_rate_bpm":80,"systolic_mm_hg":160,"troponin_gt_uln":false,"creatinine_mg_dl":1,"potassium_mmol_l":4.2,"dialysis_dependent":false,"formula_expression":"ehmrg_score = 2*age_years + 60*(ems_transport) - min(systolic_mm_hg, 160) + clamp(heart_rate_bpm, 80, 120) - 2*min(spo2_percent, 92) + 20*creatinine_mg_dl + K(<=3.9:5, 4.0-4.5:0, >=4.6:30) + 60*(troponin_gt_uln) + 45*(active_cancer) + 60*(metolazone) + 12; Lee 2012 Table 3 7-day ED model; dialysis-dependent excluded; risk_group 1 (score <= -49.1), 2 (-49.0 to -15.9), 3 (-15.8 to 17.9), 4 (18.0 to 56.5), 5a (56.6 to 89.3), 5b (>= 89.4)"},{"formula":"ehmrg","citation":{"id":"lee-2012","doi":"10.7326/0003-4819-156-11-201206050-00003","pmid":"22665814","title":"Prediction of heart failure mortality in emergent care: a cohort study","source":"Ann Intern Med. 2012;156(11):767-775","authors":"Lee DS, Stitt A, Austin PC, Stukel TA, Schull MJ, Chong A, Newton GE, Lee JS, Tu JV"},"age_years":70,"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.","metolazone":false,"risk_group":"1","ehmrg_score":-92,"spo2_percent":92,"active_cancer":false,"ems_transport":false,"heart_rate_bpm":80,"systolic_mm_hg":160,"troponin_gt_uln":false,"creatinine_mg_dl":1,"potassium_mmol_l":4.2,"dialysis_dependent":false,"formula_expression":"ehmrg_score = 2*age_years + 60*(ems_transport) - min(systolic_mm_hg, 160) + clamp(heart_rate_bpm, 80, 120) - 2*min(spo2_percent, 92) + 20*creatinine_mg_dl + K(<=3.9:5, 4.0-4.5:0, >=4.6:30) + 60*(troponin_gt_uln) + 45*(active_cancer) + 60*(metolazone) + 12; Lee 2012 Table 3 7-day ED model; dialysis-dependent excluded; risk_group 1 (score <= -49.1), 2 (-49.0 to -15.9), 3 (-15.8 to 17.9), 4 (18.0 to 56.5), 5a (56.6 to 89.3), 5b (>= 89.4)"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QtLApmmN52fq4DNo758Cp","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the Emergency Heart Failure Mortality Risk Grade (EHMRG) score and risk group (1–5b) for acute heart failure patients presenting to the ED, based on the Lee 2012 Table 3 integer scoring model.","exampleAgentPrompt":"Calculate the EHMRG 7-day ED mortality score for a 72-year-old heart failure patient who arrived by EMS, has a systolic BP of 110 mm Hg, heart rate of 105 bpm, SpO2 of 89%, creatinine of 2.1 mg/dL, potassium of 4.3 mmol/L, troponin above the upper limit of normal, no active cancer, and no home metolazone — what is their EHMRG score and risk group?","exampleUseCases":[{"title":"Triage risk stratification in acute HF","prompt":"I have a 68-year-old heart failure patient in the ED — she came in by ambulance, BP is 140/90, heart rate 98, SpO2 is 90%, creatinine 1.8 mg/dL, potassium 3.7 mmol/L, troponin is negative, no active cancer, and she takes metolazone at home. What is her EHMRG score and which risk group does she fall into?"},{"title":"Autonomous agent clinical decision pipeline","prompt":"Run the Lee 2012 EHMRG model for a 55-year-old male who walked in (no EMS), systolic BP 155, HR 82, SpO2 94%, creatinine 0.9 mg/dL, potassium 4.8 mmol/L, troponin below ULN, no cancer, no metolazone — give me the integer score and risk tier."},{"title":"Research cohort risk classification","prompt":"For a research dataset patient: age 80, EMS transport yes, SBP 90, HR 120, SpO2 85%, creatinine 3.2 mg/dL, potassium 5.0 mmol/L, troponin elevated above ULN, active cancer present, no metolazone, not dialysis-dependent — compute their EHMRG score and risk group using the Lee 2012 table 3 formula."}],"resultDescription":"Returns a JSON object containing the computed EHMRG integer score, the corresponding risk group (1, 2, 3, 4, 5a, or 5b), the full formula expression used, echoed input parameters, the Lee 2012 citation (DOI, PMID, journal), and a disclaimer that the output is not a medical device and a licensed clinician retains responsibility for patient care.","failureModes":["Missing required query parameters (age, ems_transport, systolic_mm_hg, heart_rate_bpm, spo2_percent, creatinine_mg_dl, potassium_mmol_l, troponin_gt_uln, active_cancer, metolazone, dialysis_dependent) returns a validation error","dialysis_dependent=true causes the endpoint to exclude the patient (dialysis-dependent patients are out of scope for EHMRG)","Out-of-range numeric values (e.g. age <18 or >120, HR <30 or >220) may be rejected or produce unexpected scores","Payment failure via x402 protocol results in 402 response before calculation is performed","Boolean fields passed as strings rather than true/false may cause parsing errors"],"whenToPreferThis":"Use this endpoint when you need a deterministic, published-formula implementation of the Lee 2012 EHMRG 7-day ED mortality model for acute heart failure patients. Prefer it over general clinical NLP or LLM-based risk estimators when auditability and exact formula reproducibility matter. It is specifically the Table 3 integer score model — not EHMRG30-ST, not ADHERE CART, and not an admission or discharge decision tool. Choose it for clinical decision support pipelines, autonomous agents processing ED heart failure presentations, or research cohort scoring where dialysis-dependent patients are excluded.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-01T00:43:08.323Z","isFirstParty":false,"canonicalSlug":"ehmrg-7-day-ed-mortality-risk-calculator-lee-2012-c27a0c70"}