# LACE Readmission Risk Score Calculator

> LACE Readmission Risk Score Calculator 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-15).

Computes the LACE index (0-19) for 30-day hospital readmission risk from length of stay, acute admission status, Charlson comorbidity index, and ED visit count.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/lace
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/lace-readmission-risk-score-calculator-2d5711dd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6BmG4uENKiDxZPDsJj9a1

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 lace-readmission-risk-score-calculator-2d5711dd
```

Example prompt: Calculate the LACE score for a patient who stayed 5 days, was admitted as an emergency, has a Charlson comorbidity index of 2, and had 1 ED visit in the last 6 months.

## When to prefer this

Use this endpoint when you need a fast, standards-compliant LACE index calculation and already have the Charlson comorbidity index computed externally. Prefer it over general-purpose calculators when you need strict adherence to van Walraven 2010 Table 3 mapping bins (e.g., LOS ≥14 maps to 7, not linear interpolation). Not appropriate for computing Charlson itself — use a separate Charlson calculator first. Suitable for integration into EHR discharge workflows, population health dashboards, and readmission quality reporting pipelines.

## Known failure modes

- Missing required query parameters (length_of_stay_days, acute_admission, charlson, ed_visits_6mo) returns an error
- Non-integer values for integer fields cause validation failure
- charlson or ed_visits_6mo values below 0 or outside expected range may be rejected
- Payment not provided via x402 protocol results in 402 Payment Required
- Server-side errors return 5xx responses

## How this service works

LACE (van Walraven 2010 CMAJ Table 3) from length of stay in days (<1 0; 1 1; 2 2; 3 3; 4-6 4; 7-13 5; >=14 7), acute (emergent) admission (true 3), caller-supplied Charlson comorbidity index (0-3 identity; >=4 5), and ED visits in the previous 6 months (0-3 identity; >=4 4). Score 0-19 only; no unpublished high-risk class. Not a discharge order. magent does not compute Charlson.

## Output

Returns a LACE composite score from 0 to 19, calculated by summing mapped point values for length of stay (L), acute admission status (A), caller-supplied Charlson comorbidity index (C), and ED visits in the prior 6 months (E), per van Walraven 2010 CMAJ Table 3. The endpoint does not classify risk tiers or issue clinical recommendations.

## 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": [
      "length_of_stay_days",
      "acute_admission",
      "charlson",
      "ed_visits_6mo"
     ],
     "properties": {
      "charlson": {
       "type": "integer",
       "description": "Caller-supplied Charlson comorbidity index (integer 0-37). magent does not compute Charlson. van Walraven 2010 Table 3 C: 0 → 0, 1 → 1, 2 → 2, 3 → 3, ≥4 → 5."
      },
      "ed_visits_6mo": {
       "type": "integer",
       "description": "Emergency-department visits in the previous 6 months (integer 0-30). van Walraven 2010 Table 3 E: 0 → 0, 1 → 1, 2 → 2, 3 → 3, ≥4 → 4."
      },
      "acute_admission": {
       "type": "boolean",
       "description": "Acute (emergent) admission as assigned by the caller (true or false). van Walraven 2010 Table 3 A: true → 3, false → 0."
      },
      "length_of_stay_days": {
       "type": "integer",
       "description": "Length of stay in days (integer 0-365). van Walraven 2010 Table 3 L: <1 → 0, 1 → 1, 2 → 2, 3 → 3, 4-6 → 4, 7-13 → 5, ≥14 → 7. 0 days is the <1 bin."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/lace",
  "count": 2,
  "items": [
   {
    "score": 1,
    "formula": "lace",
    "charlson": 0,
    "citation": {
     "id": "van-walraven-2010",
     "doi": "10.1503/cmaj.091117",
     "pmid": "20194559",
     "title": "Derivation and validation of an index to predict early death or unplanned readmission after discharge from hospital to the community",
     "source": "CMAJ. 2010;182(6):551-557",
     "authors": "van Walraven C, Dhalla IA, Bell C, Etchells E, Stiell IG, Zarnke K, Austin PC, Forster AJ"
    },
    "max_score": 19,
    "components": [
     {
      "value": 1,
      "factor": "length_of_stay",
      "points": 1,
      "present": true
     },
     {
      "factor": "acute_admission",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "charlson",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "ed_visits_6mo",
      "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.",
    "ed_visits_6mo": 0,
    "acute_admission": false,
    "formula_expression": "LACE = los_points + acute_admission_points + charlson_points + ed_visits_points; van Walraven 2010 Table 3; LOS <1 0, 1 1, 2 2, 3 3, 4-6 4, 7-13 5, >=14 7; acute true 3; Charlson 0-3 identity, >=4 5; ED 0-3 identity, >=4 4; max 19",
    "length_of_stay_days": 1
   },
   {
    "score": 1,
    "formula": "lace",
    "charlson": 0,
    "citation": {
     "id": "van-walraven-2010",
     "doi": "10.1503/cmaj.091117",
     "pmid": "20194559",
     "title": "Derivation and validation of an index to predict early death or unplanned readmission after discharge from hospital to the community",
     "source": "CMAJ. 2010;182(6):551-557",
     "authors": "van Walraven C, Dhalla IA, Bell C, Etchells E, Stiell IG, Zarnke K, Austin PC, Forster AJ"
    },
    "max_score": 19,
    "components": [
     {
      "value": 1,
      "factor": "length_of_stay",
      "points": 1,
      "present": true
     },
     {
      "factor": "acute_admission",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "charlson",
      "points": 0,
      "present": false
     },
     {
      "value": 0,
      "factor": "ed_visits_6mo",
      "points": 0,
      "present
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/lace-readmission-risk-score-calculator-2d5711dd/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)
