MAGENT

Emergency · LIVE

Opioid Risk Tool (Webster 2005)

ORT

Sum Webster 2005 Table 1 Opioid Risk Tool item weights for the assigned sex and return the published low, moderate, or high category.

LIVE $0.005 USDC GET /api/calc/ort

Markdown: /docs/ort.md · Canonical: https://magentlab.com/docs/ort

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

What it computes

Sum Webster 2005 Table 1 Opioid Risk Tool item weights for the assigned sex and return the published low, moderate, or high category.

When to use

When an agent has already assigned the ten yes/no flags and sex and needs the published 2005 point total, not an interview, not a diagnosis of opioid use disorder, and not the 2019 ORT-OUD revision.

When not to use

  • Not a medical device.
  • Not a diagnosis of opioid use disorder. Not the 2019 ORT-OUD revision.
  • The caller assigns each flag. magent does not interview the patient or take free-text abuse history.
  • Flags are PHI-adjacent. Persist them only encrypted for the allowlisted console.
  • Age 16-45 is a yes/no flag, not a numeric age. Preadolescent sexual abuse is 3 points for females and 0 for males (Webster 2005 Table 1).

Formula

ORT = Webster 2005 Table 1 sex-specific weights; family_alcohol F1/M3 + family_illegal_drugs F2/M3 + family_prescription_drugs 4 + personal_alcohol 3 + personal_illegal_drugs 4 + personal_prescription_drugs 5 + age_16_to_45 1 + preadolescent_sexual_abuse F3/M0 + add_ocd_bipolar_schizophrenia 2 + depression 1; absent = 0; low 0-3, moderate 4-7, high >=8; max 26

Citation

Title
Predicting aberrant behaviors in opioid-treated patients: preliminary validation of the Opioid Risk Tool
Authors
Webster LR, Webster RM
Source
Pain Med. 2005;6(6):432-442
DOI
10.1111/j.1526-4637.2005.00072.x

Worked example

Female, all flags false

Given: add_ocd_bipolar_schizophrenia=falseage_16_to_45=falsedepression=falsefamily_alcohol=falsefamily_illegal_drugs=falsefamily_prescription_drugs=falsepersonal_alcohol=falsepersonal_illegal_drugs=falsepersonal_prescription_drugs=falsepreadolescent_sexual_abuse=falsesex=female

  1. every Table 1 item absent → 0
  2. score = 0; risk low

Female family prescription drugs, personal alcohol, and age 16-45

Given: add_ocd_bipolar_schizophrenia=falseage_16_to_45=truedepression=falsefamily_alcohol=falsefamily_illegal_drugs=falsefamily_prescription_drugs=truepersonal_alcohol=truepersonal_illegal_drugs=falsepersonal_prescription_drugs=falsepreadolescent_sexual_abuse=falsesex=female

  1. family_prescription_drugs 4 + personal_alcohol 3 + age_16_to_45 1
  2. score = 8; risk high

Also searched as

  • opioid risk tool
  • Webster ORT
  • ORT score
  • opioid aberrant behavior
  • Webster 2005 opioid risk
  • ORT Pain Medicine 2005

Try

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

/api/calc/ort?sex=female&family_alcohol=false&family_illegal_drugs=false&family_prescription_drugs=false&personal_alcohol=false&personal_illegal_drugs=false&personal_prescription_drugs=false&age_16_to_45=false&preadolescent_sexual_abuse=false&add_ocd_bipolar_schizophrenia=false&depression=false

Full URL: https://api.magentlab.com/api/calc/ort?sex=female&family_alcohol=false&family_illegal_drugs=false&family_prescription_drugs=false&personal_alcohol=false&personal_illegal_drugs=false&personal_prescription_drugs=false&age_16_to_45=false&preadolescent_sexual_abuse=false&add_ocd_bipolar_schizophrenia=false&depression=false

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/ort?sex=female&family_alcohol=false&family_illegal_drugs=false&family_prescription_drugs=false&personal_alcohol=false&personal_illegal_drugs=false&personal_prescription_drugs=false&age_16_to_45=false&preadolescent_sexual_abuse=false&add_ocd_bipolar_schizophrenia=false&depression=false"

Parameters

