# Hartley 2021 NIVO Score Calculator

> Hartley 2021 NIVO 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-14).

Calculates the Hartley 2021 NIVO score for predicting in-hospital mortality in patients receiving non-invasive ventilation, returning a 0–9 score with Table 4 mortality band.

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/nivo
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hartley-2021-nivo-score-calculator-ba69ff45
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_A3-XISSa2uAwOiEn5iew3

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 hartley-2021-nivo-score-calculator-ba69ff45
```

Example prompt: Calculate the Hartley 2021 NIVO score for my patient: no chest radiograph consolidation, GCS is 14 or below (true), atrial fibrillation present (true), pH is 7.20 so below 7.25 (true), time to acidaemia was less than 12 hours (false), and eMRCD is 5b.

## When to prefer this

Use this endpoint when you need the Hartley 2021 NIVO score specifically — it is not HACOR, DECAF, or APACHE II. Choose it when stratifying in-hospital mortality risk for patients beginning non-invasive ventilation, particularly in COPD exacerbation with acidaemia. It is the correct tool when caller-assigned eMRCD grade, pH, GCS, AF status, CXR findings, and time-to-acidaemia are all known.

## Known failure modes

- Missing required query parameter returns an error — all six fields (chest_radiograph_consolidation, gcs_le_14, atrial_fibrillation, ph_lt_7_25, time_to_acidaemia_gt_12h, emrcd) must be supplied
- Invalid emrcd value (not one of '1_to_4', '5a', '5b') returns validation error
- Non-boolean value for boolean parameters causes rejection
- Payment failure or missing x402 payment header returns 402 Payment Required

## How this service works

Hartley 2021 NIVO: consolidation, GCS ≤14, AF, and pH <7.25 score 1 each; time to acidaemia >12 h scores 2; eMRCD 1_to_4 → 0, 5a → 2, 5b → 3 (cannot score both). Returns 0–9 and Table 4 bands 0-2 / 3-4 / 5-6 / 7-9 with grouped in-hospital mortality 5.0 / 16.8 / 41.2 / 71.4%. Not HACOR, DECAF, APACHE II, or a weaning predictor. Not a medical device.

## Output

Returns a total NIVO score from 0 to 9 and a Table 4 risk band (0-2, 3-4, 5-6, or 7-9) with the corresponding grouped in-hospital mortality rate: 5.0% / 16.8% / 41.2% / 71.4% respectively.

## 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": [
      "chest_radiograph_consolidation",
      "gcs_le_14",
      "atrial_fibrillation",
      "ph_lt_7_25",
      "time_to_acidaemia_gt_12h",
      "emrcd"
     ],
     "properties": {
      "emrcd": {
       "enum": [
        "1_to_4",
        "5a",
        "5b"
       ],
       "type": "string",
       "description": "Hartley 2021 extended MRC dyspnoea as assigned by the caller. 1_to_4 scores 0; 5a scores 2; 5b scores 3. 5a and 5b are mutually exclusive. magent does not interview the patient."
      },
      "gcs_le_14": {
       "type": "boolean",
       "description": "GCS ≤14 prior to ventilation as assigned by the caller (Hartley 2021). true or false. 1 point if true. magent does not measure GCS."
      },
      "ph_lt_7_25": {
       "type": "boolean",
       "description": "Arterial pH <7.25 as assigned by the caller (Hartley 2021). true or false. 1 point if true. magent does not measure pH."
      },
      "atrial_fibrillation": {
       "type": "boolean",
       "description": "Persistent AF, new AF, or paroxysmal AF even if in sinus rhythm at NIV start (Hartley 2021). true or false. 1 point if true. magent does not interpret the ECG."
      },
      "time_to_acidaemia_gt_12h": {
       "type": "boolean",
       "description": ">12 h from hospital arrival to index acidaemia as assigned by the caller (Hartley 2021). true or false. 2 points if true. magent does not clock admission time."
      },
      "chest_radiograph_consolidation": {
       "type": "boolean",
       "description": "Chest radiograph consolidation as assigned by the caller (Hartley 2021). true or false. 1 point if true. magent does not interpret radiographs."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hartley-2021-nivo-score-calculator-ba69ff45/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)
