# RASP HIV exposure risk (Vertesi 2003)

RASP

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

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

## What it computes

Multiply Vertesi 2003 exclusive Steps A–C (source population, inoculum type, transmission) to Z, take basic_risk = 1/Z, apply volume modifier D as total_risk = basic_risk × D, and return the Table 2 suggested-treatment band.

## When to use

When an agent has already assigned Vertesi 2003 exclusive A/B/C/D tokens and needs the published product risk and Table 2 band, not a PEP order and not an interpretation of the source patient.

## When not to use

- Not a medical device. Not a PEP, nPEP, or antiretroviral order. magent does not interpret the source patient.
- Vertesi 2003 Figure 1 scores bake in average Canadian community HIV prevalence. They are not recalibrated for other prevalence.
- Each of Steps A–D is an exclusive caller-assigned token. magent does not assign source status, inoculum type, transmission method, or volume.
- Table 2 bands are published suggestions, not a treatment mandate. Not HIRI-MSM and not Menza.

## Formula

```
Z = A * B * C; basic_risk = 1/Z; total_risk = basic_risk * D; Vertesi 2003 Figure 1 exclusive A source, B inoculum, C transmission, D volume; Table 2 <1/1000 definitely indicated; 1/1000-1/10 000 recommended but optional; 1/10 001-1/100 000 optional but not recommended; >1/100 000 not indicated
```

## Citation

