# Framingham heart-failure criteria

Framingham HF criteria

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

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

## What it computes

Apply the McKee 1971 Framingham concurrent major and minor criteria and return definite or not_definite from nine major flags, seven minor flags, and the dual weight-loss flag.

## When to use

When an agent already has the published McKee 1971 Framingham congestive heart-failure findings assigned as flags and needs the concurrent two-major or one-major-plus-two-minor classification. magent does not examine the patient, measure venous pressure, circulation time, or vital capacity, or perform echocardiography.

## When not to use

- Not a medical device and not a diagnosis of heart failure.
- Not an echocardiographic diagnosis. magent does not perform echocardiography or assign ejection fraction.
- Not HFrEF or HFpEF staging. This tool is the McKee 1971 Framingham concurrent criteria only.
- The caller assigns every flag. magent does not examine the patient or measure venous pressure, circulation time, vital capacity, or weight.
- Concurrency of criteria is caller-applied; magent does not collect observation time.
- Returned major_count and minor_count are the nine and seven fixed flags only. Weight loss ≥4.5 kg in 5 days in response to treatment is dual and is not added to those counts.

## Formula

```
definite iff 2 major OR (1 major AND 2 minor) concurrent (McKee 1971). weight_loss_45kg_5d_treatment (≥4.5 kg in 5 days in response to treatment) counts as major if that assignment is definite, else as minor if that assignment is definite, else unused. major_count is the 9 fixed majors; minor_count is the 7 fixed minors
```

## Citation

