# HOSPITAL Score Calculator (Donze 2013)

> HOSPITAL Score Calculator (Donze 2013) is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Computes the HOSPITAL score for 30-day potentially avoidable readmission risk, returning a numeric score and risk band (low/intermediate/high) based on seven caller-supplied clinical flags.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/hospital
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hospital-score-calculator-donze-2013-b1a67690
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y3DP6IiGR4VCs4VG23DSx

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability hospital-score-calculator-donze-2013-b1a67690
```

Example prompt: Calculate the HOSPITAL score for a patient being discharged: hemoglobin was below 12, they were on oncology service, sodium was normal, they had a procedure during the stay, admission was urgent, they had 3 admissions in the past year, and their length of stay was 6 days.

## When to prefer this

Use this endpoint when you need a validated, point-scored readmission risk calculation strictly following the Donze 2013 HOSPITAL score methodology and you have already determined the boolean clinical flags externally (e.g. from an EHR extraction step). Prefer it over general-purpose LLM inference when you need a reproducible, auditable numeric score and SQLape-aligned risk band for discharge planning or quality reporting pipelines.

## Known failure modes

- Missing required boolean flag — HTTP 400 validation error
- admissions_12mo outside 0–50 integer range — clamped or rejected depending on schema enforcement
- Caller misclassifies clinical values (e.g. sends raw hemoglobin number instead of boolean flag) — schema rejects non-boolean
- Score is for SQLape-defined potentially avoidable readmission, not all-cause; misuse leads to incorrect risk interpretation
- Network or payment failure returns HTTP 402 or 5xx with no score

## How this service works

HOSPITAL (Donze 2013 JAMA Intern Med acronym table): hemoglobin_lt_12 (last Hb <12 g/dL) 1; oncology_service 2; sodium_lt_135 (last Na <135 mmol/L) 1; procedure (any ICD-coded procedure during the stay) 1; urgent_or_emergent_admission 1; admissions_12mo 0-1→0, 2-5→2, >5→5; los_ge_5_days 2. Max 13. Bands 0-4 low, 5-6 intermediate, >=7 high for potentially avoidable 30-day readmission (SQLape), not all-cause. Flags and counts are caller-assigned. Not a discharge order or diagnosis.

## Output

Returns the total HOSPITAL score (integer 0–13), the risk band (low for 0–4, intermediate for 5–6, high for ≥7) for potentially avoidable 30-day readmission (SQLape definition, not all-cause), and the point contribution from each of the seven input components.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "hemoglobin_lt_12",
      "oncology_service",
      "sodium_lt_135",
      "procedure",
      "urgent_or_emergent_admission",
      "admissions_12mo",
      "los_ge_5_days"
     ],
     "properties": {
      "procedure": {
       "type": "boolean",
       "description": "Any ICD-coded procedure during the stay as assigned by the caller (Donze 2013 P). true scores 1. magent does not read the chart."
      },
      "los_ge_5_days": {
       "type": "boolean",
       "description": "Length of stay ≥5 days as assigned by the caller (Donze 2013 L). true scores 2. magent does not compute length of stay from dates."
      },
      "sodium_lt_135": {
       "type": "boolean",
       "description": "Last sodium <135 mmol/L as assigned by the caller (Donze 2013 S). true scores 1. magent does not assay sodium. Do not send a sodium number."
      },
      "admissions_12mo": {
       "type": "integer",
       "description": "Hospital admissions during the previous year (integer 0-50, magent clamp). Donze 2013 A: 0-1 scores 0; 2-5 scores 2; >5 scores 5. Count 0 and 1 both score 0; 2 scores 2; 5 scores 2; 6 scores 5."
      },
      "hemoglobin_lt_12": {
       "type": "boolean",
       "description": "Last hemoglobin <12 g/dL as assigned by the caller (Donze 2013 H). true scores 1. magent does not assay hemoglobin. Do not send a hemoglobin number."
      },
      "oncology_service": {
       "type": "boolean",
       "description": "Discharge from an oncology service as assigned by the caller (Donze 2013 O). true scores 2."
      },
      "urgent_or_emergent_admission": {
       "type": "boolean",
       "description": "Index admission type urgent or emergent, not elective, as assigned by the caller (Donze 2013 I). true scores 1."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hospital-score-calculator-donze-2013-b1a67690/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