[Risk Assessment Stratification Protocol (RASP) to help patients decide on the use of postexposure prophylaxis for HIV exposure](https://doi.org/10.1017/S1481803500008113)
Vertesi L
CJEM. 2003;5(1):46-48
DOI: [10.1017/S1481803500008113](https://doi.org/10.1017/S1481803500008113)

## Worked example

### Known asymptomatic HIV, fresh blood, deep transcutaneous, 25-g needle

Given: `inoculum_type=fresh_blood, inoculum_volume=small_small_bore_lt_22g, source_population=known_hiv_asymptomatic, transmission=deep_transcutaneous_visible_bleeding`

1. A known_hiv_asymptomatic = 10; B fresh_blood = 1; C deep_transcutaneous_visible_bleeding = 100
2. Z = 10 * 1 * 100 = 1000; basic_risk = 1/1000 = 0.001
3. D small_small_bore_lt_22g = 3; total_risk = 0.001 * 3 = 0.003 (~1 in 333)
4. Table 2 <1/1000 → definitely indicated. Not a PEP order.


### Unknown low-risk, dried old blood, superficial, large-bore needle

Given: `inoculum_type=dried_old_blood, inoculum_volume=moderate_large_bore_gt_22g, source_population=unknown_hiv_low_risk, transmission=superficial_transcutaneous_no_bleeding`

1. A unknown_hiv_low_risk = 1000; B dried_old_blood = 100; C superficial_transcutaneous_no_bleeding = 200
2. Z = 1000 * 100 * 200 = 20000000; basic_risk = 1/20000000
3. D moderate_large_bore_gt_22g = 5; total_risk = 5/20000000 (1 in 4000000)
4. Table 2 >1/100 000 → not indicated. Not a PEP order.


## Also searched as

- RASP
- Risk Assessment Stratification Protocol
- Vertesi HIV exposure
- HIV postexposure risk
- needle-stick HIV risk
- HIV exposure prophylaxis risk
- Vertesi 2003 RASP

## Parameters

- `source_population` (string, required): Vertesi 2003 Step A source population as assigned by the caller (exclusive). known_hiv_acute_aids scores 1 (acute AIDS illness); known_hiv_asymptomatic scores 10; unknown_hiv_high_risk scores 100; unknown_hiv_low_risk scores 1000. magent does not interpret the source patient.
- `inoculum_type` (string, required): Vertesi 2003 Step B inoculum type as assigned by the caller (exclusive). fresh_blood scores 1; body_fluids_at_risk scores 10 (semen); dried_old_blood scores 100; low_risk_secretions scores 1000 (tears, saliva, urine). magent does not classify the specimen.
- `transmission` (string, required): Vertesi 2003 Step C method of transmission as assigned by the caller (exclusive). intravenous scores 1; deep_intramuscular scores 10; deep_transcutaneous_visible_bleeding scores 100; superficial_transcutaneous_no_bleeding scores 200; mucosal_contact scores 500; intact_skin scores 1000. magent does not examine the wound.
- `inoculum_volume` (string, required): Vertesi 2003 Step D volume modifier as assigned by the caller (exclusive). massive_transfusion scores 100; measurable_gt_1_ml scores 10; moderate_large_bore_gt_22g scores 5; small_small_bore_lt_22g scores 3; trace_surface scores 1 (suture needle). 22 g exactly is not a published token. magent does not measure volume.

## 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/rasp`
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": [
    {
      "inoculum_type": "fresh_blood",
      "inoculum_volume": "small_small_bore_lt_22g",
      "source_population": "known_hiv_asymptomatic",
      "transmission": "deep_transcutaneous_visible_bleeding"
    },
    {
      "inoculum_type": "fresh_blood",
      "inoculum_volume": "small_small_bore_lt_22g",
      "source_population": "known_hiv_asymptomatic",
      "transmission": "deep_transcutaneous_visible_bleeding"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/rasp",
  "items": [
    {
      "z": 1000,
      "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": "Vertesi L",
        "doi": "10.1017/S1481803500008113",
        "id": "vertesi-2003",
        "pmid": "12630044",
        "source": "CJEM. 2003;5(1):46-48",
        "title": "Risk Assessment Stratification Protocol (RASP) to help patients decide on the use of postexposure prophylaxis for HIV exposure"
      },
      "formula": "rasp",
      "formula_expression": "Z = A * B * C; basic_risk = 1/Z; total_risk = basic_risk * D; Vertesi 2003 Figure 1 exclusive A source, B inoculum, C transmission, D volume; Table 2 <1/1000 definitely indicated; 1/1000-1/10 000 recommended but optional; 1/10 001-1/100 000 optional but not recommended; >1/100 000 not indicated",
      "basic_risk": 0.001,
      "inoculum_type": "fresh_blood",
      "inoculum_type_score": 1,
      "inoculum_volume": "small_small_bore_lt_22g",
      "risk_level": "definitely_indicated",
      "risk_one_in": 333,
      "source_population": "known_hiv_asymptomatic",
      "source_score": 10,
      "suggested_treatment": "Definitely indicated",
      "total_risk": 0.003,
      "transmission": "deep_transcutaneous_visible_bleeding",
      "transmission_score": 100,
      "volume_modifier": 3
    },
    {
      "z": 1000,
      "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": "Vertesi L",
        "doi": "10.1017/S1481803500008113",
        "id": "vertesi-2003",
        "pmid": "12630044",
        "source": "CJEM. 2003;5(1):46-48",
        "title": "Risk Assessment Stratification Protocol (RASP) to help patients decide on the use of postexposure prophylaxis for HIV exposure"
      },
      "formula": "rasp",
      "formula_expression": "Z = A * B * C; basic_risk = 1/Z; total_risk = basic_risk * D; Vertesi 2003 Figure 1 exclusive A source, B inoculum, C transmission, D volume; Table 2 <1/1000 definitely indicated; 1/1000-1/10 000 recommended but optional; 1/10 001-1/100 000 optional but not recommended; >1/100 000 not indicated",
      "basic_risk": 0.001,
      "inoculum_type": "fresh_blood",
      "inoculum_type_score": 1,
      "inoculum_volume": "small_small_bore_lt_22g",
      "risk_level": "definitely_indicated",
      "risk_one_in": 333,
      "source_population": "known_hiv_asymptomatic",
      "source_score": 10,
      "suggested_treatment": "Definitely indicated",
      "total_risk": 0.003,
      "transmission": "deep_transcutaneous_visible_bleeding",
      "transmission_score": 100,
      "volume_modifier": 3
    }
  ]
}
```

## Response fields

- `formula` (string): rasp
- `formula_expression` (string): Exact expression used
- `source_population` (string): Caller-assigned Step A token used
- `inoculum_type` (string): Caller-assigned Step B token used
- `transmission` (string): Caller-assigned Step C token used
- `inoculum_volume` (string): Caller-assigned Step D token used
- `source_score` (integer): Step A score (1, 10, 100, or 1000)
- `inoculum_type_score` (integer): Step B score (1, 10, 100, or 1000)
- `transmission_score` (integer): Step C score (1, 10, 100, 200, 500, or 1000)
- `volume_modifier` (integer): Step D modifier (100, 10, 5, 3, or 1)
- `z` (integer): A * B * C
- `basic_risk` (number): 1/Z, 9 decimals
- `total_risk` (number): basic_risk * D, 9 decimals
- `risk_one_in` (integer): Nearest integer 1/total_risk (Z/D) for Table 2 fraction notation
- `risk_level` (string): definitely_indicated, recommended_optional, optional_not_recommended, or not_indicated
- `suggested_treatment` (string): Vertesi 2003 Table 2 suggested-treatment wording for that risk level
- `citation` (object): Vertesi 2003 CJEM citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "z": 1000,
  "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": "Vertesi L",
    "doi": "10.1017/S1481803500008113",
    "id": "vertesi-2003",
    "pmid": "12630044",
    "source": "CJEM. 2003;5(1):46-48",
    "title": "Risk Assessment Stratification Protocol (RASP) to help patients decide on the use of postexposure prophylaxis for HIV exposure"
  },
  "formula": "rasp",
  "formula_expression": "Z = A * B * C; basic_risk = 1/Z; total_risk = basic_risk * D; Vertesi 2003 Figure 1 exclusive A source, B inoculum, C transmission, D volume; Table 2 <1/1000 definitely indicated; 1/1000-1/10 000 recommended but optional; 1/10 001-1/100 000 optional but not recommended; >1/100 000 not indicated",
  "basic_risk": 0.001,
  "inoculum_type": "fresh_blood",
  "inoculum_type_score": 1,
  "inoculum_volume": "small_small_bore_lt_22g",
  "risk_level": "definitely_indicated",
  "risk_one_in": 333,
  "source_population": "known_hiv_asymptomatic",
  "source_score": 10,
  "suggested_treatment": "Definitely indicated",
  "total_risk": 0.003,
  "transmission": "deep_transcutaneous_visible_bleeding",
  "transmission_score": 100,
  "volume_modifier": 3
}
```

## Errors

- HTTP 400 `invalid_rasp`: RASP inputs must match Vertesi 2003 exclusive source-population, inoculum-type, transmission, and volume scores from that paper. 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

- [HIRI-MSM](https://magentlab.com/docs/hiri-msm) — Sum the published Smith 2012 seven-item HIV incidence risk index for MSM (age plus six prior-6-month behaviors, 0–47) and return at_or_above_10 when the total is ≥10.
- [Menza](https://magentlab.com/docs/menza) — Sum the four Menza 2009 caller-assigned flags and return the 0–19 point total.

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