MAGENT

Infection / VTE · LIVE

VACS Index 2.0 (Tate 2019)

VACS 2.0

Compute the Tate 2019 VACS Index 2.0 score for 5-year all-cause mortality from age, CD4, HIV-1 RNA, hemoglobin, caller-assigned FIB-4 and eGFR, hepatitis C, albumin, WBC, and BMI using Appendix Table 1 coefficients.

LIVE $0.005 USDC GET /api/calc/vacs_2

Markdown: /docs/vacs-2.md · Canonical: https://magentlab.com/docs/vacs-2

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

What it computes

Compute the Tate 2019 VACS Index 2.0 score for 5-year all-cause mortality from age, CD4, HIV-1 RNA, hemoglobin, caller-assigned FIB-4 and eGFR, hepatitis C, albumin, WBC, and BMI using Appendix Table 1 coefficients.

When to use

When an agent already has those ten caller-assigned values and needs the published VACS 2.0 index score. Not VACS Index 1.0. magent does not assay labs, compute FIB-4 or eGFR, assign HIV status, or order ART.

When not to use

  • Not a medical device and not a diagnosis. magent does not assign HIV status. Not an antiretroviral, hepatitis C, or transfusion order.
  • This is Tate 2019 VACS Index 2.0 only. It is not VACS 1.0 (Tate 2013 categorical points). VACS 2.0 adds albumin, WBC, and BMI and uses continuous polynomials rather than 1.0 point bands.
  • FIB-4 and eGFR are caller-assigned. magent does not recompute FIB-4 and does not compute MDRD or CKD-EPI. Race is not an input.
  • Appendix Table 1 does not publish a baseline survival S0. The response is the Appendix Table 2 scaled index score (44 at the median profile; 20 × linear-predictor delta). Appendix Table 3 reports HR 1.31 per 5 points in VACS. That is not a patient-specific 5-year percent.
  • eGFR uses the published Appendix Table 1 footnote truncated linear terms (knots 35, 65, 115), not an invented restricted cubic spline.

Formula

lp = age_poly + cd4_poly + rna_poly + hb_poly + fib4_poly + egfr_spline + hcv + alb_poly + wbc_poly + bmi_poly; score = round(44 + 20*(lp - lp_median)); lp_median is Appendix Table 2 median profile (age 52, CD4 435, log10 HIV-1 RNA 1.7, Hb 14, FIB-4 1.34, eGFR 90, HCV no, albumin 4, WBC 5.5, BMI 25.3); age censored 30-75, X=(age-50)/5, PE 0.056/-0.004/0.005; CD4 censored 0-1000 as ln(max(1000-CD4, 1)), PE -0.056/-0.153/0.024; HIV-1 RNA log10 copies censored 1.3-5.0, centered (logVL-2), PE 0.513/-0.422/0.098; hemoglobin censored 9-16, centered (hemoglobin-14), PE -0.134/0.026/0.005; FIB-4 censored 0.5-7.5, PE 0.220/-0.009; eGFR censored 0-180, X1=eGFR/10, X2=max(eGFR-35,0)/10, X3=max(eGFR-65,0)/10, X4=max(eGFR-115,0)/10, PE -0.031/-0.077/0.106/0.133; HCV yes 0.342; albumin censored 2-5, centered (albumin-4), PE -0.443/0.104/0.028; WBC 10^9/L censored 2.5-11, centered (WBC-5.5), PE 0.126/0.020/-0.004; BMI censored 15-35, centered (BMI-25), PE -0.055/0.004; Tate 2019 Appendix Table 1 main analysis LVCF 180 days; caller-assigned FIB-4 and eGFR; not VACS 1.0; no published S0

Citation

Title
Albumin, white blood cell count, and body mass index improve discrimination of mortality in HIV-positive individuals
Authors
Tate JP, Sterne JAC, Justice AC; Veterans Aging Cohort Study (VACS) and the Antiretroviral Therapy Cohort Collaboration (ART-CC)
Source
AIDS. 2019;33(5):903-912
DOI
10.1097/QAD.0000000000002140

Worked example

Age 40 with otherwise lower-risk labs

Given: age=40albumin_g_dl=4.2bmi_kg_m2=26cd4_cells_mm3=600egfr_ml_min_1_73m2=100fib4=1.0hemoglobin_g_dl=15hepatitis_c=falsehiv_rna_copies_ml=50wbc_10e9_l=6.0

  1. Censor and center as Appendix Table 1: age 40 → X=(40-50)/5=-2; CD4 600 → ln(400); HIV-1 RNA 50 → log10 1.699, centered -0.301; hemoglobin 15 → -1; FIB-4 1.0; eGFR 100; HCV false; albumin 4.2 → 0.2; WBC 6.0 → 0.5; BMI 26 → 1
  2. Sum the published X/X²/X³ (and eGFR X1-X4) terms to lp
  3. score = round(44 + 20 × (lp - lp_median)); lp_median is the Appendix Table 2 median profile

