# UCSF CAPRA score (Cooperberg 2005)

CAPRA

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

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

## What it computes

Apply Cooperberg 2005 Table 1 CAPRA points from caller-assigned preoperative PSA, Gleason primary/secondary, clinical T (t1/t2/t3a), percent positive biopsies, and age, and return the 0-10 score, Table 4 Kaplan-Meier band, and Table 4 5-year recurrence-free survival point estimate. Not a diagnosis.

## When to use

When an agent already has caller-assigned preoperative PSA, Gleason patterns, clinical T (t1, t2, or t3a), percent positive biopsies, and age, and needs the published UCSF CAPRA score. magent does not assay PSA or read biopsies. Not the Kattan nomogram, not D'Amico groups, and not CAPRA-S.

## When not to use

- Not a medical device and not a diagnosis of prostate cancer. magent does not assay PSA or read biopsies.
- Cooperberg 2005 Table 1 preoperative CAPRA only (score 0-10). Not the Kattan nomogram. Not D'Amico risk groups. Not CAPRA-S (postoperative).
- PSA <2.1 ng/mL is invalid (the derivation excluded PSA <2). Upper bound 500. magent does not assay PSA.
- Gleason primary and secondary are caller-assigned integers 1-5. magent does not read biopsies or assign Gleason grade.
- t_stage is caller-assigned clinical T: t1 or t2 (0 points) or t3a (1 point). Other stages are out of scope. magent does not assign TNM.
- Bands are Cooperberg 2005 Table 4 Kaplan-Meier groups only (0_1, 2, 3, 4, 5, 6, ge_7). rfs_5y_percent is that table's point estimate, not a computed survival curve.

## Formula

```
CAPRA (Cooperberg 2005 Table 1) = psa_ng_ml (>=2.1 and <=6.0 0, >6.0 and <=10.0 1, >10.0 and <=20.0 2, >20.0 and <=30.0 3, >30 4; PSA <2.1 excluded) + gleason (primary/secondary 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3) + t_stage (t1 or t2 0, t3a 1) + percent_positive_biopsies (<34 0, >=34 1) + age (<50 0, >=50 1); score 0-10; Table 4 Kaplan-Meier bands 0_1 / 2 / 3 / 4 / 5 / 6 / ge_7 with 5-year RFS 85 / 81 / 66 / 59 / 60 / 34 / 8. Not Kattan nomogram. Not D'Amico groups. Not CAPRA-S
```

## Citation

