MAGENT

Kidney · LIVE

D:A:D CKD risk score (Mocroft)

D:A:D CKD

Sum the Mocroft 2015 D:A:D Table 2 full integer CKD risk score from injecting drug use, hepatitis C, age, caller-assigned eGFR >60, sex, nadir CD4, hypertension, prior CVD, and diabetes.

LIVE $0.005 USDC GET /api/calc/dad_ckd

Markdown: /docs/dad-ckd.md · Canonical: https://magentlab.com/docs/dad-ckd

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

What it computes

Sum the Mocroft 2015 D:A:D Table 2 full integer CKD risk score from injecting drug use, hepatitis C, age, caller-assigned eGFR >60, sex, nadir CD4, hypertension, prior CVD, and diabetes.

When to use

When an agent already has those caller-assigned values and needs the published full-score point total and low/medium/high band. magent does not compute eGFR, diagnose HIV or CKD, or order ART.

When not to use

  • Not a medical device. Not a CKD diagnosis and not an antiretroviral (ART) start or switch order.
  • Mocroft 2015 Table 2 full integer risk score only. This is not the short score, not the Poisson exact-probability model, not number needed to harm (NNTH), and not an ARV-start decision tool.
  • Derivation required eGFR > 60 mL/min. eGFR ≤60 is invalid (not in that population).
  • eGFR is caller-assigned. magent does not compute CKD-EPI, MDRD, or Cockcroft–Gault.
  • Race was not in the published score and is not an input.
  • Flags are caller-supplied booleans. magent does not diagnose injecting drug use, hepatitis C, hypertension, CVD, or diabetes.

Formula

D:A:D full CKD = ivdu 2 + hepatitis_c 1 + age (≤35 0; >35 and ≤50 4; >50 and ≤60 7; >60 10) + egfr (>90 −6; >70 and ≤90 0; >60 and ≤70 6) + female 1 + nadir_cd4 (>200 −1; ≤200 0) + hypertension 1 + prior_cvd 1 + diabetes 2; Mocroft 2015 Table 2; max 24; bands low <0, medium 0–4, high ≥5

Citation

Title
Development and Validation of a Risk Score for Chronic Kidney Disease in HIV Infection Using Prospective Cohort Data from the D:A:D Study
Authors
Mocroft A, Lundgren JD, Ross M, Law M, Reiss P, Kirk O, et al.
Source
PLoS Med. 2015;12(3):e1001809
DOI
10.1371/journal.pmed.1001809

Worked example

Mocroft 2015 worked example (score 12, high)

Given: age_years=38diabetes=trueegfr_ml_min=68hepatitis_c=falsehypertension=falseivdu=falsenadir_cd4_cells_mm3=250prior_cvd=falsesex=female

  1. female 1 + no IVDU 0 + no HCV 0 + age 38 → 4 + eGFR 68 → 6 + nadir CD4 250 → −1 + no HTN 0 + no CVD 0 + diabetes 2
  2. Score = 12 (max 24); risk_band high

Young male, eGFR >90, nadir CD4 >200, no flags

Given: age_years=30diabetes=falseegfr_ml_min=95hepatitis_c=falsehypertension=falseivdu=falsenadir_cd4_cells_mm3=300prior_cvd=falsesex=male

  1. age ≤35 → 0; eGFR >90 → −6; nadir CD4 >200 → −1; remaining factors 0
  2. Score = −7 (max 24); risk_band low

Also searched as

  • D:A:D CKD score
  • Mocroft CKD HIV
  • D:A:D chronic kidney disease
  • HIV CKD risk score
  • DAD CKD

Try

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

/api/calc/dad_ckd?ivdu=false&hepatitis_c=false&age_years=38&egfr_ml_min=68&sex=female&nadir_cd4_cells_mm3=250&hypertension=false&prior_cvd=false&diabetes=true

Full URL: https://api.magentlab.com/api/calc/dad_ckd?ivdu=false&hepatitis_c=false&age_years=38&egfr_ml_min=68&sex=female&nadir_cd4_cells_mm3=250&hypertension=false&prior_cvd=false&diabetes=true

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/dad_ckd?ivdu=false&hepatitis_c=false&age_years=38&egfr_ml_min=68&sex=female&nadir_cd4_cells_mm3=250&hypertension=false&prior_cvd=false&diabetes=true"

Parameters