Age 65 with the same labs

Given: age=65albumin_g_dl=4.2bmi_kg_m2=26cd4_cells_mm3=600egfr_ml_min_1_73m2=100fib4=1.0hemoglobin_g_dl=15hepatitis_c=falsehiv_rna_copies_ml=50wbc_10e9_l=6.0

  1. Same labs as the age-40 example; age 65 → X=(65-50)/5=3
  2. score = round(44 + 20 × (lp - lp_median))

Also searched as

  • VACS Index 2.0
  • VACS 2.0
  • Veterans Aging Cohort Study Index 2.0
  • Tate 2019 VACS
  • HIV 5-year mortality index
  • VACS Index albumin WBC BMI

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/vacs_2?age=40&cd4_cells_mm3=600&hiv_rna_copies_ml=50&hemoglobin_g_dl=15&fib4=1.0&egfr_ml_min_1_73m2=100&hepatitis_c=false&albumin_g_dl=4.2&wbc_10e9_l=6.0&bmi_kg_m2=26

Full URL: https://api.magentlab.com/api/calc/vacs_2?age=40&cd4_cells_mm3=600&hiv_rna_copies_ml=50&hemoglobin_g_dl=15&fib4=1.0&egfr_ml_min_1_73m2=100&hepatitis_c=false&albumin_g_dl=4.2&wbc_10e9_l=6.0&bmi_kg_m2=26

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/vacs_2?age=40&cd4_cells_mm3=600&hiv_rna_copies_ml=50&hemoglobin_g_dl=15&fib4=1.0&egfr_ml_min_1_73m2=100&hepatitis_c=false&albumin_g_dl=4.2&wbc_10e9_l=6.0&bmi_kg_m2=26"

Parameters

Name Type Required Description
age integer required Age in years (integer 18-120). Tate 2019 Appendix Table 1 censors age at 30-75 and uses the cubic polynomial of (age-50)/5. magent does not assign age.
cd4_cells_mm3 integer required CD4 count in cells/mm³ (integer 1-2000). Appendix Table 1 censors at 0-1000 and uses ln(max(1000-CD4, 1)). magent does not assay CD4.
hiv_rna_copies_ml number required HIV-1 RNA in copies/mL (0-10000000). Appendix Table 1 uses log10 copies censored at 1.3-5.0 and centered at (logVL-2). magent does not assay viral load.
hemoglobin_g_dl number required Hemoglobin in g/dL (3-22). Appendix Table 1 censors at 9-16 and centers at (hemoglobin-14). magent does not assay hemoglobin.
fib4 number required Caller-assigned FIB-4 (0.1-20). Appendix Table 1 censors at 0.5-7.5. magent does not recompute FIB-4.
egfr_ml_min_1_73m2 number required Caller-assigned eGFR in mL/min/1.73m² (0-200). Appendix Table 1 censors at 0-180 and uses the footnote truncated linear terms at 35, 65, and 115. magent does not compute MDRD or CKD-EPI. Race is not an input.
hepatitis_c boolean required Caller-assigned hepatitis C co-infection (Tate 2019). true adds 0.342 to the linear predictor. magent does not diagnose hepatitis C.
albumin_g_dl number required Serum albumin in g/dL (1-6.5). Appendix Table 1 censors at 2-5 and centers at (albumin-4). magent does not assay albumin.
wbc_10e9_l number required White blood count in 10^9/L (0.5-50), equal to k/µL. Appendix Table 1 censors at 2.5-11 and centers at (WBC-5.5). magent does not assay WBC.
bmi_kg_m2 number required Body mass index in kg/m² (10-60). Appendix Table 1 censors at 15-35 and centers at (BMI-25). magent does not compute BMI from height and weight.

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.

POST /api/calc/vacs_2 Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 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 (fixture)

