# H-Impairment Index (Hack)

HII

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/hii`
HTML: https://magentlab.com/docs/hii
Markdown: https://magentlab.com/docs/hii.md

Not a medical device. Not a diagnosis, dose, or listing recommendation.

## What it computes

Return the Hack 2014 H-Impairment Index (sum of completed 0-4 task scores divided by 4 times the number of tasks completed).

## When to use

When an agent has already assigned Hack 2014 bedside-task integers and needs the published current HII, not a serial decline, discharge order, or legal sobriety decision.

## When not to use

- Not a medical device. Not a diagnosis, discharge order, or legal sobriety test.
- Each of the five bedside tasks is a caller-assigned integer 0-4. magent does not examine the patient.
- Omitted tasks (not attempted) are excluded from both the numerator and the denominator. The denominator is 4 times the number of completed tasks, not always 20.
- Returns the current index only. Serial decline over time is not modeled.
- Does not take or echo a blood alcohol concentration.
- Hack 2014 published the index arithmetic only. magent does not apply later performance papers or invent impairment bands.

## Formula

```
HII = (gross_motor + mentation_speech + tracing_curve + nystagmus + finger_to_nose) / (4 × tasks_completed); each completed task a caller-assigned integer 0-4; omitted tasks excluded from numerator and denominator; max denominator 20 if all five completed; range 0-1; current index only
```

## Citation

[The H-Impairment Index (HII): a standardized assessment of alcohol-induced impairment in the Emergency Department](https://doi.org/10.3109/00952990.2013.865034)
Hack JB, Goldlust EJ, Gibbs F, Zink BJ
Am J Drug Alcohol Abuse. 2014;40(2):111-117
DOI: [10.3109/00952990.2013.865034](https://doi.org/10.3109/00952990.2013.865034)

## Worked example

### All five tasks 0

Given: `finger_to_nose=0, gross_motor=0, mentation_speech=0, nystagmus=0, tracing_curve=0`

1. gross_motor 0 + mentation_speech 0 + tracing_curve 0 + nystagmus 0 + finger_to_nose 0 = 0
2. HII = 0 / (4 × 5) = 0.0


### Two completed tasks of 2

Given: `gross_motor=2, mentation_speech=2`

1. completed sum = 2 + 2 = 4
2. HII = 4 / (4 × 2) = 0.5 (denominator is 8, not 20)


### All five tasks 4

Given: `finger_to_nose=4, gross_motor=4, mentation_speech=4, nystagmus=4, tracing_curve=4`

1. gross_motor 4 + mentation_speech 4 + tracing_curve 4 + nystagmus 4 + finger_to_nose 4 = 20
2. HII = 20 / (4 × 5) = 1.0


## Also searched as

- H-Impairment Index
- Hack Impairment Index
- HII score
- alcohol impairment index
- Hack 2014 HII
- ED alcohol impairment

## Parameters

- `gross_motor` (integer, optional): Caller-assigned Hack 2014 HII gross motor function (integer 0-4). Omit when that task was not attempted. magent does not examine the patient.
- `mentation_speech` (integer, optional): Caller-assigned Hack 2014 HII mentation and speech (integer 0-4). Omit when that task was not attempted. magent does not examine the patient.
- `tracing_curve` (integer, optional): Caller-assigned Hack 2014 HII tracing curve (integer 0-4). Omit when that task was not attempted. magent does not examine the patient.
- `nystagmus` (integer, optional): Caller-assigned Hack 2014 HII nystagmus (integer 0-4). Omit when that task was not attempted. magent does not examine the patient.
- `finger_to_nose` (integer, optional): Caller-assigned Hack 2014 HII finger-to-nose (integer 0-4). Omit when that task was not attempted. magent does not examine 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.

Method: `POST /api/calc/hii`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: PREVIEW

- 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:

```json
{
  "items": [
    {
      "finger_to_nose": "0",
      "gross_motor": "0",
      "mentation_speech": "0",
      "nystagmus": "0",
      "tracing_curve": "0"
    },
    {
      "finger_to_nose": "0",
      "gross_motor": "0",
      "mentation_speech": "0",
      "nystagmus": "0",
      "tracing_curve": "0"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/hii

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/hii",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "gross_motor",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "mentation_speech",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tracing_curve",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "nystagmus",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "finger_to_nose",
          "points": 0,
          "present": true
        }
      ],
      "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": "Hack JB, Goldlust EJ, Gibbs F, Zink BJ",
        "doi": "10.3109/00952990.2013.865034",
        "id": "hack-2014",
        "pmid": "24555813",
        "source": "Am J Drug Alcohol Abuse. 2014;40(2):111-117",
        "title": "The H-Impairment Index (HII): a standardized assessment of alcohol-induced impairment in the Emergency Department"
      },
      "formula": "hii",
      "formula_expression": "HII = (gross_motor + mentation_speech + tracing_curve + nystagmus + finger_to_nose) / (4 × tasks_completed); each completed task a caller-assigned integer 0-4; omitted tasks excluded from numerator and denominator; max denominator 20 if all five completed; range 0-1; current index only",
      "max_score": 1,
      "score": 0.0,
      "max_points": 20,
      "task_sum": 0,
      "tasks_completed": 5
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "gross_motor",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "mentation_speech",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "tracing_curve",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "nystagmus",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "finger_to_nose",
          "points": 0,
          "present": true
        }
      ],
      "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": "Hack JB, Goldlust EJ, Gibbs F, Zink BJ",
        "doi": "10.3109/00952990.2013.865034",
        "id": "hack-2014",
        "pmid": "24555813",
        "source": "Am J Drug Alcohol Abuse. 2014;40(2):111-117",
        "title": "The H-Impairment Index (HII): a standardized assessment of alcohol-induced impairment in the Emergency Department"
      },
      "formula": "hii",
      "formula_expression": "HII = (gross_motor + mentation_speech + tracing_curve + nystagmus + finger_to_nose) / (4 × tasks_completed); each completed task a caller-assigned integer 0-4; omitted tasks excluded from numerator and denominator; max denominator 20 if all five completed; range 0-1; current index only",
      "max_score": 1,
      "score": 0.0,
      "max_points": 20,
      "task_sum": 0,
      "tasks_completed": 5
    }
  ]
}
```

## Response fields

- `formula` (string): hii
- `formula_expression` (string): Exact expression used
- `score` (number): Hack 2014 HII (completed sum / (4 × tasks completed)); range 0-1
- `max_score` (integer): Always 1 (published HII ceiling)
- `task_sum` (integer): Sum of completed caller-assigned task scores
- `tasks_completed` (integer): Count of tasks that were attempted (1-5)
- `max_points` (integer): 4 × tasks_completed (20 if all five completed)
- `components` (array): Per-task points; omitted tasks have present false and do not enter the index
- `citation` (object): Hack et al. Am J Drug Alcohol Abuse 2014 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "gross_motor",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "mentation_speech",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "tracing_curve",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "nystagmus",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "finger_to_nose",
      "points": 0,
      "present": true
    }
  ],
  "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": "Hack JB, Goldlust EJ, Gibbs F, Zink BJ",
    "doi": "10.3109/00952990.2013.865034",
    "id": "hack-2014",
    "pmid": "24555813",
    "source": "Am J Drug Alcohol Abuse. 2014;40(2):111-117",
    "title": "The H-Impairment Index (HII): a standardized assessment of alcohol-induced impairment in the Emergency Department"
  },
  "formula": "hii",
  "formula_expression": "HII = (gross_motor + mentation_speech + tracing_curve + nystagmus + finger_to_nose) / (4 × tasks_completed); each completed task a caller-assigned integer 0-4; omitted tasks excluded from numerator and denominator; max denominator 20 if all five completed; range 0-1; current index only",
  "max_score": 1,
  "score": 0.0,
  "max_points": 20,
  "task_sum": 0,
  "tasks_completed": 5
}
```

## Errors

- HTTP 400 `invalid_hii_task`: each Hack 2014 HII task must be an integer from 0 to 4 (or omitted when that task was not attempted). Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [CIWA-Ar](https://magentlab.com/docs/ciwa-ar) — Sum the ten Sullivan 1989 CIWA-Ar items (nine caller-assigned 0-7 plus orientation 0-4) and return the published total (max 67).
- [CAGE](https://magentlab.com/docs/cage) — Sum the four Ewing 1984 CAGE items and return whether two or more answers are affirmative.

## 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.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/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.