Name Type Required Description
sex string required · female, male female or male. Webster 2005 Table 1 item weights are sex-specific. Assigned by the caller.
family_alcohol boolean required Family history of alcohol abuse as assigned by the caller (Webster 2005 Table 1). Female 1, male 3. true or false. magent does not interview the patient.
family_illegal_drugs boolean required Family history of illegal-drug abuse as assigned by the caller (Webster 2005 Table 1). Female 2, male 3. true or false.
family_prescription_drugs boolean required Family history of prescription-drug abuse as assigned by the caller (Webster 2005 Table 1). 4 points. true or false.
personal_alcohol boolean required Personal history of alcohol abuse as assigned by the caller (Webster 2005 Table 1). 3 points. true or false. magent does not interview the patient.
personal_illegal_drugs boolean required Personal history of illegal-drug abuse as assigned by the caller (Webster 2005 Table 1). 4 points. true or false.
personal_prescription_drugs boolean required Personal history of prescription-drug abuse as assigned by the caller (Webster 2005 Table 1). 5 points. true or false.
age_16_to_45 boolean required Age 16-45 years as a flag, not a numeric age (Webster 2005 Table 1). true scores 1. Assigned by the caller.
preadolescent_sexual_abuse boolean required History of preadolescent sexual abuse as assigned by the caller (Webster 2005 Table 1). Female 3, male 0. true or false. magent does not interview the patient.
add_ocd_bipolar_schizophrenia boolean required ADD, OCD, bipolar disorder, or schizophrenia as one flag (Webster 2005 Table 1). true scores 2. Assigned by the caller. magent does not diagnose.
depression boolean required Depression as assigned by the caller (Webster 2005 Table 1). true scores 1. magent does not diagnose.

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/ort 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": [
    {
      "add_ocd_bipolar_schizophrenia": "false",
      "age_16_to_45": "false",
      "depression": "false",
      "family_alcohol": "false",
      "family_illegal_drugs": "false",
      "family_prescription_drugs": "false",
      "personal_alcohol": "false",
      "personal_illegal_drugs": "false",
      "personal_prescription_drugs": "false",
      "preadolescent_sexual_abuse": "false",
      "sex": "female"
    },
    {
      "add_ocd_bipolar_schizophrenia": "false",
      "age_16_to_45": "false",
      "depression": "false",
      "family_alcohol": "false",
      "family_illegal_drugs": "false",
      "family_prescription_drugs": "false",
      "personal_alcohol": "false",
      "personal_illegal_drugs": "false",
      "personal_prescription_drugs": "false",
      "preadolescent_sexual_abuse": "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/ort",
  "items": [
    {
      "components": [
        {
          "factor": "family_alcohol",
          "points": 0,
          "present": false
        },
        {
          "factor": "family_illegal_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "family_prescription_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_alcohol",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_illegal_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_prescription_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "age_16_to_45",
          "points": 0,
          "present": false
        },
        {
          "factor": "preadolescent_sexual_abuse",
          "points": 0,
          "present": false
        },
        {
          "factor": "add_ocd_bipolar_schizophrenia",
          "points": 0,
          "present": false
        },
        {
          "factor": "depression",
          "points": 0,
          "present": false
        }
      ],
      "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": "Webster LR, Webster RM",
        "doi": "10.1111/j.1526-4637.2005.00072.x",
        "id": "webster-2005",
        "pmid": "16336480",
        "source": "Pain Med. 2005;6(6):432-442",
        "title": "Predicting aberrant behaviors in opioid-treated patients: preliminary validation of the Opioid Risk Tool"
      },
      "formula": "ort",
      "formula_expression": "ORT = Webster 2005 Table 1 sex-specific weights; family_alcohol F1/M3 + family_illegal_drugs F2/M3 + family_prescription_drugs 4 + personal_alcohol 3 + personal_illegal_drugs 4 + personal_prescription_drugs 5 + age_16_to_45 1 + preadolescent_sexual_abuse F3/M0 + add_ocd_bipolar_schizophrenia 2 + depression 1; absent = 0; low 0-3, moderate 4-7, high >=8; max 26",
      "max_score": 26,
      "score": 0,
      "sex": "female",
      "risk": "low"
    },
    {
      "components": [
        {
          "factor": "family_alcohol",
          "points": 0,
          "present": false
        },
        {
          "factor": "family_illegal_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "family_prescription_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_alcohol",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_illegal_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_prescription_drugs",
          "points": 0,
          "present": false
        },
        {
          "factor": "age_16_to_45",
          "points": 0,
          "present": false
        },
        {
          "factor": "preadolescent_sexual_abuse",
          "points": 0,
          "present": false
        },
        {
          "factor": "add_ocd_bipolar_schizophrenia",
          "points": 0,
          "present": false
        },
        {
          "factor": "depression",
          "points": 0,
          "present": false
        }
      ],
      "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": "Webster LR, Webster RM",
        "doi": "10.1111/j.1526-4637.2005.00072.x",
        "id": "webster-2005",
        "pmid": "16336480",
        "source": "Pain Med. 2005;6(6):432-442",
        "title": "Predicting aberrant behaviors in opioid-treated patients: preliminary validation of the Opioid Risk Tool"
      },
      "formula": "ort",
      "formula_expression": "ORT = Webster 2005 Table 1 sex-specific weights; family_alcohol F1/M3 + family_illegal_drugs F2/M3 + family_prescription_drugs 4 + personal_alcohol 3 + personal_illegal_drugs 4 + personal_prescription_drugs 5 + age_16_to_45 1 + preadolescent_sexual_abuse F3/M0 + add_ocd_bipolar_schizophrenia 2 + depression 1; absent = 0; low 0-3, moderate 4-7, high >=8; max 26",
      "max_score": 26,
      "score": 0,
      "sex": "female",
      "risk": "low"
    }
  ]
}