{
  "items": [
    {
      "age": "40",
      "albumin_g_dl": "4.2",
      "bmi_kg_m2": "26",
      "cd4_cells_mm3": "600",
      "egfr_ml_min_1_73m2": "100",
      "fib4": "1.0",
      "hemoglobin_g_dl": "15",
      "hepatitis_c": "false",
      "hiv_rna_copies_ml": "50",
      "wbc_10e9_l": "6.0"
    },
    {
      "age": "40",
      "albumin_g_dl": "4.2",
      "bmi_kg_m2": "26",
      "cd4_cells_mm3": "600",
      "egfr_ml_min_1_73m2": "100",
      "fib4": "1.0",
      "hemoglobin_g_dl": "15",
      "hepatitis_c": "false",
      "hiv_rna_copies_ml": "50",
      "wbc_10e9_l": "6.0"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/vacs_2",
  "items": [
    {
      "age": 40,
      "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": "Tate JP, Sterne JAC, Justice AC; Veterans Aging Cohort Study (VACS) and the Antiretroviral Therapy Cohort Collaboration (ART-CC)",
        "doi": "10.1097/QAD.0000000000002140",
        "id": "tate-2019-vacs-2",
        "pmid": "30649088",
        "source": "AIDS. 2019;33(5):903-912",
        "title": "Albumin, white blood cell count, and body mass index improve discrimination of mortality in HIV-positive individuals"
      },
      "formula": "vacs_2",
      "formula_expression": "lp = age_poly + cd4_poly + rna_poly + hb_poly + fib4_poly + egfr_spline + hcv + alb_poly + wbc_poly + bmi_poly; score = round(44 + 20*(lp - lp_median)); lp_median is Appendix Table 2 median profile (age 52, CD4 435, log10 HIV-1 RNA 1.7, Hb 14, FIB-4 1.34, eGFR 90, HCV no, albumin 4, WBC 5.5, BMI 25.3); age censored 30-75, X=(age-50)/5, PE 0.056/-0.004/0.005; CD4 censored 0-1000 as ln(max(1000-CD4, 1)), PE -0.056/-0.153/0.024; HIV-1 RNA log10 copies censored 1.3-5.0, centered (logVL-2), PE 0.513/-0.422/0.098; hemoglobin censored 9-16, centered (hemoglobin-14), PE -0.134/0.026/0.005; FIB-4 censored 0.5-7.5, PE 0.220/-0.009; eGFR censored 0-180, X1=eGFR/10, X2=max(eGFR-35,0)/10, X3=max(eGFR-65,0)/10, X4=max(eGFR-115,0)/10, PE -0.031/-0.077/0.106/0.133; HCV yes 0.342; albumin censored 2-5, centered (albumin-4), PE -0.443/0.104/0.028; WBC 10^9/L censored 2.5-11, centered (WBC-5.5), PE 0.126/0.020/-0.004; BMI censored 15-35, centered (BMI-25), PE -0.055/0.004; Tate 2019 Appendix Table 1 main analysis LVCF 180 days; caller-assigned FIB-4 and eGFR; not VACS 1.0; no published S0",
      "score": 30,
      "albumin_g_dl": 4.2,
      "bmi_kg_m2": 26.0,
      "wbc_10e9_l": 6.0,
      "hemoglobin_g_dl": 15.0,
      "linear_predictor": -1.428513,
      "egfr_ml_min_1_73m2": 100.0,
      "hepatitis_c": false,
      "fib4": 1.0,
      "cd4_cells_mm3": 600,
      "hiv_rna_copies_ml": 50.0
    },
    {
      "age": 40,
      "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": "Tate JP, Sterne JAC, Justice AC; Veterans Aging Cohort Study (VACS) and the Antiretroviral Therapy Cohort Collaboration (ART-CC)",
        "doi": "10.1097/QAD.0000000000002140",
        "id": "tate-2019-vacs-2",
        "pmid": "30649088",
        "source": "AIDS. 2019;33(5):903-912",
        "title": "Albumin, white blood cell count, and body mass index improve discrimination of mortality in HIV-positive individuals"
      },
      "formula": "vacs_2",
      "formula_expression": "lp = age_poly + cd4_poly + rna_poly + hb_poly + fib4_poly + egfr_spline + hcv + alb_poly + wbc_poly + bmi_poly; score = round(44 + 20*(lp - lp_median)); lp_median is Appendix Table 2 median profile (age 52, CD4 435, log10 HIV-1 RNA 1.7, Hb 14, FIB-4 1.34, eGFR 90, HCV no, albumin 4, WBC 5.5, BMI 25.3); age censored 30-75, X=(age-50)/5, PE 0.056/-0.004/0.005; CD4 censored 0-1000 as ln(max(1000-CD4, 1)), PE -0.056/-0.153/0.024; HIV-1 RNA log10 copies censored 1.3-5.0, centered (logVL-2), PE 0.513/-0.422/0.098; hemoglobin censored 9-16, centered (hemoglobin-14), PE -0.134/0.026/0.005; FIB-4 censored 0.5-7.5, PE 0.220/-0.009; eGFR censored 0-180, X1=eGFR/10, X2=max(eGFR-35,0)/10, X3=max(eGFR-65,0)/10, X4=max(eGFR-115,0)/10, PE -0.031/-0.077/0.106/0.133; HCV yes 0.342; albumin censored 2-5, centered (albumin-4), PE -0.443/0.104/0.028; WBC 10^9/L censored 2.5-11, centered (WBC-5.5), PE 0.126/0.020/-0.004; BMI censored 15-35, centered (BMI-25), PE -0.055/0.004; Tate 2019 Appendix Table 1 main analysis LVCF 180 days; caller-assigned FIB-4 and eGFR; not VACS 1.0; no published S0",
      "score": 30,
      "albumin_g_dl": 4.2,
      "bmi_kg_m2": 26.0,
      "wbc_10e9_l": 6.0,
      "hemoglobin_g_dl": 15.0,
      "linear_predictor": -1.428513,
      "egfr_ml_min_1_73m2": 100.0,
      "hepatitis_c": false,
      "fib4": 1.0,
      "cd4_cells_mm3": 600,
      "hiv_rna_copies_ml": 50.0
    }
  ]
}

