{
  "x402Version": 2,
  "id": 39534,
  "slug": "39534",
  "resource": "https://api.magentlab.com/api/calc/ehmrg",
  "description": "Lee 2012 EHMRG 7-day ED model (Table 3 integer score): 2*age + 60 if EMS transport - min(SBP,160) + clamp(HR,80-120) - 2*min(SpO2,92) + 20*creatinine_mg_dl + K (<=3.9: +5; 4.0-4.5: 0; >=4.6: +30) + 60 if troponin>ULN + 45 if active cancer + 60 if home metolazone + 12. Groups 1/2/3/4/5a/5b. Dialysis-dependent excluded. Not EHMRG30-ST, not ADHERE CART, not a discharge or admission order.",
  "type": "http",
  "serviceName": "magent",
  "resourceType": "Agent Service",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x836Be278f1739fB4308091cD1852F7971Bc19Ee2",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5000",
      "amountUsd": 0.005,
      "maxTimeoutSeconds": 600
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "iconUrl": "https://api.magentlab.com/favicon.ico",
        "input": {
          "body": {
            "items": [
              {
                "active_cancer": false,
                "age": 70,
                "creatinine_mg_dl": 1,
                "creatinine_umol_l": 88.4,
                "dialysis_dependent": false,
                "ems_transport": false,
                "heart_rate_bpm": 80,
                "metolazone": false,
                "potassium_mmol_l": 4.2,
                "spo2_percent": 92,
                "systolic_mm_hg": 160,
                "troponin_gt_uln": false
              },
              {
                "active_cancer": false,
                "age": 70,
                "creatinine_mg_dl": 1,
                "creatinine_umol_l": 88.4,
                "dialysis_dependent": false,
                "ems_transport": false,
                "heart_rate_bpm": 80,
                "metolazone": false,
                "potassium_mmol_l": 4.2,
                "spo2_percent": 92,
                "systolic_mm_hg": 160,
                "troponin_gt_uln": false
              }
            ]
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "count": 2,
            "items": [
              {
                "active_cancer": false,
                "age_years": 70,
                "citation": {
                  "authors": "Lee DS, Stitt A, Austin PC, Stukel TA, Schull MJ, Chong A, Newton GE, Lee JS, Tu JV",
                  "doi": "10.7326/0003-4819-156-11-201206050-00003",
                  "id": "lee-2012",
                  "pmid": "22665814",
                  "source": "Ann Intern Med. 2012;156(11):767-775",
                  "title": "Prediction of heart failure mortality in emergent care: a cohort study"
                },
                "creatinine_mg_dl": 1,
                "dialysis_dependent": 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.",
                "ehmrg_score": -92,
                "ems_transport": false,
                "formula": "ehmrg",
                "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)",
                "heart_rate_bpm": 80,
                "metolazone": false,
                "potassium_mmol_l": 4.2,
                "risk_group": "1",
                "spo2_percent": 92,
                "systolic_mm_hg": 160,
                "troponin_gt_uln": false
              },
              {
                "active_cancer": false,
                "age_years": 70,
                "citation": {
                  "authors": "Lee DS, Stitt A, Austin PC, Stukel TA, Schull MJ, Chong A, Newton GE, Lee JS, Tu JV",
                  "doi": "10.7326/0003-4819-156-11-201206050-00003",
                  "id": "lee-2012",
                  "pmid": "22665814",
                  "source": "Ann Intern Med. 2012;156(11):767-775",
                  "title": "Prediction of heart failure mortality in emergent care: a cohort study"
                },
                "creatinine_mg_dl": 1,
                "dialysis_dependent": 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.",
                "ehmrg_score": -92,
                "ems_transport": false,
                "formula": "ehmrg",
                "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)",
                "heart_rate_bpm": 80,
                "metolazone": false,
                "potassium_mmol_l": 4.2,
                "risk_group": "1",
                "spo2_percent": 92,
                "systolic_mm_hg": 160,
                "troponin_gt_uln": false
              }
            ],
            "path": "/api/calc/ehmrg"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "items": {
                      "properties": {
                        "active_cancer": {
                          "description": "Active cancer as assigned by the caller (true or false). Lee 2012 Table 3: +45 if true.",
                          "type": "boolean"
                        },
                        "age": {
                          "description": "Age in years (integer 18-120). Lee 2012 Table 3 adds +2 per year. magent does not assign age.",
                          "type": "integer"
                        },
                        "creatinine_mg_dl": {
                          "description": "Serum creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l, not both. Lee 2012 Table 3 adds +20 per mg/dL. magent does not measure creatinine.",
                          "type": "number"
                        },
                        "creatinine_umol_l": {
                          "description": "Serum creatinine in µmol/L (9-1768). Converted as mg/dL = µmol/L / 88.42. Provide this or creatinine_mg_dl, not both.",
                          "type": "number"
                        },
                        "dialysis_dependent": {
                          "description": "Dialysis dependence as assigned by the caller (true or false). Lee 2012 excludes dialysis-dependent patients; true returns HTTP 400. magent does not determine dialysis status.",
                          "type": "boolean"
                        },
                        "ems_transport": {
                          "description": "Transported by EMS as assigned by the caller (true or false). Lee 2012 Table 3: +60 if true.",
                          "type": "boolean"
                        },
                        "heart_rate_bpm": {
                          "description": "Heart rate in beats/min (integer 30-220). Lee 2012 Table 3 scores +1 * clamp(HR, 80, 120): floor 80, ceiling 120. magent does not measure heart rate.",
                          "type": "integer"
                        },
                        "metolazone": {
                          "description": "Metolazone at home as assigned by the caller (true or false). Lee 2012 Table 3: +60 if true.",
                          "type": "boolean"
                        },
                        "potassium_mmol_l": {
                          "description": "Serum potassium in mmol/L (1.5-8.0). Lee 2012 Table 3: 4.0-4.5 inclusive → 0; >=4.6 → +30; <=3.9 → +5. Unpublished 3.91-3.99 pin with <=3.9; 4.51-4.59 pin with >=4.6. magent does not measure potassium.",
                          "type": "number"
                        },
                        "spo2_percent": {
                          "description": "Lowest initial/triage oxygen saturation percent (50-100). Lee 2012 Table 3 scores -2 * min(SpO2, 92); values above 92% are capped. magent does not measure saturation.",
                          "type": "number"
                        },
                        "systolic_mm_hg": {
                          "description": "Initial/triage systolic blood pressure in mm Hg (integer 50-250). Lee 2012 Table 3 scores -1 * min(SBP, 160); values above 160 mm Hg are capped. magent does not measure blood pressure.",
                          "type": "integer"
                        },
                        "troponin_gt_uln": {
                          "description": "Troponin above the local upper limit of normal as assigned by the caller (true or false). Lee 2012 Table 3: +60 if true.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "age",
                        "ems_transport",
                        "systolic_mm_hg",
                        "heart_rate_bpm",
                        "spo2_percent",
                        "potassium_mmol_l",
                        "troponin_gt_uln",
                        "active_cancer",
                        "metolazone",
                        "dialysis_dependent"
                      ],
                      "type": "object"
                    },
                    "maxItems": 25,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "items"
                ],
                "type": "object"
              },
              "headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "method": {
                "const": "POST",
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "ehmrg",
    "heart-failure",
    "emergency",
    "mortality",
    "calculator",
    "bazaar"
  ],
  "sourceHost": "api.magentlab.com",
  "lastUpdated": "2026-10-12T14:27:19.353Z",
  "quality": {
    "calls30d": 3,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-10-12T14:27:19.219Z"
  },
  "metadata": {
    "serviceName": "magent",
    "extensions": {
      "bazaar": {
        "info": {
          "iconUrl": "https://api.magentlab.com/favicon.ico",
          "input": {
            "body": {
              "items": [
                {
                  "active_cancer": false,
                  "age": 70,
                  "creatinine_mg_dl": 1,
                  "creatinine_umol_l": 88.4,
                  "dialysis_dependent": false,
                  "ems_transport": false,
                  "heart_rate_bpm": 80,
                  "metolazone": false,
                  "potassium_mmol_l": 4.2,
                  "spo2_percent": 92,
                  "systolic_mm_hg": 160,
                  "troponin_gt_uln": false
                },
                {
                  "active_cancer": false,
                  "age": 70,
                  "creatinine_mg_dl": 1,
                  "creatinine_umol_l": 88.4,
                  "dialysis_dependent": false,
                  "ems_transport": false,
                  "heart_rate_bpm": 80,
                  "metolazone": false,
                  "potassium_mmol_l": 4.2,
                  "spo2_percent": 92,
                  "systolic_mm_hg": 160,
                  "troponin_gt_uln": false
                }
              ]
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "count": 2,
              "items": [
                {
                  "active_cancer": false,
                  "age_years": 70,
                  "citation": {
                    "authors": "Lee DS, Stitt A, Austin PC, Stukel TA, Schull MJ, Chong A, Newton GE, Lee JS, Tu JV",
                    "doi": "10.7326/0003-4819-156-11-201206050-00003",
                    "id": "lee-2012",
                    "pmid": "22665814",
                    "source": "Ann Intern Med. 2012;156(11):767-775",
                    "title": "Prediction of heart failure mortality in emergent care: a cohort study"
                  },
                  "creatinine_mg_dl": 1,
                  "dialysis_dependent": 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.",
                  "ehmrg_score": -92,
                  "ems_transport": false,
                  "formula": "ehmrg",
                  "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)",
                  "heart_rate_bpm": 80,
                  "metolazone": false,
                  "potassium_mmol_l": 4.2,
                  "risk_group": "1",
                  "spo2_percent": 92,
                  "systolic_mm_hg": 160,
                  "troponin_gt_uln": false
                },
                {
                  "active_cancer": false,
                  "age_years": 70,
                  "citation": {
                    "authors": "Lee DS, Stitt A, Austin PC, Stukel TA, Schull MJ, Chong A, Newton GE, Lee JS, Tu JV",
                    "doi": "10.7326/0003-4819-156-11-201206050-00003",
                    "id": "lee-2012",
                    "pmid": "22665814",
                    "source": "Ann Intern Med. 2012;156(11):767-775",
                    "title": "Prediction of heart failure mortality in emergent care: a cohort study"
                  },
                  "creatinine_mg_dl": 1,
                  "dialysis_dependent": 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.",
                  "ehmrg_score": -92,
                  "ems_transport": false,
                  "formula": "ehmrg",
                  "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)",
                  "heart_rate_bpm": 80,
                  "metolazone": false,
                  "potassium_mmol_l": 4.2,
                  "risk_group": "1",
                  "spo2_percent": 92,
                  "systolic_mm_hg": 160,
                  "troponin_gt_uln": false
                }
              ],
              "path": "/api/calc/ehmrg"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "properties": {
                          "active_cancer": {
                            "description": "Active cancer as assigned by the caller (true or false). Lee 2012 Table 3: +45 if true.",
                            "type": "boolean"
                          },
                          "age": {
                            "description": "Age in years (integer 18-120). Lee 2012 Table 3 adds +2 per year. magent does not assign age.",
                            "type": "integer"
                          },
                          "creatinine_mg_dl": {
                            "description": "Serum creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l, not both. Lee 2012 Table 3 adds +20 per mg/dL. magent does not measure creatinine.",
                            "type": "number"
                          },
                          "creatinine_umol_l": {
                            "description": "Serum creatinine in µmol/L (9-1768). Converted as mg/dL = µmol/L / 88.42. Provide this or creatinine_mg_dl, not both.",
                            "type": "number"
                          },
                          "dialysis_dependent": {
                            "description": "Dialysis dependence as assigned by the caller (true or false). Lee 2012 excludes dialysis-dependent patients; true returns HTTP 400. magent does not determine dialysis status.",
                            "type": "boolean"
                          },
                          "ems_transport": {
                            "description": "Transported by EMS as assigned by the caller (true or false). Lee 2012 Table 3: +60 if true.",
                            "type": "boolean"
                          },
                          "heart_rate_bpm": {
                            "description": "Heart rate in beats/min (integer 30-220). Lee 2012 Table 3 scores +1 * clamp(HR, 80, 120): floor 80, ceiling 120. magent does not measure heart rate.",
                            "type": "integer"
                          },
                          "metolazone": {
                            "description": "Metolazone at home as assigned by the caller (true or false). Lee 2012 Table 3: +60 if true.",
                            "type": "boolean"
                          },
                          "potassium_mmol_l": {
                            "description": "Serum potassium in mmol/L (1.5-8.0). Lee 2012 Table 3: 4.0-4.5 inclusive → 0; >=4.6 → +30; <=3.9 → +5. Unpublished 3.91-3.99 pin with <=3.9; 4.51-4.59 pin with >=4.6. magent does not measure potassium.",
                            "type": "number"
                          },
                          "spo2_percent": {
                            "description": "Lowest initial/triage oxygen saturation percent (50-100). Lee 2012 Table 3 scores -2 * min(SpO2, 92); values above 92% are capped. magent does not measure saturation.",
                            "type": "number"
                          },
                          "systolic_mm_hg": {
                            "description": "Initial/triage systolic blood pressure in mm Hg (integer 50-250). Lee 2012 Table 3 scores -1 * min(SBP, 160); values above 160 mm Hg are capped. magent does not measure blood pressure.",
                            "type": "integer"
                          },
                          "troponin_gt_uln": {
                            "description": "Troponin above the local upper limit of normal as assigned by the caller (true or false). Lee 2012 Table 3: +60 if true.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "age",
                          "ems_transport",
                          "systolic_mm_hg",
                          "heart_rate_bpm",
                          "spo2_percent",
                          "potassium_mmol_l",
                          "troponin_gt_uln",
                          "active_cancer",
                          "metolazone",
                          "dialysis_dependent"
                        ],
                        "type": "object"
                      },
                      "maxItems": 25,
                      "minItems": 1,
                      "type": "array"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                },
                "headers": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "method": {
                  "const": "POST",
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "api.magentlab.com",
    "manifest_name": "api.magentlab.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {},
    "type": "string"
  }
}