[The University of California, San Francisco Cancer of the Prostate Risk Assessment score: a straightforward and reliable preoperative predictor of disease recurrence after radical prostatectomy](https://doi.org/10.1097/01.ju.0000158155.33890.e7)
Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR
J Urol. 2005;173(6):1938-1942
DOI: [10.1097/01.ju.0000158155.33890.e7](https://doi.org/10.1097/01.ju.0000158155.33890.e7)

## Worked example

### Age 62, PSA 5.0, Gleason 3+3, T1, 20% positive cores

Given: `age=62, gleason_primary=3, gleason_secondary=3, percent_positive_biopsies=20, psa_ng_ml=5.0, t_stage=t1`

1. age 62 >=50 → 1; psa 5.0 in >=2.1-6.0 → 0; Gleason 3+3 (1-3/1-3) → 0; t1 → 0; percent 20 <34 → 0
2. score = 1; band 0_1; rfs_5y_percent 85


### High-risk Table 1 inputs score 10

Given: `age=62, gleason_primary=4, gleason_secondary=4, percent_positive_biopsies=50, psa_ng_ml=35, t_stage=t3a`

1. age 62 → 1; psa 35 >30 → 4; Gleason 4+4 primary 4-5 → 3; t3a → 1; percent 50 >=34 → 1
2. score = 10; band ge_7; rfs_5y_percent 8


## Also searched as

- CAPRA
- UCSF CAPRA
- Cooperberg CAPRA
- Cancer of the Prostate Risk Assessment
- preoperative CAPRA
- CAPRA score
- Cooperberg 2005
- prostate CAPRA
- not CAPRA-S

## Parameters

- `age` (integer, required): Age in years (18-120, Params.age). Cooperberg 2005 Table 1: <50 scores 0; >=50 scores 1.
- `psa_ng_ml` (number, required): Preoperative PSA in ng/mL as assigned by the caller (2.1-500). Cooperberg 2005 Table 1: >=2.1 and <=6.0 scores 0; >6.0 and <=10.0 scores 1; >10.0 and <=20.0 scores 2; >20.0 and <=30.0 scores 3; >30 scores 4. PSA <2.1 is invalid (paper excluded PSA <2). magent does not assay PSA.
- `gleason_primary` (integer, required): Primary Gleason pattern 1-5 as assigned by the caller (Cooperberg 2005 Table 1). Integer 1-5 only. Combined with gleason_secondary: 1-3/1-3 scores 0; 1-3/4-5 scores 1; primary 4-5 scores 3. magent does not read biopsies.
- `gleason_secondary` (integer, required): Secondary Gleason pattern 1-5 as assigned by the caller (Cooperberg 2005 Table 1). Integer 1-5 only. Combined with gleason_primary as above. magent does not read biopsies.
- `t_stage` (string, required): Clinical T as assigned by the caller (Cooperberg 2005 Table 1). t1 or t2 scores 0; t3a scores 1. Other stages are invalid. Not CAPRA-S pathologic T. magent does not assign TNM.
- `percent_positive_biopsies` (number, required): Percent of biopsy cores positive (0-100) as assigned by the caller (Cooperberg 2005 Table 1). <34 scores 0; >=34 scores 1. magent does not read biopsies.

## 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/capra`
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": [
    {
      "age": "62",
      "gleason_primary": "3",
      "gleason_secondary": "3",
      "percent_positive_biopsies": "20",
      "psa_ng_ml": "5.0",
      "t_stage": "t1"
    },
    {
      "age": "62",
      "gleason_primary": "3",
      "gleason_secondary": "3",
      "percent_positive_biopsies": "20",
      "psa_ng_ml": "5.0",
      "t_stage": "t1"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/capra",
  "items": [
    {
      "band": "0_1",
      "components": [
        {
          "value": 5.0,
          "factor": "psa_ng_ml",
          "points": 0,
          "present": true
        },
        {
          "value": "3+3",
          "factor": "gleason",
          "points": 0,
          "present": true
        },
        {
          "value": "t1",
          "factor": "t_stage",
          "points": 0,
          "present": true
        },
        {
          "value": 20.0,
          "factor": "percent_positive_biopsies",
          "points": 0,
          "present": true
        },
        {
          "value": 62,
          "factor": "age",
          "points": 1,
          "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": "Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR",
        "doi": "10.1097/01.ju.0000158155.33890.e7",
        "id": "cooperberg-2005",
        "pmid": "15879786",
        "source": "J Urol. 2005;173(6):1938-1942",
        "title": "The University of California, San Francisco Cancer of the Prostate Risk Assessment score: a straightforward and reliable preoperative predictor of disease recurrence after radical prostatectomy"
      },
      "formula": "capra",
      "formula_expression": "CAPRA (Cooperberg 2005 Table 1) = psa_ng_ml (>=2.1 and <=6.0 0, >6.0 and <=10.0 1, >10.0 and <=20.0 2, >20.0 and <=30.0 3, >30 4; PSA <2.1 excluded) + gleason (primary/secondary 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3) + t_stage (t1 or t2 0, t3a 1) + percent_positive_biopsies (<34 0, >=34 1) + age (<50 0, >=50 1); score 0-10; Table 4 Kaplan-Meier bands 0_1 / 2 / 3 / 4 / 5 / 6 / ge_7 with 5-year RFS 85 / 81 / 66 / 59 / 60 / 34 / 8. Not Kattan nomogram. Not D'Amico groups. Not CAPRA-S",
      "age_years": 62,
      "max_score": 10,
      "score": 1,
      "gleason_primary": 3,
      "gleason_secondary": 3,
      "percent_positive_biopsies": 20.0,
      "psa_ng_ml": 5.0,
      "rfs_5y_percent": 85,
      "t_stage": "t1"
    },
    {
      "band": "0_1",
      "components": [
        {
          "value": 5.0,
          "factor": "psa_ng_ml",
          "points": 0,
          "present": true
        },
        {
          "value": "3+3",
          "factor": "gleason",
          "points": 0,
          "present": true
        },
        {
          "value": "t1",
          "factor": "t_stage",
          "points": 0,
          "present": true
        },
        {
          "value": 20.0,
          "factor": "percent_positive_biopsies",
          "points": 0,
          "present": true
        },
        {
          "value": 62,
          "factor": "age",
          "points": 1,
          "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": "Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR",
        "doi": "10.1097/01.ju.0000158155.33890.e7",
        "id": "cooperberg-2005",
        "pmid": "15879786",
        "source": "J Urol. 2005;173(6):1938-1942",
        "title": "The University of California, San Francisco Cancer of the Prostate Risk Assessment score: a straightforward and reliable preoperative predictor of disease recurrence after radical prostatectomy"
      },
      "formula": "capra",
      "formula_expression": "CAPRA (Cooperberg 2005 Table 1) = psa_ng_ml (>=2.1 and <=6.0 0, >6.0 and <=10.0 1, >10.0 and <=20.0 2, >20.0 and <=30.0 3, >30 4; PSA <2.1 excluded) + gleason (primary/secondary 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3) + t_stage (t1 or t2 0, t3a 1) + percent_positive_biopsies (<34 0, >=34 1) + age (<50 0, >=50 1); score 0-10; Table 4 Kaplan-Meier bands 0_1 / 2 / 3 / 4 / 5 / 6 / ge_7 with 5-year RFS 85 / 81 / 66 / 59 / 60 / 34 / 8. Not Kattan nomogram. Not D'Amico groups. Not CAPRA-S",
      "age_years": 62,
      "max_score": 10,
      "score": 1,
      "gleason_primary": 3,
      "gleason_secondary": 3,
      "percent_positive_biopsies": 20.0,
      "psa_ng_ml": 5.0,
      "rfs_5y_percent": 85,
      "t_stage": "t1"
    }
  ]
}
```

## Response fields

- `formula` (string): capra
- `formula_expression` (string): Cooperberg 2005 Table 1 CAPRA expression
- `score` (integer): CAPRA points 0-10 (Cooperberg 2005 Table 1)
- `max_score` (integer): 10
- `band` (string): Cooperberg 2005 Table 4 Kaplan-Meier group: 0_1 (score 0-1), 2, 3, 4, 5, 6, or ge_7 (score >=7). Not Kattan. Not D'Amico. Not CAPRA-S.
- `rfs_5y_percent` (integer): Cooperberg 2005 Table 4 5-year recurrence-free survival point estimate: 0-1 → 85; 2 → 81; 3 → 66; 4 → 59; 5 → 60; 6 → 34; >=7 → 8. A published cohort percent, not a computed Kaplan-Meier.
- `age_years` (integer): Age used for Table 1 age points
- `psa_ng_ml` (number): Caller-assigned preoperative PSA used for Table 1 PSA points
- `gleason_primary` (integer): Caller-assigned primary Gleason pattern 1-5
- `gleason_secondary` (integer): Caller-assigned secondary Gleason pattern 1-5
- `t_stage` (string): Caller-assigned clinical T used (t1, t2, or t3a)
- `percent_positive_biopsies` (number): Caller-assigned percent of biopsy cores positive (0-100)
- `components` (array): Per-factor Cooperberg 2005 Table 1 points
- `citation` (object): Cooperberg 2005 J Urol citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "band": "0_1",
  "components": [
    {
      "value": 5.0,
      "factor": "psa_ng_ml",
      "points": 0,
      "present": true
    },
    {
      "value": "3+3",
      "factor": "gleason",
      "points": 0,
      "present": true
    },
    {
      "value": "t1",
      "factor": "t_stage",
      "points": 0,
      "present": true
    },
    {
      "value": 20.0,
      "factor": "percent_positive_biopsies",
      "points": 0,
      "present": true
    },
    {
      "value": 62,
      "factor": "age",
      "points": 1,
      "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": "Cooperberg MR, Pasta DJ, Elkin EP, Litwin MS, Latini DM, Du Chane J, Carroll PR",
    "doi": "10.1097/01.ju.0000158155.33890.e7",
    "id": "cooperberg-2005",
    "pmid": "15879786",
    "source": "J Urol. 2005;173(6):1938-1942",
    "title": "The University of California, San Francisco Cancer of the Prostate Risk Assessment score: a straightforward and reliable preoperative predictor of disease recurrence after radical prostatectomy"
  },
  "formula": "capra",
  "formula_expression": "CAPRA (Cooperberg 2005 Table 1) = psa_ng_ml (>=2.1 and <=6.0 0, >6.0 and <=10.0 1, >10.0 and <=20.0 2, >20.0 and <=30.0 3, >30 4; PSA <2.1 excluded) + gleason (primary/secondary 1-3/1-3 0, 1-3/4-5 1, primary 4-5 3) + t_stage (t1 or t2 0, t3a 1) + percent_positive_biopsies (<34 0, >=34 1) + age (<50 0, >=50 1); score 0-10; Table 4 Kaplan-Meier bands 0_1 / 2 / 3 / 4 / 5 / 6 / ge_7 with 5-year RFS 85 / 81 / 66 / 59 / 60 / 34 / 8. Not Kattan nomogram. Not D'Amico groups. Not CAPRA-S",
  "age_years": 62,
  "max_score": 10,
  "score": 1,
  "gleason_primary": 3,
  "gleason_secondary": 3,
  "percent_positive_biopsies": 20.0,
  "psa_ng_ml": 5.0,
  "rfs_5y_percent": 85,
  "t_stage": "t1"
}
```

## Errors

- HTTP 400 `invalid_capra`: psa_ng_ml must be ≥2.1; gleason_primary and gleason_secondary integers 1–5; t_stage t1, t2, or t3a; percent_positive_biopsies 0–100 (Cooperberg 2005 CAPRA Table 1). Returned before settlement; you are not charged.
- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 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

- [UISS](https://magentlab.com/docs/uiss) — Apply the Zisman 2002 localized N0M0 three-group UISS algorithm to caller-assigned 1997 pathological T, Fuhrman grade, and ECOG PS and return low_risk, intermediate_risk, or high_risk. Does not compute a predicted 5-year disease-specific survival.
- [Fuhrman](https://magentlab.com/docs/fuhrman) — Echo the caller-assigned Fuhrman 1982 nuclear grade (1-4) with the published nuclear-feature description. magent does not read slides. Not WHO/ISUP 2016.
- [R.E.N.A.L. nephrometry](https://magentlab.com/docs/renal-nephrometry) — Sum the Kutikov 2009 R.E.N.A.L. nephrometry score for a renal mass from four caller-assigned published item points (radius, exophytic/endophytic, nearness, location) and return the integer total (4–12) plus anterior and hilar descriptors. Does not return complexity bands.

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