# GO-FAR score

GO-FAR

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

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

## What it computes

Sum the Ebell 2013 GO-FAR Table 3 integer score (beta × 10 rounded) from exclusive age and 12 caller-assigned prearrest flags, and return the published likelihood band for CPC 1 after in-hospital CPR.

## When to use

When an agent already has Ebell 2013 GO-FAR prearrest items assigned and needs the published −15 to 76 total and likelihood band (very_low / low / average / above_average) for CPC 1 after IHCA, not a code-status order and not GO-FAR 2.

## When not to use

- Not a medical device. Not a diagnosis. Not a DNAR or code-status order. magent does not assign code status.
- Ebell 2013 GO-FAR Table 3 integer score only. Not GO-FAR 2.
- Outcome is CPC 1 (neurologically intact or minimal deficits) after in-hospital CPR as published. magent does not examine the patient; every flag is caller-assigned, including CPC 1 at admission.
- Age bands are mutually exclusive (<70 = 0, 70-74 = 2, 75-79 = 5, 80-84 = 6, >=85 = 11).
- risk_band is a published likelihood-grouping token only. magent does not emit the paper's cohort percents as if it measured this patient.

## Formula

```
GO-FAR = exclusive age (<70: 0, 70-74: 2, 75-79: 5, 80-84: 6, >=85: 11) + Table 3 flags (neurologically intact -15, major trauma 10, acute stroke 8, metastatic or hematologic cancer 7, septicemia 7, medical noncardiac 7, hepatic insufficiency 6, admit from SNF 6, hypotension or hypoperfusion 5, renal insufficiency or dialysis 4, respiratory insufficiency 4, pneumonia 1); range -15 to 76; >=24 very_low, 14-23 low, -5 to 13 average, <=-6 above_average (Ebell 2013)
```

## Citation

