# YEARS Algorithm PE Exclusion Calculator

> YEARS Algorithm PE Exclusion Calculator is a paid API for AI agents from api.magentlab.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-12).

Applies the YEARS algorithm (van der Hulle 2017) to determine whether pulmonary embolism can be excluded based on three clinical items and D-dimer threshold

## Facts

- Endpoint: GET https://api.magentlab.com/api/calc/years?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/years-algorithm-pe-exclusion-calculator-42ade27c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_o5BhJFUKoK9oGg4AObOk3

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability years-algorithm-pe-exclusion-calculator-42ade27c
```

Example prompt: Using the YEARS algorithm, can you check if PE can be excluded for a patient with no clinical signs of DVT, no hemoptysis, PE is not the most likely diagnosis, and a D-dimer of 450 ng/mL FEU?

## When to prefer this

Use this endpoint when you need a standardized, evidence-based computation of the YEARS algorithm (van der Hulle 2017 Lancet) for PE exclusion decisions. Prefer this over general clinical calculators when you specifically need the YEARS criteria (not Wells score, not PERC rule) with precise D-dimer threshold application. Useful in automated clinical decision support workflows where the caller has already assessed the three YEARS items and has a numeric D-dimer value in ng/mL FEU.

## Known failure modes

- Missing required query parameters (clinical_signs_dvt, hemoptysis, pe_most_likely, d_dimer_ng_ml) returns a validation error
- D-dimer value outside 0–20000 ng/mL range may return an error or out-of-range warning
- Payment failure or missing x402 payment header returns 402 Payment Required
- Boolean parameters passed as strings instead of true/false may cause parsing errors
- Pregnancy patients: the 2017 cohort excluded pregnancy, so results may not apply

## How this service works

YEARS algorithm (van der Hulle 2017 Lancet). Count three caller-assigned items (clinical signs of DVT, hemoptysis, PE most likely) and exclude PE only when D-dimer (ng/mL FEU) is strictly below 1000 with 0 items or 500 with 1-3 items. Equality is not excluded. Not a diagnosis, not Wells, not PERC. magent does not decide PE most likely. The 2017 cohort excluded pregnancy.

## Output

Returns the computed YEARS item count (0–3), the applicable D-dimer threshold (1000 ng/mL for 0 items, 500 ng/mL for 1–3 items), and whether PE can be excluded based on whether the D-dimer is strictly below that threshold (equality is not excluded). Includes interpretive context per the van der Hulle 2017 Lancet cohort criteria.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "clinical_signs_dvt",
      "hemoptysis",
      "pe_most_likely",
      "d_dimer_ng_ml"
     ],
     "properties": {
      "hemoptysis": {
       "type": "boolean",
       "description": "Hemoptysis. true or false as assigned by the caller. Counts as one unweighted YEARS item when true."
      },
      "d_dimer_ng_ml": {
       "type": "number",
       "description": "D-dimer in ng/mL fibrinogen-equivalent units (FEU) as in van der Hulle 2017 (0-20000). PE excluded only when strictly below 1000 (0 YEARS items) or 500 (1-3 items). Equality is not excluded."
      },
      "pe_most_likely": {
       "type": "boolean",
       "description": "PE is the most likely diagnosis, as assigned by the caller. magent does not decide PE most likely. Counts as one unweighted YEARS item when true."
      },
      "clinical_signs_dvt": {
       "type": "boolean",
       "description": "Clinical signs of deep-vein thrombosis. true or false as assigned by the caller. Counts as one unweighted YEARS item when true."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "path": "/api/calc/years",
  "count": 2,
  "items": [
   {
    "formula": "years",
    "citation": {
     "id": "van-der-hulle-2017",
     "doi": "10.1016/S0140-6736(17)30885-1",
     "title": "Simplified diagnostic management of suspected pulmonary embolism (the YEARS study): a prospective, multicentre, cohort study",
     "source": "Lancet. 2017;390(10091):289-297",
     "authors": "van der Hulle T, Cheung WY, Kooij S, et al."
    },
    "criteria": [
     {
      "met": false,
      "factor": "clinical_signs_dvt"
     },
     {
      "met": false,
      "factor": "hemoptysis"
     },
     {
      "met": false,
      "factor": "pe_most_likely"
     }
    ],
    "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.",
    "pe_excluded": true,
    "years_items": 0,
    "d_dimer_ng_ml": 499,
    "ctpa_indicated": false,
    "formula_expression": "PE excluded iff (years_items == 0 and d_dimer_ng_ml < 1000) or (years_items >= 1 and d_dimer_ng_ml < 500); years_items counts clinical_signs_dvt, hemoptysis, and pe_most_likely",
    "d_dimer_threshold_ng_ml": 1000
   },
   {
    "formula": "years",
    "citation": {
     "id": "van-der-hulle-2017",
     "doi": "10.1016/S0140-6736(17)30885-1",
     "title": "Simplified diagnostic management of suspected pulmonary embolism (the YEARS study): a prospective, multicentre, cohort study",
     "source": "Lancet. 2017;390(10091):289-297",
     "authors": "van der Hulle T, Cheung WY, Kooij S, et al."
    },
    "criteria": [
     {
      "met": false,
      "factor": "clinical_signs_dvt"
     },
     {
      "met": false,
      "factor": "hemoptysis"
     },
     {
      "met": false,
      "factor": "pe_most_likely"
     }
    ],
    "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.",
    "pe_excluded": true,
    "years_items": 0,
    "d_dimer_ng_ml": 499,
    "ctpa_indicated": false,
    "formula_expression": "PE excluded iff (years_items == 0 and d_dimer_ng_ml < 1000) or (years_items >= 1 and d_dimer_ng_ml < 500); years_items counts clinical_signs_dvt, hemoptysis, and pe_most_likely",
    "d_dimer_threshold_ng_ml": 1000
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/years-algorithm-pe-exclusion-calculator-42ade27c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.magentlab.com](https://www.zero.xyz/host/api.magentlab.com/llms.txt)
