# MACS ACS probability

MACS

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

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

## What it computes

Compute the Body 2014 Manchester Acute Coronary Syndromes (MACS) logistic probability of ACS from caller-assigned ECG ischaemia, worsening angina, right-arm or shoulder radiation, vomiting, observed sweating, hypotension, Roche Elecsys hs-cTnT in ng/L, and ELISA heart-type fatty acid-binding protein in ng/mL.

## When to use

When an agent already has those Body 2014 predictors as assigned by the caller and needs the published MACS probability and risk band. magent does not interpret an ECG or assay biomarkers. Not a diagnosis, discharge protocol, or T-MACS (troponin-only).

## When not to use

- Not a medical device. Not a diagnosis of ACS.
- ecg_ischaemia, worsening_angina, pain_radiation_right_arm_or_shoulder, vomiting, sweating_observed, and hypotension are caller-assigned. magent does not interpret ECG ischaemia or assay biomarkers.
- hs-cTnT is Roche Diagnostics Elecsys in ng/L as entered. 0–100000 ng/L is an implementation clamp. magent does not convert units.
- H-FABP is the ELISA value in ng/mL as in Body 2014. 0–200 ng/mL is an implementation clamp. magent does not apply the later immunoturbidimetric h-FABP transform (b-0.2844)/1.3520 from Body 2015 EMJ.
- Body 2014 Table 2 rounded MACS coefficients only. Not T-MACS (Body 2016 troponin-only). Not HEART. Not EDACS.
- Figure 2 writes very low <2%, low 2–5%, moderate 5–95%, and high ≥95%. magent uses a complete partition: p<0.02 very_low, 0.02≤p<0.05 low, 0.05≤p<0.95 moderate, p≥0.95 high. Bands use unrounded p.
- This tool returns the logistic probability and band. It is not a discharge, observation, or rule-out protocol.

## Formula

```
p = 1/(1+e^(-λ)); λ = 0.068*a + 0.17*b + 1.75*c + 1.85*d + 1.72*e + 1.46*f + 0.92*g + 0.87*h - 4.83; a Roche Elecsys hs-cTnT ng/L; b ELISA H-FABP ng/mL; c ECG ischaemia 0/1; d sweating observed 0/1; e vomiting 0/1; f hypotension SBP<100 0/1; g worsening angina 0/1; h right-arm/shoulder radiation 0/1; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2014 Table 2 rounded values)
```

## Citation