Name Type Required Description
ivdu boolean required Caller-assigned injecting drug use (Mocroft 2015 Table 2). true scores 2. magent does not diagnose injecting drug use.
hepatitis_c boolean required Caller-assigned hepatitis C co-infection (Mocroft 2015 Table 2). true scores 1. magent does not diagnose hepatitis C.
age_years integer required Age in years (integer 16-120). Mocroft 2015 Table 2: ≤35 scores 0; >35 and ≤50 scores 4; >50 and ≤60 scores 7; >60 scores 10.
egfr_ml_min number required Caller-assigned eGFR in mL/min (0.1-250, must be >60). Mocroft 2015 Table 2: >90 scores −6; >70 and ≤90 scores 0; >60 and ≤70 scores 6. eGFR ≤60 is outside the derivation population. magent does not compute eGFR.
sex string required · female, male Sex (Mocroft 2015 Table 2). female scores 1; male scores 0.
nadir_cd4_cells_mm3 integer required Nadir CD4 count in cells/mm³ (integer 0-3000). Mocroft 2015 Table 2: ≤200 scores 0; >200 scores −1. magent does not assay CD4.
hypertension boolean required Caller-assigned hypertension (Mocroft 2015 Table 2). true scores 1. magent does not diagnose hypertension.
prior_cvd boolean required Caller-assigned prior cardiovascular disease (Mocroft 2015 Table 2). true scores 1. magent does not diagnose CVD.
diabetes boolean required Caller-assigned diabetes (Mocroft 2015 Table 2). true scores 2. magent does not diagnose diabetes.

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/dad_ckd 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_years": "38",
      "diabetes": "true",
      "egfr_ml_min": "68",
      "hepatitis_c": "false",
      "hypertension": "false",
      "ivdu": "false",
      "nadir_cd4_cells_mm3": "250",
      "prior_cvd": "false",
      "sex": "female"
    },
    {
      "age_years": "38",
      "diabetes": "true",
      "egfr_ml_min": "68",
      "hepatitis_c": "false",
      "hypertension": "false",
      "ivdu": "false",
      "nadir_cd4_cells_mm3": "250",
      "prior_cvd": "false",
      "sex": "female"
    }
  ]
}

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/dad_ckd",
  "items": [
    {
      "components": [
        {
          "factor": "ivdu",
          "points": 0,
          "present": false
        },
        {
          "factor": "hepatitis_c",
          "points": 0,
          "present": false
        },
        {
          "value": 38,
          "factor": "age_years",
          "points": 4,
          "present": true
        },
        {
          "value": 68.0,
          "factor": "egfr_ml_min",
          "points": 6,
          "present": true
        },
        {
          "value": "female",
          "factor": "sex",
          "points": 1,
          "present": true
        },
        {
          "value": 250,
          "factor": "nadir_cd4_cells_mm3",
          "points": -1,
          "present": true
        },
        {
          "factor": "hypertension",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_cvd",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 2,
          "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": "Mocroft A, Lundgren JD, Ross M, Law M, Reiss P, Kirk O, et al.",
        "doi": "10.1371/journal.pmed.1001809",
        "id": "mocroft-2015",
        "pmid": "25826420",
        "source": "PLoS Med. 2015;12(3):e1001809",
        "title": "Development and Validation of a Risk Score for Chronic Kidney Disease in HIV Infection Using Prospective Cohort Data from the D:A:D Study"
      },
      "formula": "dad_ckd",
      "formula_expression": "D:A:D full CKD = ivdu 2 + hepatitis_c 1 + age (≤35 0; >35 and ≤50 4; >50 and ≤60 7; >60 10) + egfr (>90 −6; >70 and ≤90 0; >60 and ≤70 6) + female 1 + nadir_cd4 (>200 −1; ≤200 0) + hypertension 1 + prior_cvd 1 + diabetes 2; Mocroft 2015 Table 2; max 24; bands low <0, medium 0–4, high ≥5",
      "max_score": 24,
      "score": 12,
      "age_years": 38,
      "risk_band": "high",
      "sex": "female",
      "diabetes": true,
      "egfr_ml_min": 68.0,
      "hepatitis_c": false,
      "hypertension": false,
      "ivdu": false,
      "nadir_cd4_cells_mm3": 250,
      "prior_cvd": false
    },
    {
      "components": [
        {
          "factor": "ivdu",
          "points": 0,
          "present": false
        },
        {
          "factor": "hepatitis_c",
          "points": 0,
          "present": false
        },
        {
          "value": 38,
          "factor": "age_years",
          "points": 4,
          "present": true
        },
        {
          "value": 68.0,
          "factor": "egfr_ml_min",
          "points": 6,
          "present": true
        },
        {
          "value": "female",
          "factor": "sex",
          "points": 1,
          "present": true
        },
        {
          "value": 250,
          "factor": "nadir_cd4_cells_mm3",
          "points": -1,
          "present": true
        },
        {
          "factor": "hypertension",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_cvd",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 2,
          "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": "Mocroft A, Lundgren JD, Ross M, Law M, Reiss P, Kirk O, et al.",
        "doi": "10.1371/journal.pmed.1001809",
        "id": "mocroft-2015",
        "pmid": "25826420",
        "source": "PLoS Med. 2015;12(3):e1001809",
        "title": "Development and Validation of a Risk Score for Chronic Kidney Disease in HIV Infection Using Prospective Cohort Data from the D:A:D Study"
      },
      "formula": "dad_ckd",
      "formula_expression": "D:A:D full CKD = ivdu 2 + hepatitis_c 1 + age (≤35 0; >35 and ≤50 4; >50 and ≤60 7; >60 10) + egfr (>90 −6; >70 and ≤90 0; >60 and ≤70 6) + female 1 + nadir_cd4 (>200 −1; ≤200 0) + hypertension 1 + prior_cvd 1 + diabetes 2; Mocroft 2015 Table 2; max 24; bands low <0, medium 0–4, high ≥5",
      "max_score": 24,
      "score": 12,
      "age_years": 38,
      "risk_band": "high",
      "sex": "female",
      "diabetes": true,
      "egfr_ml_min": 68.0,
      "hepatitis_c": false,
      "hypertension": false,
      "ivdu": false,
      "nadir_cd4_cells_mm3": 250,
      "prior_cvd": false
    }
  ]
}

Response

Field Type Description
formula string dad_ckd
formula_expression string Exact expression used
score integer Mocroft 2015 Table 2 full-score points
max_score integer 24
risk_band string Mocroft 2015 band: low (score < 0), medium (0–4), or high (≥5). A band, not a CKD diagnosis.
age_years integer Age in years used for Table 2 age bands
egfr_ml_min number Caller-assigned eGFR used for Table 2 eGFR bands
sex string female or male
nadir_cd4_cells_mm3 integer Nadir CD4 cells/mm³ used for Table 2 nadir bands
ivdu boolean Caller-assigned injecting drug use flag
hepatitis_c boolean Caller-assigned hepatitis C flag
hypertension boolean Caller-assigned hypertension flag
prior_cvd boolean Caller-assigned prior CVD flag
diabetes boolean Caller-assigned diabetes flag
components array Per-factor Table 2 points
citation object Mocroft et al. PLoS Med 2015 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "factor": "ivdu",
      "points": 0,
      "present": false
    },
    {
      "factor": "hepatitis_c",
      "points": 0,
      "present": false
    },
    {
      "value": 38,
      "factor": "age_years",
      "points": 4,
      "present": true
    },
    {
      "value": 68.0,
      "factor": "egfr_ml_min",
      "points": 6,
      "present": true
    },
    {
      "value": "female",
      "factor": "sex",
      "points": 1,
      "present": true
    },
    {
      "value": 250,
      "factor": "nadir_cd4_cells_mm3",
      "points": -1,
      "present": true
    },
    {
      "factor": "hypertension",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_cvd",
      "points": 0,
      "present": false
    },
    {
      "factor": "diabetes",
      "points": 2,
      "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": "Mocroft A, Lundgren JD, Ross M, Law M, Reiss P, Kirk O, et al.",
    "doi": "10.1371/journal.pmed.1001809",
    "id": "mocroft-2015",
    "pmid": "25826420",
    "source": "PLoS Med. 2015;12(3):e1001809",
    "title": "Development and Validation of a Risk Score for Chronic Kidney Disease in HIV Infection Using Prospective Cohort Data from the D:A:D Study"
  },
  "formula": "dad_ckd",
  "formula_expression": "D:A:D full CKD = ivdu 2 + hepatitis_c 1 + age (≤35 0; >35 and ≤50 4; >50 and ≤60 7; >60 10) + egfr (>90 −6; >70 and ≤90 0; >60 and ≤70 6) + female 1 + nadir_cd4 (>200 −1; ≤200 0) + hypertension 1 + prior_cvd 1 + diabetes 2; Mocroft 2015 Table 2; max 24; bands low <0, medium 0–4, high ≥5",
  "max_score": 24,
  "score": 12,
  "age_years": 38,
  "risk_band": "high",
  "sex": "female",
  "diabetes": true,
  "egfr_ml_min": 68.0,
  "hepatitis_c": false,
  "hypertension": false,
  "ivdu": false,
  "nadir_cd4_cells_mm3": 250,
  "prior_cvd": false
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_dad_ckd D:A:D CKD score inputs must match Mocroft 2015 age, eGFR, CD4 nadir, and flag categories from that paper. Returned before settlement; you are not charged.
400 invalid_sex sex must be female or male Returned before settlement; you are not charged.
400 invalid_flag boolean clinical flags must be true or false 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

  • CKD-EPI 2021 eGFR — Compute race-free CKD-EPI 2021 creatinine eGFR in mL/min/1.73m2.
  • Cockcroft–Gault CrCl — Compute Cockcroft–Gault creatinine clearance in mL/min using total body weight.
  • Schwartz 2009 eGFR — Compute the 2009 Schwartz bedside CKiD eGFR in mL/min/1.73m2 from height and serum creatinine.

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.