[The natural history of congestive heart failure: the Framingham study](https://doi.org/10.1056/NEJM197112232852601)
McKee PA, Castelli WP, McNamara PM, Kannel WB
N Engl J Med. 1971;285(26):1441-1446
DOI: [10.1056/NEJM197112232852601](https://doi.org/10.1056/NEJM197112232852601)

## Worked example

### All flags absent

Given: `acute_pulmonary_edema=false, ankle_edema=false, cardiomegaly=false, circulation_time_ge_25=false, dyspnea_on_exertion=false, hepatojugular_reflux=false, hepatomegaly=false, neck_vein_distention=false, night_cough=false, pleural_effusion=false, pnd_or_orthopnea=false, rales=false, s3_gallop=false, tachycardia_ge_120=false, venous_pressure_gt_16=false, vital_capacity_decreased_third=false, weight_loss_45kg_5d_treatment=false`

1. All nine major flags and all seven minor flags are false
2. weight_loss_45kg_5d_treatment is false, so the dual criterion is unused
3. 0 major and 0 minor is not definite


## Also searched as

- Framingham heart failure criteria
- Framingham CHF criteria
- McKee 1971 CHF
- Framingham congestive heart failure
- McKee Framingham criteria
- Framingham major minor CHF
- Framingham study heart failure

## Parameters

- `pnd_or_orthopnea` (boolean, required): Paroxysmal nocturnal dyspnea or orthopnea (McKee 1971 major). true or false as assigned by the caller. magent does not take a history.
- `neck_vein_distention` (boolean, required): Neck-vein distention (McKee 1971 major). true or false as assigned by the caller. magent does not examine the neck veins.
- `rales` (boolean, required): Rales (McKee 1971 major). true or false as assigned by the caller. magent does not auscultate the lungs.
- `cardiomegaly` (boolean, required): Cardiomegaly (McKee 1971 major). true or false as assigned by the caller. magent does not interpret a chest radiograph.
- `acute_pulmonary_edema` (boolean, required): Acute pulmonary edema (McKee 1971 major). true or false as assigned by the caller. magent does not diagnose pulmonary edema.
- `s3_gallop` (boolean, required): S3 gallop (McKee 1971 major). true or false as assigned by the caller. magent does not auscultate the heart.
- `venous_pressure_gt_16` (boolean, required): Increased venous pressure >16 cm of water (McKee 1971 major). true or false as assigned by the caller. magent does not measure venous pressure.
- `circulation_time_ge_25` (boolean, required): Circulation time ≥25 seconds (McKee 1971 major). true or false as assigned by the caller. magent does not measure circulation time.
- `hepatojugular_reflux` (boolean, required): Hepatojugular reflux (McKee 1971 major). true or false as assigned by the caller. magent does not examine the patient.
- `ankle_edema` (boolean, required): Ankle edema (McKee 1971 minor). true or false as assigned by the caller. magent does not examine the ankles.
- `night_cough` (boolean, required): Night cough (McKee 1971 minor). true or false as assigned by the caller. magent does not take a history.
- `dyspnea_on_exertion` (boolean, required): Dyspnea on exertion (McKee 1971 minor). true or false as assigned by the caller. magent does not take a history.
- `hepatomegaly` (boolean, required): Hepatomegaly (McKee 1971 minor). true or false as assigned by the caller. magent does not examine the liver.
- `pleural_effusion` (boolean, required): Pleural effusion (McKee 1971 minor). true or false as assigned by the caller. magent does not interpret imaging.
- `vital_capacity_decreased_third` (boolean, required): Vital capacity decreased one third from maximum (McKee 1971 minor). true or false as assigned by the caller. magent does not measure vital capacity.
- `tachycardia_ge_120` (boolean, required): Tachycardia ≥120 per minute (McKee 1971 minor). true or false as assigned by the caller. magent does not measure heart rate.
- `weight_loss_45kg_5d_treatment` (boolean, required): Weight loss ≥4.5 kg in 5 days in response to treatment (McKee 1971 dual major-or-minor). true or false as assigned by the caller. Counted as major if that assignment is definite, else as minor if that assignment is definite, else unused. magent does not weigh 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/framingham_hf`
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_pulmonary_edema": "false",
      "ankle_edema": "false",
      "cardiomegaly": "false",
      "circulation_time_ge_25": "false",
      "dyspnea_on_exertion": "false",
      "hepatojugular_reflux": "false",
      "hepatomegaly": "false",
      "neck_vein_distention": "false",
      "night_cough": "false",
      "pleural_effusion": "false",
      "pnd_or_orthopnea": "false",
      "rales": "false",
      "s3_gallop": "false",
      "tachycardia_ge_120": "false",
      "venous_pressure_gt_16": "false",
      "vital_capacity_decreased_third": "false",
      "weight_loss_45kg_5d_treatment": "false"
    },
    {
      "acute_pulmonary_edema": "false",
      "ankle_edema": "false",
      "cardiomegaly": "false",
      "circulation_time_ge_25": "false",
      "dyspnea_on_exertion": "false",
      "hepatojugular_reflux": "false",
      "hepatomegaly": "false",
      "neck_vein_distention": "false",
      "night_cough": "false",
      "pleural_effusion": "false",
      "pnd_or_orthopnea": "false",
      "rales": "false",
      "s3_gallop": "false",
      "tachycardia_ge_120": "false",
      "venous_pressure_gt_16": "false",
      "vital_capacity_decreased_third": "false",
      "weight_loss_45kg_5d_treatment": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/framingham_hf",
  "items": [
    {
      "components": [
        {
          "factor": "pnd_or_orthopnea",
          "met": false
        },
        {
          "factor": "neck_vein_distention",
          "met": false
        },
        {
          "factor": "rales",
          "met": false
        },
        {
          "factor": "cardiomegaly",
          "met": false
        },
        {
          "factor": "acute_pulmonary_edema",
          "met": false
        },
        {
          "factor": "s3_gallop",
          "met": false
        },
        {
          "factor": "venous_pressure_gt_16",
          "met": false
        },
        {
          "factor": "circulation_time_ge_25",
          "met": false
        },
        {
          "factor": "hepatojugular_reflux",
          "met": false
        },
        {
          "factor": "ankle_edema",
          "met": false
        },
        {
          "factor": "night_cough",
          "met": false
        },
        {
          "factor": "dyspnea_on_exertion",
          "met": false
        },
        {
          "factor": "hepatomegaly",
          "met": false
        },
        {
          "factor": "pleural_effusion",
          "met": false
        },
        {
          "factor": "vital_capacity_decreased_third",
          "met": false
        },
        {
          "factor": "tachycardia_ge_120",
          "met": false
        },
        {
          "factor": "weight_loss_45kg_5d_treatment",
          "met": 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": "McKee PA, Castelli WP, McNamara PM, Kannel WB",
        "doi": "10.1056/NEJM197112232852601",
        "id": "mckee-1971",
        "pmid": "5122894",
        "source": "N Engl J Med. 1971;285(26):1441-1446",
        "title": "The natural history of congestive heart failure: the Framingham study"
      },
      "formula": "framingham_hf",
      "formula_expression": "definite iff 2 major OR (1 major AND 2 minor) concurrent (McKee 1971). weight_loss_45kg_5d_treatment (≥4.5 kg in 5 days in response to treatment) counts as major if that assignment is definite, else as minor if that assignment is definite, else unused. major_count is the 9 fixed majors; minor_count is the 7 fixed minors",
      "classification": "not_definite",
      "major_count": 0,
      "minor_count": 0,
      "weight_loss_45kg_5d_treatment": false
    },
    {
      "components": [
        {
          "factor": "pnd_or_orthopnea",
          "met": false
        },
        {
          "factor": "neck_vein_distention",
          "met": false
        },
        {
          "factor": "rales",
          "met": false
        },
        {
          "factor": "cardiomegaly",
          "met": false
        },
        {
          "factor": "acute_pulmonary_edema",
          "met": false
        },
        {
          "factor": "s3_gallop",
          "met": false
        },
        {
          "factor": "venous_pressure_gt_16",
          "met": false
        },
        {
          "factor": "circulation_time_ge_25",
          "met": false
        },
        {
          "factor": "hepatojugular_reflux",
          "met": false
        },
        {
          "factor": "ankle_edema",
          "met": false
        },
        {
          "factor": "night_cough",
          "met": false
        },
        {
          "factor": "dyspnea_on_exertion",
          "met": false
        },
        {
          "factor": "hepatomegaly",
          "met": false
        },
        {
          "factor": "pleural_effusion",
          "met": false
        },
        {
          "factor": "vital_capacity_decreased_third",
          "met": false
        },
        {
          "factor": "tachycardia_ge_120",
          "met": false
        },
        {
          "factor": "weight_loss_45kg_5d_treatment",
          "met": 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": "McKee PA, Castelli WP, McNamara PM, Kannel WB",
        "doi": "10.1056/NEJM197112232852601",
        "id": "mckee-1971",
        "pmid": "5122894",
        "source": "N Engl J Med. 1971;285(26):1441-1446",
        "title": "The natural history of congestive heart failure: the Framingham study"
      },
      "formula": "framingham_hf",
      "formula_expression": "definite iff 2 major OR (1 major AND 2 minor) concurrent (McKee 1971). weight_loss_45kg_5d_treatment (≥4.5 kg in 5 days in response to treatment) counts as major if that assignment is definite, else as minor if that assignment is definite, else unused. major_count is the 9 fixed majors; minor_count is the 7 fixed minors",
      "classification": "not_definite",
      "major_count": 0,
      "minor_count": 0,
      "weight_loss_45kg_5d_treatment": false
    }
  ]
}
```

## Response fields

- `formula` (string): framingham_hf
- `formula_expression` (string): Published McKee 1971 concurrent major/minor definite rule
- `major_count` (integer): Count of the nine fixed McKee 1971 major flags that are true (0-9). Does not include weight_loss_45kg_5d_treatment.
- `minor_count` (integer): Count of the seven fixed McKee 1971 minor flags that are true (0-7). Does not include weight_loss_45kg_5d_treatment.
- `weight_loss_45kg_5d_treatment` (boolean): Echo of the dual major-or-minor weight-loss flag (≥4.5 kg in 5 days in response to treatment)
- `classification` (string): definite if two major criteria, or one major plus two minor, are present concurrently after the dual weight-loss assignment; otherwise not_definite. Not a diagnosis.
- `components` (array): Per-flag rows with factor and met for the nine majors, seven minors, and dual weight-loss flag
- `citation` (object): McKee 1971 N Engl J Med citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "pnd_or_orthopnea",
      "met": false
    },
    {
      "factor": "neck_vein_distention",
      "met": false
    },
    {
      "factor": "rales",
      "met": false
    },
    {
      "factor": "cardiomegaly",
      "met": false
    },
    {
      "factor": "acute_pulmonary_edema",
      "met": false
    },
    {
      "factor": "s3_gallop",
      "met": false
    },
    {
      "factor": "venous_pressure_gt_16",
      "met": false
    },
    {
      "factor": "circulation_time_ge_25",
      "met": false
    },
    {
      "factor": "hepatojugular_reflux",
      "met": false
    },
    {
      "factor": "ankle_edema",
      "met": false
    },
    {
      "factor": "night_cough",
      "met": false
    },
    {
      "factor": "dyspnea_on_exertion",
      "met": false
    },
    {
      "factor": "hepatomegaly",
      "met": false
    },
    {
      "factor": "pleural_effusion",
      "met": false
    },
    {
      "factor": "vital_capacity_decreased_third",
      "met": false
    },
    {
      "factor": "tachycardia_ge_120",
      "met": false
    },
    {
      "factor": "weight_loss_45kg_5d_treatment",
      "met": 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": "McKee PA, Castelli WP, McNamara PM, Kannel WB",
    "doi": "10.1056/NEJM197112232852601",
    "id": "mckee-1971",
    "pmid": "5122894",
    "source": "N Engl J Med. 1971;285(26):1441-1446",
    "title": "The natural history of congestive heart failure: the Framingham study"
  },
  "formula": "framingham_hf",
  "formula_expression": "definite iff 2 major OR (1 major AND 2 minor) concurrent (McKee 1971). weight_loss_45kg_5d_treatment (≥4.5 kg in 5 days in response to treatment) counts as major if that assignment is definite, else as minor if that assignment is definite, else unused. major_count is the 9 fixed majors; minor_count is the 7 fixed minors",
  "classification": "not_definite",
  "major_count": 0,
  "minor_count": 0,
  "weight_loss_45kg_5d_treatment": false
}
```

## Errors

- 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

- [NYHA](https://magentlab.com/docs/nyha) — Return the 1994 NYHA functional capacity class 1-4 from a caller-assigned integer, with the published class description.
- [H2FPEF](https://magentlab.com/docs/h2fpef) — Sum the Reddy 2018 H2FPEF points score (six components, max 9) and return score and max_score only.

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