[The Manchester Acute Coronary Syndromes (MACS) decision rule for suspected cardiac chest pain: derivation and external validation](https://doi.org/10.1136/heartjnl-2014-305564)
Body R, Carley S, McDowell G, et al.
Heart. 2014;100(18):1462-1468
DOI: [10.1136/heartjnl-2014-305564](https://doi.org/10.1136/heartjnl-2014-305564)

## Worked example

### All dichotomous false, hs-cTnT 3 ng/L, H-FABP 1 ng/mL

Given: `ecg_ischaemia=false, h_fabp_ng_ml=1, hs_ctnt_ng_l=3, hypotension=false, pain_radiation_right_arm_or_shoulder=false, sweating_observed=false, vomiting=false, worsening_angina=false`

1. c=d=e=f=g=h=0; a=3; b=1
2. λ = 0.068×3 + 0.17×1 - 4.83 = -4.456
3. p = 1/(1+e^4.456) = 0.0115
4. p<0.02 → very_low


## Also searched as

- MACS
- Manchester Acute Coronary Syndromes
- original MACS
- Body MACS
- MACS H-FABP
- Manchester ACS decision rule
- MACS chest pain
- hs-cTnT H-FABP MACS

## Parameters

- `ecg_ischaemia` (boolean, required): Caller-assigned ECG ischaemia as used in Body 2014 (c; 1 if true, 0 if false). magent does not interpret an ECG.
- `worsening_angina` (boolean, required): Worsening or crescendo angina as assigned by the caller (g): anginal pain with increasing frequency, occurring with less exertion, or becoming more prolonged (Body 2014). true or false.
- `pain_radiation_right_arm_or_shoulder` (boolean, required): Pain radiating to the right arm or shoulder as assigned by the caller (h; Body 2014). true or false. magent does not take a pain history.
- `vomiting` (boolean, required): Vomiting in association with the presenting symptoms as assigned by the caller (e; Body 2014). true or false.
- `sweating_observed` (boolean, required): Sweating observed by the treating clinician as assigned by the caller (d; Body 2014). true or false. magent does not examine the patient.
- `hypotension` (boolean, required): Hypotension as assigned by the caller (f): systolic BP <100 mm Hg on arrival (Body 2014, dichotomised as in that paper). true or false.
- `hs_ctnt_ng_l` (number, required): Roche Diagnostics Elecsys high-sensitivity cardiac troponin T on arrival in ng/L (a; 0-100000, implementation clamp). Continuous linear predictor in Body 2014 Table 2. magent does not convert units or assay troponin.
- `h_fabp_ng_ml` (number, required): Heart-type fatty acid-binding protein by ELISA in ng/mL as in Body 2014 (b; 0-200, implementation clamp). Continuous linear predictor. magent does not convert units, assay H-FABP, or apply the later immunoturbidimetric transform.

## 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/macs`
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": [
    {
      "ecg_ischaemia": "false",
      "h_fabp_ng_ml": "1",
      "hs_ctnt_ng_l": "3",
      "hypotension": "false",
      "pain_radiation_right_arm_or_shoulder": "false",
      "sweating_observed": "false",
      "vomiting": "false",
      "worsening_angina": "false"
    },
    {
      "ecg_ischaemia": "false",
      "h_fabp_ng_ml": "1",
      "hs_ctnt_ng_l": "3",
      "hypotension": "false",
      "pain_radiation_right_arm_or_shoulder": "false",
      "sweating_observed": "false",
      "vomiting": "false",
      "worsening_angina": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/macs",
  "items": [
    {
      "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": "Body R, Carley S, McDowell G, et al.",
        "doi": "10.1136/heartjnl-2014-305564",
        "id": "body-2014",
        "pmid": "24780911",
        "source": "Heart. 2014;100(18):1462-1468",
        "title": "The Manchester Acute Coronary Syndromes (MACS) decision rule for suspected cardiac chest pain: derivation and external validation"
      },
      "formula": "macs",
      "formula_expression": "p = 1/(1+e^(-λ)); λ = 0.068*a + 0.17*b + 1.75*c + 1.85*d + 1.72*e + 1.46*f + 0.92*g + 0.87*h - 4.83; a Roche Elecsys hs-cTnT ng/L; b ELISA H-FABP ng/mL; c ECG ischaemia 0/1; d sweating observed 0/1; e vomiting 0/1; f hypotension SBP<100 0/1; g worsening angina 0/1; h right-arm/shoulder radiation 0/1; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2014 Table 2 rounded values)",
      "vomiting": false,
      "hypotension": false,
      "linear_predictor": -4.456,
      "probability": 0.0115,
      "ecg_ischaemia": false,
      "h_fabp_ng_ml": 1.0,
      "hs_ctnt_ng_l": 3.0,
      "macs_band": "very_low",
      "pain_radiation_right_arm_or_shoulder": false,
      "sweating_observed": false,
      "worsening_angina": 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": "Body R, Carley S, McDowell G, et al.",
        "doi": "10.1136/heartjnl-2014-305564",
        "id": "body-2014",
        "pmid": "24780911",
        "source": "Heart. 2014;100(18):1462-1468",
        "title": "The Manchester Acute Coronary Syndromes (MACS) decision rule for suspected cardiac chest pain: derivation and external validation"
      },
      "formula": "macs",
      "formula_expression": "p = 1/(1+e^(-λ)); λ = 0.068*a + 0.17*b + 1.75*c + 1.85*d + 1.72*e + 1.46*f + 0.92*g + 0.87*h - 4.83; a Roche Elecsys hs-cTnT ng/L; b ELISA H-FABP ng/mL; c ECG ischaemia 0/1; d sweating observed 0/1; e vomiting 0/1; f hypotension SBP<100 0/1; g worsening angina 0/1; h right-arm/shoulder radiation 0/1; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2014 Table 2 rounded values)",
      "vomiting": false,
      "hypotension": false,
      "linear_predictor": -4.456,
      "probability": 0.0115,
      "ecg_ischaemia": false,
      "h_fabp_ng_ml": 1.0,
      "hs_ctnt_ng_l": 3.0,
      "macs_band": "very_low",
      "pain_radiation_right_arm_or_shoulder": false,
      "sweating_observed": false,
      "worsening_angina": false
    }
  ]
}
```

## Response fields

- `formula` (string): macs
- `formula_expression` (string): Body 2014 Table 2 rounded MACS logistic expression
- `ecg_ischaemia` (boolean): Caller-assigned ECG ischaemia used as c
- `worsening_angina` (boolean): Caller-assigned worsening/crescendo angina used as g
- `pain_radiation_right_arm_or_shoulder` (boolean): Caller-assigned right-arm or shoulder radiation used as h
- `vomiting` (boolean): Caller-assigned vomiting used as e
- `sweating_observed` (boolean): Caller-assigned observed sweating used as d
- `hypotension` (boolean): Caller-assigned hypotension (SBP <100 mm Hg) used as f
- `hs_ctnt_ng_l` (number): Roche Elecsys hs-cTnT used as a, in ng/L
- `h_fabp_ng_ml` (number): ELISA H-FABP used as b, in ng/mL as in Body 2014
- `linear_predictor` (number): Body 2014 Table 2 λ from the rounded coefficients, 4 decimals
- `probability` (number): p = 1/(1+e^(-λ)) on 0-1, 4 decimals. Banded on unrounded p.
- `macs_band` (string): very_low (p<0.02), low (0.02≤p<0.05), moderate (0.05≤p<0.95), or high (p≥0.95). Figure 2 bands. Not a diagnosis.
- `citation` (object): Body 2014 Heart citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Body R, Carley S, McDowell G, et al.",
    "doi": "10.1136/heartjnl-2014-305564",
    "id": "body-2014",
    "pmid": "24780911",
    "source": "Heart. 2014;100(18):1462-1468",
    "title": "The Manchester Acute Coronary Syndromes (MACS) decision rule for suspected cardiac chest pain: derivation and external validation"
  },
  "formula": "macs",
  "formula_expression": "p = 1/(1+e^(-λ)); λ = 0.068*a + 0.17*b + 1.75*c + 1.85*d + 1.72*e + 1.46*f + 0.92*g + 0.87*h - 4.83; a Roche Elecsys hs-cTnT ng/L; b ELISA H-FABP ng/mL; c ECG ischaemia 0/1; d sweating observed 0/1; e vomiting 0/1; f hypotension SBP<100 0/1; g worsening angina 0/1; h right-arm/shoulder radiation 0/1; very_low p<0.02, low 0.02<=p<0.05, moderate 0.05<=p<0.95, high p>=0.95 (Body 2014 Table 2 rounded values)",
  "vomiting": false,
  "hypotension": false,
  "linear_predictor": -4.456,
  "probability": 0.0115,
  "ecg_ischaemia": false,
  "h_fabp_ng_ml": 1.0,
  "hs_ctnt_ng_l": 3.0,
  "macs_band": "very_low",
  "pain_radiation_right_arm_or_shoulder": false,
  "sweating_observed": false,
  "worsening_angina": false
}
```

## Errors

- HTTP 400 `invalid_macs`: MACS inputs must match Body 2014 dichotomous predictors, Roche hs-cTnT ng/L, and H-FABP ng/mL from that paper. Returned before settlement; you are not charged.
- HTTP 400 `invalid_hfabp`: h_fabp_ng_ml must be a number from 0 to 200 (Body 2014 MACS heart-type fatty acid binding protein ng/mL). 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

- [T-MACS](https://magentlab.com/docs/t-macs) — Compute the Body 2016 Troponin-only Manchester Acute Coronary Syndromes (T-MACS) logistic probability of ACS from caller-assigned ECG ischaemia, worsening angina, right-arm or shoulder radiation, vomiting, observed sweating, hypotension, and Roche Elecsys hs-cTnT in ng/L.
- [HEART score](https://magentlab.com/docs/heart) — Compute the HEART score as age points plus caller-assigned history, ECG, risk factors, and troponin (each 0-2).

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