> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rcintell.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Medical necessity

> Validate medical necessity for procedures with diagnosis codes and clinical context

The medical necessity agent evaluates whether a procedure is medically necessary for the given diagnoses and clinical context, referencing NCD/LCD coverage determinations.

## Submit a check

```bash theme={null}
curl -X POST https://api-dev.rcintell.com/v1/agents/medical-necessity \
  -H "X-API-Key: kp_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Is total knee arthroplasty medically necessary for this patient?",
    "cpt_code": "27447",
    "dx_codes": ["M17.11"],
    "clinical_notes": "Patient has severe osteoarthritis of right knee. Failed 6 months of conservative treatment including PT, NSAIDs, and corticosteroid injections.",
    "ccn": "170001"
  }'
```

### Request body

| Field            | Type   | Required | Description                                 |
| ---------------- | ------ | -------- | ------------------------------------------- |
| `query`          | string | Yes      | Medical necessity question                  |
| `cpt_code`       | string | Yes      | CPT code to evaluate                        |
| `dx_codes`       | array  | No       | ICD-10 diagnosis codes supporting necessity |
| `clinical_notes` | string | No       | Relevant clinical notes excerpt             |
| `ccn`            | string | No       | Facility CCN for context                    |

## Poll for results

When complete:

```json theme={null}
{
  "job_id": "550e8400-...",
  "status": "completed",
  "result": {
    "assessment": "medically_necessary",
    "confidence": 0.92,
    "rationale": "Total knee arthroplasty is medically necessary for severe osteoarthritis (M17.11) after failure of conservative treatment...",
    "coverage_references": [
      {
        "type": "LCD",
        "id": "L33728",
        "title": "Total Knee Arthroplasty",
        "mac": "Jurisdiction 5",
        "relevant_criteria": ["Failed conservative treatment for ≥3 months", "Radiographic evidence of joint space narrowing"]
      }
    ],
    "documentation_checklist": [
      "Radiographic evidence of osteoarthritis",
      "Documentation of failed conservative treatment (PT, medications, injections)",
      "Functional limitation assessment",
      "BMI documentation (some payers require BMI < 40)"
    ],
    "risk_level": "low"
  },
  "audit_tier": "green",
  "composite_score": 0.93
}
```

## When to use medical necessity checks

* Before scheduling procedures that require prior authorization
* When preparing documentation for a claim submission
* When responding to a medical necessity denial
* When evaluating coverage for elective procedures