Response

Field Type Description
formula string ort
formula_expression string Exact expression used
score integer Webster 2005 Table 1 points 0-26
max_score integer 26
risk string Webster 2005 category: low (0-3), moderate (4-7), or high (>=8). Not a diagnosis of opioid use disorder.
sex string female or male
components array Per-item points for the assigned sex
citation object Webster and Webster Pain Medicine 2005 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "factor": "family_alcohol",
      "points": 0,
      "present": false
    },
    {
      "factor": "family_illegal_drugs",
      "points": 0,
      "present": false
    },
    {
      "factor": "family_prescription_drugs",
      "points": 0,
      "present": false
    },
    {
      "factor": "personal_alcohol",
      "points": 0,
      "present": false
    },
    {
      "factor": "personal_illegal_drugs",
      "points": 0,
      "present": false
    },
    {
      "factor": "personal_prescription_drugs",
      "points": 0,
      "present": false
    },
    {
      "factor": "age_16_to_45",
      "points": 0,
      "present": false
    },
    {
      "factor": "preadolescent_sexual_abuse",
      "points": 0,
      "present": false
    },
    {
      "factor": "add_ocd_bipolar_schizophrenia",
      "points": 0,
      "present": false
    },
    {
      "factor": "depression",
      "points": 0,
      "present": false
    }
  ],
  "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": "Webster LR, Webster RM",
    "doi": "10.1111/j.1526-4637.2005.00072.x",
    "id": "webster-2005",
    "pmid": "16336480",
    "source": "Pain Med. 2005;6(6):432-442",
    "title": "Predicting aberrant behaviors in opioid-treated patients: preliminary validation of the Opioid Risk Tool"
  },
  "formula": "ort",
  "formula_expression": "ORT = Webster 2005 Table 1 sex-specific weights; family_alcohol F1/M3 + family_illegal_drugs F2/M3 + family_prescription_drugs 4 + personal_alcohol 3 + personal_illegal_drugs 4 + personal_prescription_drugs 5 + age_16_to_45 1 + preadolescent_sexual_abuse F3/M0 + add_ocd_bipolar_schizophrenia 2 + depression 1; absent = 0; low 0-3, moderate 4-7, high >=8; max 26",
  "max_score": 26,
  "score": 0,
  "sex": "female",
  "risk": "low"
}

Client errors (HTTP 400)

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

HTTP Code When
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

  • COWS — Sum the eleven Wesson 2003 Clinical Opiate Withdrawal Scale (COWS) items from caller-assigned appendix integers and return the published total (max 48) with the published severity cutoffs.
  • PAWSS — Apply the Maldonado 2014 PAWSS Part A threshold and ten yes/no items and return the published 0–10 total with the ≥4 high-risk band.
  • CAGE — Sum the four Ewing 1984 CAGE items and return whether two or more answers are affirmative.

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.