[Development and Validation of the Good Outcome Following Attempted Resuscitation (GO-FAR) Score to Predict Neurologically Intact Survival After In-Hospital Cardiopulmonary Resuscitation](https://doi.org/10.1001/jamainternmed.2013.10037)
Ebell MH, Jang W, Shen Y, Geocadin RG, et al
JAMA Intern Med. 2013;173(20):1872-1878
DOI: [10.1001/jamainternmed.2013.10037](https://doi.org/10.1001/jamainternmed.2013.10037)

## Worked example

### Age 60, all flags false

Given: `acute_stroke=false, admit_from_skilled_nursing=false, age=60, hepatic_insufficiency=false, hypotension_or_hypoperfusion=false, major_trauma=false, medical_noncardiac_diagnosis=false, metastatic_or_hematologic_cancer=false, neurologically_intact_or_minimal_deficits=false, pneumonia=false, renal_insufficiency_or_dialysis=false, respiratory_insufficiency=false, septicemia=false`

1. Age 60 is younger than 70 → 0; all 12 flags false → 0
2. Score = 0 (max 76); risk_band average


## Also searched as

- GO-FAR score
- Good Outcome Following Attempted Resuscitation
- Ebell GO-FAR
- in-hospital CPR neurologic survival
- GO-FAR 2013
- CPC 1 after IHCA
- prearrest resuscitation score

## Parameters

- `age` (integer, required): Age in years (18-120). Ebell 2013 exclusive bands: younger than 70 scores 0; 70-74 scores 2; 75-79 scores 5; 80-84 scores 6; 85 or older scores 11. Age 69 scores 0; 70 scores 2.
- `neurologically_intact_or_minimal_deficits` (boolean, required): Neurologically intact or with minimal deficits at admission (CPC 1) as assigned by the caller (Ebell 2013 Table 3). true scores -15. false scores 0. magent does not assign CPC or examine the patient.
- `major_trauma` (boolean, required): Major trauma as assigned by the caller (Ebell 2013 Table 3). true scores 10. magent does not examine the patient.
- `acute_stroke` (boolean, required): Acute stroke as assigned by the caller (Ebell 2013 Table 3). true scores 8. magent does not diagnose stroke.
- `metastatic_or_hematologic_cancer` (boolean, required): Metastatic or hematologic cancer as assigned by the caller (Ebell 2013 Table 3). true scores 7. magent does not diagnose cancer.
- `septicemia` (boolean, required): Septicemia as assigned by the caller (Ebell 2013 Table 3). true scores 7. magent does not diagnose infection.
- `medical_noncardiac_diagnosis` (boolean, required): Medical noncardiac diagnosis as assigned by the caller (Ebell 2013 Table 3). true scores 7. Independent of the other flags.
- `hepatic_insufficiency` (boolean, required): Hepatic insufficiency as assigned by the caller (Ebell 2013 Table 3). true scores 6. magent does not grade liver tests.
- `admit_from_skilled_nursing` (boolean, required): Admitted from a skilled nursing facility as assigned by the caller (Ebell 2013 Table 3). true scores 6.
- `hypotension_or_hypoperfusion` (boolean, required): Hypotension or hypoperfusion as assigned by the caller (Ebell 2013 Table 3). true scores 5. magent does not take blood pressure.
- `renal_insufficiency_or_dialysis` (boolean, required): Renal insufficiency or dialysis as assigned by the caller (Ebell 2013 Table 3). true scores 4. magent does not grade creatinine.
- `respiratory_insufficiency` (boolean, required): Respiratory insufficiency as assigned by the caller (Ebell 2013 Table 3). true scores 4. magent does not interpret blood gas or ventilator settings.
- `pneumonia` (boolean, required): Pneumonia as assigned by the caller (Ebell 2013 Table 3). true scores 1. magent does not diagnose pneumonia.

## 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/go_far`
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": [
    {
      "acute_stroke": "false",
      "admit_from_skilled_nursing": "false",
      "age": "60",
      "hepatic_insufficiency": "false",
      "hypotension_or_hypoperfusion": "false",
      "major_trauma": "false",
      "medical_noncardiac_diagnosis": "false",
      "metastatic_or_hematologic_cancer": "false",
      "neurologically_intact_or_minimal_deficits": "false",
      "pneumonia": "false",
      "renal_insufficiency_or_dialysis": "false",
      "respiratory_insufficiency": "false",
      "septicemia": "false"
    },
    {
      "acute_stroke": "false",
      "admit_from_skilled_nursing": "false",
      "age": "60",
      "hepatic_insufficiency": "false",
      "hypotension_or_hypoperfusion": "false",
      "major_trauma": "false",
      "medical_noncardiac_diagnosis": "false",
      "metastatic_or_hematologic_cancer": "false",
      "neurologically_intact_or_minimal_deficits": "false",
      "pneumonia": "false",
      "renal_insufficiency_or_dialysis": "false",
      "respiratory_insufficiency": "false",
      "septicemia": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/go_far",
  "items": [
    {
      "components": [
        {
          "value": 60,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "neurologically_intact_or_minimal_deficits",
          "points": 0,
          "present": false
        },
        {
          "factor": "major_trauma",
          "points": 0,
          "present": false
        },
        {
          "factor": "acute_stroke",
          "points": 0,
          "present": false
        },
        {
          "factor": "metastatic_or_hematologic_cancer",
          "points": 0,
          "present": false
        },
        {
          "factor": "septicemia",
          "points": 0,
          "present": false
        },
        {
          "factor": "medical_noncardiac_diagnosis",
          "points": 0,
          "present": false
        },
        {
          "factor": "hepatic_insufficiency",
          "points": 0,
          "present": false
        },
        {
          "factor": "admit_from_skilled_nursing",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypotension_or_hypoperfusion",
          "points": 0,
          "present": false
        },
        {
          "factor": "renal_insufficiency_or_dialysis",
          "points": 0,
          "present": false
        },
        {
          "factor": "respiratory_insufficiency",
          "points": 0,
          "present": false
        },
        {
          "factor": "pneumonia",
          "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.",
      "age_years": 60,
      "citation": {
        "authors": "Ebell MH, Jang W, Shen Y, Geocadin RG, et al",
        "doi": "10.1001/jamainternmed.2013.10037",
        "id": "ebell-2013",
        "pmid": "24018585",
        "source": "JAMA Intern Med. 2013;173(20):1872-1878",
        "title": "Development and Validation of the Good Outcome Following Attempted Resuscitation (GO-FAR) Score to Predict Neurologically Intact Survival After In-Hospital Cardiopulmonary Resuscitation"
      },
      "formula": "go_far",
      "formula_expression": "GO-FAR = exclusive age (<70: 0, 70-74: 2, 75-79: 5, 80-84: 6, >=85: 11) + Table 3 flags (neurologically intact -15, major trauma 10, acute stroke 8, metastatic or hematologic cancer 7, septicemia 7, medical noncardiac 7, hepatic insufficiency 6, admit from SNF 6, hypotension or hypoperfusion 5, renal insufficiency or dialysis 4, respiratory insufficiency 4, pneumonia 1); range -15 to 76; >=24 very_low, 14-23 low, -5 to 13 average, <=-6 above_average (Ebell 2013)",
      "max_score": 76,
      "score": 0,
      "risk_band": "average"
    },
    {
      "components": [
        {
          "value": 60,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "neurologically_intact_or_minimal_deficits",
          "points": 0,
          "present": false
        },
        {
          "factor": "major_trauma",
          "points": 0,
          "present": false
        },
        {
          "factor": "acute_stroke",
          "points": 0,
          "present": false
        },
        {
          "factor": "metastatic_or_hematologic_cancer",
          "points": 0,
          "present": false
        },
        {
          "factor": "septicemia",
          "points": 0,
          "present": false
        },
        {
          "factor": "medical_noncardiac_diagnosis",
          "points": 0,
          "present": false
        },
        {
          "factor": "hepatic_insufficiency",
          "points": 0,
          "present": false
        },
        {
          "factor": "admit_from_skilled_nursing",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypotension_or_hypoperfusion",
          "points": 0,
          "present": false
        },
        {
          "factor": "renal_insufficiency_or_dialysis",
          "points": 0,
          "present": false
        },
        {
          "factor": "respiratory_insufficiency",
          "points": 0,
          "present": false
        },
        {
          "factor": "pneumonia",
          "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.",
      "age_years": 60,
      "citation": {
        "authors": "Ebell MH, Jang W, Shen Y, Geocadin RG, et al",
        "doi": "10.1001/jamainternmed.2013.10037",
        "id": "ebell-2013",
        "pmid": "24018585",
        "source": "JAMA Intern Med. 2013;173(20):1872-1878",
        "title": "Development and Validation of the Good Outcome Following Attempted Resuscitation (GO-FAR) Score to Predict Neurologically Intact Survival After In-Hospital Cardiopulmonary Resuscitation"
      },
      "formula": "go_far",
      "formula_expression": "GO-FAR = exclusive age (<70: 0, 70-74: 2, 75-79: 5, 80-84: 6, >=85: 11) + Table 3 flags (neurologically intact -15, major trauma 10, acute stroke 8, metastatic or hematologic cancer 7, septicemia 7, medical noncardiac 7, hepatic insufficiency 6, admit from SNF 6, hypotension or hypoperfusion 5, renal insufficiency or dialysis 4, respiratory insufficiency 4, pneumonia 1); range -15 to 76; >=24 very_low, 14-23 low, -5 to 13 average, <=-6 above_average (Ebell 2013)",
      "max_score": 76,
      "score": 0,
      "risk_band": "average"
    }
  ]
}
```

## Response fields

- `formula` (string): go_far
- `formula_expression` (string): Exact expression used
- `score` (integer): Ebell 2013 Table 3 GO-FAR points -15 to 76
- `max_score` (integer): 76 (all adverse flags, not intact, age >=85)
- `risk_band` (string): Ebell 2013 likelihood of CPC 1 after IHCA: very_low (score >=24), low (14-23), average (-5 to 13), or above_average (score <=-6). A band token, not a measured percent and not a DNAR order.
- `age_years` (integer): Age used for the exclusive age band
- `components` (array): Per-factor points
- `citation` (object): Ebell JAMA Intern Med 2013 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 60,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "factor": "neurologically_intact_or_minimal_deficits",
      "points": 0,
      "present": false
    },
    {
      "factor": "major_trauma",
      "points": 0,
      "present": false
    },
    {
      "factor": "acute_stroke",
      "points": 0,
      "present": false
    },
    {
      "factor": "metastatic_or_hematologic_cancer",
      "points": 0,
      "present": false
    },
    {
      "factor": "septicemia",
      "points": 0,
      "present": false
    },
    {
      "factor": "medical_noncardiac_diagnosis",
      "points": 0,
      "present": false
    },
    {
      "factor": "hepatic_insufficiency",
      "points": 0,
      "present": false
    },
    {
      "factor": "admit_from_skilled_nursing",
      "points": 0,
      "present": false
    },
    {
      "factor": "hypotension_or_hypoperfusion",
      "points": 0,
      "present": false
    },
    {
      "factor": "renal_insufficiency_or_dialysis",
      "points": 0,
      "present": false
    },
    {
      "factor": "respiratory_insufficiency",
      "points": 0,
      "present": false
    },
    {
      "factor": "pneumonia",
      "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.",
  "age_years": 60,
  "citation": {
    "authors": "Ebell MH, Jang W, Shen Y, Geocadin RG, et al",
    "doi": "10.1001/jamainternmed.2013.10037",
    "id": "ebell-2013",
    "pmid": "24018585",
    "source": "JAMA Intern Med. 2013;173(20):1872-1878",
    "title": "Development and Validation of the Good Outcome Following Attempted Resuscitation (GO-FAR) Score to Predict Neurologically Intact Survival After In-Hospital Cardiopulmonary Resuscitation"
  },
  "formula": "go_far",
  "formula_expression": "GO-FAR = exclusive age (<70: 0, 70-74: 2, 75-79: 5, 80-84: 6, >=85: 11) + Table 3 flags (neurologically intact -15, major trauma 10, acute stroke 8, metastatic or hematologic cancer 7, septicemia 7, medical noncardiac 7, hepatic insufficiency 6, admit from SNF 6, hypotension or hypoperfusion 5, renal insufficiency or dialysis 4, respiratory insufficiency 4, pneumonia 1); range -15 to 76; >=24 very_low, 14-23 low, -5 to 13 average, <=-6 above_average (Ebell 2013)",
  "max_score": 76,
  "score": 0,
  "risk_band": "average"
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 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_go_far`: each GO-FAR 2013 item must be a published value for that field. 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

- [NEWS](https://magentlab.com/docs/news) — Compute the RCP 2012 National Early Warning Score from respiratory rate, SpO2, supplemental oxygen, temperature, systolic BP, heart rate, and caller-assigned AVPU.

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