Respiratory · LIVE
NIVO score (Hartley 2021)
NIVO
Sum Hartley 2021 NIVO points from chest radiograph consolidation, GCS ≤14, atrial fibrillation, pH <7.25, time to acidaemia >12 h, and eMRCD, and return the validation Table 4 grouped in-hospital mortality band.
Markdown: /docs/nivo.md · Canonical: https://magentlab.com/docs/nivo
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum Hartley 2021 NIVO points from chest radiograph consolidation, GCS ≤14, atrial fibrillation, pH <7.25, time to acidaemia >12 h, and eMRCD, and return the validation Table 4 grouped in-hospital mortality band.
When to use
When an agent needs the published Hartley 2021 NIVO total and Table 4 grouped band for AECOPD with acidaemic hypercapnic respiratory failure treated with assisted ventilation, and must not invent HACOR, DECAF, APACHE II, a weaning prediction, or a per-integer mortality percent.
When not to use
- Not a medical device. Not an intubation, NIV-failure, weaning, or escalation order. Not HACOR, DECAF, or APACHE II.
- Flags and eMRCD are caller-assigned. magent does not interpret the chest radiograph, measure GCS, interpret the ECG, measure arterial pH, or clock time from hospital arrival.
- In-hospital mortality percents are Hartley 2021 validation Table 4 grouped bands only (0–2 / 3–4 / 5–6 / 7–9: 5.0 / 16.8 / 41.2 / 71.4). Per-integer percents are not attached.
- eMRCD 5a and 5b are mutually exclusive; maximum score is 9.
Formula
NIVO = chest_radiograph_consolidation + gcs_le_14 + atrial_fibrillation + ph_lt_7_25 + time_to_acidaemia_gt_12h + emrcd; consolidation true -> 1; GCS <=14 prior to ventilation -> 1; AF (persistent, new, or paroxysmal even if sinus at NIV start) true -> 1; pH <7.25 -> 1; time from hospital arrival to index acidaemia >12 h -> 2; eMRCD 1_to_4 -> 0, 5a -> 2, 5b -> 3; cannot score both 5a and 5b; Hartley 2021 validation Table 4 bands 0-2 / 3-4 / 5-6 / 7-9; max 9
Citation
- Authors
- Hartley T, Lane ND, Steer J, et al.
- Source
- Eur Respir J. 2021;58(2):2004042
Worked example
No NIVO points (band 0_to_2)
Given:
atrial_fibrillation=falsechest_radiograph_consolidation=falseemrcd=1_to_4gcs_le_14=falseph_lt_7_25=falsetime_to_acidaemia_gt_12h=false
- No consolidation, GCS ≤14, AF, pH <7.25, or time >12 h; eMRCD 1_to_4 → 0
- Score = 0; band 0_to_2; validation Table 4 in-hospital mortality 5.0%
Maximum points (band 7_to_9)
Given:
atrial_fibrillation=truechest_radiograph_consolidation=trueemrcd=5bgcs_le_14=trueph_lt_7_25=truetime_to_acidaemia_gt_12h=true
- Consolidation → 1; GCS ≤14 → 1; AF → 1; pH <7.25 → 1; time >12 h → 2; eMRCD 5b → 3
- Score = 9; band 7_to_9; validation Table 4 in-hospital mortality 71.4%
Also searched as
- NIVO score
- noninvasive ventilation outcomes
- Hartley NIVO
- COPD NIV mortality
- eMRCD ventilation score
- AECOPD assisted ventilation
- NIVO Hartley 2021
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/nivo?chest_radiograph_consolidation=false&gcs_le_14=false&atrial_fibrillation=false&ph_lt_7_25=false&time_to_acidaemia_gt_12h=false&emrcd=1_to_4
Call
Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params
return HTTP 400 before any quote or charge.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/nivo?chest_radiograph_consolidation=false&gcs_le_14=false&atrial_fibrillation=false&ph_lt_7_25=false&time_to_acidaemia_gt_12h=false&emrcd=1_to_4"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
chest_radiograph_consolidation |
boolean | required | Chest radiograph consolidation as assigned by the caller (Hartley 2021). true or false. 1 point if true. magent does not interpret radiographs. |
gcs_le_14 |
boolean | required | GCS ≤14 prior to ventilation as assigned by the caller (Hartley 2021). true or false. 1 point if true. magent does not measure GCS. |
atrial_fibrillation |
boolean | required | 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. |
ph_lt_7_25 |
boolean | required | Arterial pH <7.25 as assigned by the caller (Hartley 2021). true or false. 1 point if true. magent does not measure pH. |
time_to_acidaemia_gt_12h |
boolean | required | >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. |
emrcd |
string | required · 1_to_4, 5a, 5b | 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. |
Bulk (POST)
POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.
- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
- HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
- Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
- x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.
Example request (fixture)
{
"items": [
{
"atrial_fibrillation": "false",
"chest_radiograph_consolidation": "false",
"emrcd": "1_to_4",
"gcs_le_14": "false",
"ph_lt_7_25": "false",
"time_to_acidaemia_gt_12h": "false"
},
{
"atrial_fibrillation": "false",
"chest_radiograph_consolidation": "false",
"emrcd": "1_to_4",
"gcs_le_14": "false",
"ph_lt_7_25": "false",
"time_to_acidaemia_gt_12h": "false"
}
]
}
Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.
Example 200 (fixture)
{
"count": 2,
"path": "/api/calc/nivo",
"items": [
{
"components": [
{
"factor": "chest_radiograph_consolidation",
"points": 0,
"present": false
},
{
"factor": "gcs_le_14",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"points": 0,
"present": false
},
{
"factor": "ph_lt_7_25",
"points": 0,
"present": false
},
{
"factor": "time_to_acidaemia_gt_12h",
"points": 0,
"present": false
},
{
"value": "1_to_4",
"factor": "emrcd",
"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.",
"citation": {
"authors": "Hartley T, Lane ND, Steer J, et al.",
"doi": "10.1183/13993003.04042-2020",
"id": "hartley-2021",
"pmid": "33479109",
"source": "Eur Respir J. 2021;58(2):2004042",
"title": "The Noninvasive Ventilation Outcomes (NIVO) score: prediction of in-hospital mortality in exacerbations of COPD requiring assisted ventilation"
},
"formula": "nivo",
"formula_expression": "NIVO = chest_radiograph_consolidation + gcs_le_14 + atrial_fibrillation + ph_lt_7_25 + time_to_acidaemia_gt_12h + emrcd; consolidation true -> 1; GCS <=14 prior to ventilation -> 1; AF (persistent, new, or paroxysmal even if sinus at NIV start) true -> 1; pH <7.25 -> 1; time from hospital arrival to index acidaemia >12 h -> 2; eMRCD 1_to_4 -> 0, 5a -> 2, 5b -> 3; cannot score both 5a and 5b; Hartley 2021 validation Table 4 bands 0-2 / 3-4 / 5-6 / 7-9; max 9",
"max_score": 9,
"score": 0,
"atrial_fibrillation": false,
"emrcd": "1_to_4",
"chest_radiograph_consolidation": false,
"gcs_le_14": false,
"in_hospital_mortality_percent": 5.0,
"nivo_band": "0_to_2",
"ph_lt_7_25": false,
"time_to_acidaemia_gt_12h": false
},
{
"components": [
{
"factor": "chest_radiograph_consolidation",
"points": 0,
"present": false
},
{
"factor": "gcs_le_14",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"points": 0,
"present": false
},
{
"factor": "ph_lt_7_25",
"points": 0,
"present": false
},
{
"factor": "time_to_acidaemia_gt_12h",
"points": 0,
"present": false
},
{
"value": "1_to_4",
"factor": "emrcd",
"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.",
"citation": {
"authors": "Hartley T, Lane ND, Steer J, et al.",
"doi": "10.1183/13993003.04042-2020",
"id": "hartley-2021",
"pmid": "33479109",
"source": "Eur Respir J. 2021;58(2):2004042",
"title": "The Noninvasive Ventilation Outcomes (NIVO) score: prediction of in-hospital mortality in exacerbations of COPD requiring assisted ventilation"
},
"formula": "nivo",
"formula_expression": "NIVO = chest_radiograph_consolidation + gcs_le_14 + atrial_fibrillation + ph_lt_7_25 + time_to_acidaemia_gt_12h + emrcd; consolidation true -> 1; GCS <=14 prior to ventilation -> 1; AF (persistent, new, or paroxysmal even if sinus at NIV start) true -> 1; pH <7.25 -> 1; time from hospital arrival to index acidaemia >12 h -> 2; eMRCD 1_to_4 -> 0, 5a -> 2, 5b -> 3; cannot score both 5a and 5b; Hartley 2021 validation Table 4 bands 0-2 / 3-4 / 5-6 / 7-9; max 9",
"max_score": 9,
"score": 0,
"atrial_fibrillation": false,
"emrcd": "1_to_4",
"chest_radiograph_consolidation": false,
"gcs_le_14": false,
"in_hospital_mortality_percent": 5.0,
"nivo_band": "0_to_2",
"ph_lt_7_25": false,
"time_to_acidaemia_gt_12h": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | nivo |
formula_expression |
string | Exact Hartley 2021 expression |
score |
integer | NIVO points 0-9 |
max_score |
integer | Always 9 |
nivo_band |
string | Hartley 2021 validation Table 4 grouped band: 0_to_2, 3_to_4, 5_to_6, or 7_to_9. Not a per-integer rate. |
in_hospital_mortality_percent |
number | Hartley 2021 validation Table 4 grouped in-hospital mortality percent for that band (5.0 / 16.8 / 41.2 / 71.4). Not a per-integer percent. |
chest_radiograph_consolidation |
boolean | Caller-assigned chest radiograph consolidation |
gcs_le_14 |
boolean | Caller-assigned GCS ≤14 prior to ventilation |
atrial_fibrillation |
boolean | Caller-assigned atrial fibrillation (persistent, new, or paroxysmal) |
ph_lt_7_25 |
boolean | Caller-assigned arterial pH <7.25 |
time_to_acidaemia_gt_12h |
boolean | Caller-assigned >12 h from hospital arrival to index acidaemia |
emrcd |
string | Caller-assigned eMRCD: 1_to_4, 5a, or 5b |
components |
array | Per-factor points for the six Hartley 2021 NIVO items |
citation |
object | Hartley et al. Eur Respir J 2021 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"factor": "chest_radiograph_consolidation",
"points": 0,
"present": false
},
{
"factor": "gcs_le_14",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"points": 0,
"present": false
},
{
"factor": "ph_lt_7_25",
"points": 0,
"present": false
},
{
"factor": "time_to_acidaemia_gt_12h",
"points": 0,
"present": false
},
{
"value": "1_to_4",
"factor": "emrcd",
"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.",
"citation": {
"authors": "Hartley T, Lane ND, Steer J, et al.",
"doi": "10.1183/13993003.04042-2020",
"id": "hartley-2021",
"pmid": "33479109",
"source": "Eur Respir J. 2021;58(2):2004042",
"title": "The Noninvasive Ventilation Outcomes (NIVO) score: prediction of in-hospital mortality in exacerbations of COPD requiring assisted ventilation"
},
"formula": "nivo",
"formula_expression": "NIVO = chest_radiograph_consolidation + gcs_le_14 + atrial_fibrillation + ph_lt_7_25 + time_to_acidaemia_gt_12h + emrcd; consolidation true -> 1; GCS <=14 prior to ventilation -> 1; AF (persistent, new, or paroxysmal even if sinus at NIV start) true -> 1; pH <7.25 -> 1; time from hospital arrival to index acidaemia >12 h -> 2; eMRCD 1_to_4 -> 0, 5a -> 2, 5b -> 3; cannot score both 5a and 5b; Hartley 2021 validation Table 4 bands 0-2 / 3-4 / 5-6 / 7-9; max 9",
"max_score": 9,
"score": 0,
"atrial_fibrillation": false,
"emrcd": "1_to_4",
"chest_radiograph_consolidation": false,
"gcs_le_14": false,
"in_hospital_mortality_percent": 5.0,
"nivo_band": "0_to_2",
"ph_lt_7_25": false,
"time_to_acidaemia_gt_12h": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_nivo_emrcd |
emrcd must be 1_to_4, 5a, or 5b (Hartley 2021 NIVO; 5a and 5b are mutually exclusive). Returned before settlement; you are not charged. |
| 400 | invalid_flag |
boolean clinical flags must be true or false Returned before settlement; you are not charged. |
| 400 | invalid_items |
POST body must be a JSON object with only an items array Returned before settlement; you are not charged. |
| 400 | invalid_item_count |
items must be an array of 1 to 25 objects Returned before settlement; you are not charged. |
| 400 | invalid_item |
each items entry must be a JSON object Returned before settlement; you are not charged. |
Related tools
- HACOR — Sum Duan 2017 HACOR (ESM Table 2) points from heart rate, pH, GCS, PaO2/FiO2, and respiratory rate and return low (≤5) or high (>5).
- DECAF — Sum Steer 2012 DECAF points from extended MRC dyspnoea, eosinophils, chest radiograph consolidation, arterial pH, and atrial fibrillation.
- BAP-65 — Apply Tabak 2009 BAP-65 and return class I–V from three caller-assigned main factors, using age >65 only to split class I from II when zero main factors are present.
- GOLD spirometric grade — Apply the 2017 GOLD executive summary spirometric classification: obstruction when post-bronchodilator FEV1/FVC is < 0.70, then GOLD grades 1-4 from FEV1 percent predicted.
Payment
Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s. Unpaid valid requests return HTTP 402 with a base64
PAYMENT-REQUIRED
header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /docs/mcp.
Guarantees
- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.