Response

Field Type Description
formula string vacs_2
formula_expression string Tate 2019 Appendix Table 1 linear predictor and Table 2 score conversion
score integer VACS Index 2.0 score; 44 at the Appendix Table 2 median profile, scale 20 × (lp - lp_median)
linear_predictor number Unrounded Appendix Table 1 Cox linear predictor, 6 decimals
age integer Input age in years
cd4_cells_mm3 integer Input CD4 cells/mm³
hiv_rna_copies_ml number Input HIV-1 RNA copies/mL
hemoglobin_g_dl number Input hemoglobin g/dL
fib4 number Caller-assigned FIB-4
egfr_ml_min_1_73m2 number Caller-assigned eGFR mL/min/1.73m²
hepatitis_c boolean Caller-assigned hepatitis C flag
albumin_g_dl number Input albumin g/dL
wbc_10e9_l number Input WBC 10^9/L
bmi_kg_m2 number Input BMI kg/m²
citation object Tate et al. AIDS 2019 citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "age": 40,
  "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": "Tate JP, Sterne JAC, Justice AC; Veterans Aging Cohort Study (VACS) and the Antiretroviral Therapy Cohort Collaboration (ART-CC)",
    "doi": "10.1097/QAD.0000000000002140",
    "id": "tate-2019-vacs-2",
    "pmid": "30649088",
    "source": "AIDS. 2019;33(5):903-912",
    "title": "Albumin, white blood cell count, and body mass index improve discrimination of mortality in HIV-positive individuals"
  },
  "formula": "vacs_2",
  "formula_expression": "lp = age_poly + cd4_poly + rna_poly + hb_poly + fib4_poly + egfr_spline + hcv + alb_poly + wbc_poly + bmi_poly; score = round(44 + 20*(lp - lp_median)); lp_median is Appendix Table 2 median profile (age 52, CD4 435, log10 HIV-1 RNA 1.7, Hb 14, FIB-4 1.34, eGFR 90, HCV no, albumin 4, WBC 5.5, BMI 25.3); age censored 30-75, X=(age-50)/5, PE 0.056/-0.004/0.005; CD4 censored 0-1000 as ln(max(1000-CD4, 1)), PE -0.056/-0.153/0.024; HIV-1 RNA log10 copies censored 1.3-5.0, centered (logVL-2), PE 0.513/-0.422/0.098; hemoglobin censored 9-16, centered (hemoglobin-14), PE -0.134/0.026/0.005; FIB-4 censored 0.5-7.5, PE 0.220/-0.009; eGFR censored 0-180, X1=eGFR/10, X2=max(eGFR-35,0)/10, X3=max(eGFR-65,0)/10, X4=max(eGFR-115,0)/10, PE -0.031/-0.077/0.106/0.133; HCV yes 0.342; albumin censored 2-5, centered (albumin-4), PE -0.443/0.104/0.028; WBC 10^9/L censored 2.5-11, centered (WBC-5.5), PE 0.126/0.020/-0.004; BMI censored 15-35, centered (BMI-25), PE -0.055/0.004; Tate 2019 Appendix Table 1 main analysis LVCF 180 days; caller-assigned FIB-4 and eGFR; not VACS 1.0; no published S0",
  "score": 30,
  "albumin_g_dl": 4.2,
  "bmi_kg_m2": 26.0,
  "wbc_10e9_l": 6.0,
  "hemoglobin_g_dl": 15.0,
  "linear_predictor": -1.428513,
  "egfr_ml_min_1_73m2": 100.0,
  "hepatitis_c": false,
  "fib4": 1.0,
  "cd4_cells_mm3": 600,
  "hiv_rna_copies_ml": 50.0
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_vacs_2 VACS Index 2.0 inputs must match Tate 2019 age, CD4, HIV-1 RNA, hemoglobin, caller-assigned FIB-4 and eGFR, HCV, albumin, WBC, and BMI. Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • VACS 1.0 — Sum the Tate 2013 VACS Index 1.0 points after one year of antiretroviral therapy from age, CD4, HIV-1 RNA, hemoglobin, caller-assigned FIB-4 and eGFR, and hepatitis C.
  • FIB-4 — Compute the FIB-4 fibrosis index from age, AST, ALT, and platelets.

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. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /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.