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

# AthenaHealth Check Active Referral Authorization

> AthenaHealth referral authorization status tool exposed through the Agents Platform.

This document covers `athenahealth_check_active_referral_authorization`, the AthenaHealth referral authorization status tool exposed through the Agents Platform.

## Authentication

Uses the existing AthenaHealth connector credentials.

## `athenahealth_check_active_referral_authorization`

Checks referral authorizations for a patient and returns whether an active authorization appears to match the billed insurance name.

### Inputs

Required:

* `patient_id`: AthenaHealth patient ID.

Optional:

* `department_id`: the encounter's department ID (from the encounter summary/details). Forwarded to AthenaHealth as `departmentid` when provided.
* `billed_insurance_name`: Insurance name from encounter/patient summary. When present, matching is restricted to authorizations that appear related to that payer.

### Output

```json theme={null}
{
  "success": true,
  "patient_id": "111",
  "has_active_pa": true,
  "authorizations": []
}
```

Common failure reasons:

* `athenahealth_not_connected`
* AthenaHealth API error fetching referral authorizations

## Human-readable text

The tool emits markdown for the feed: a `## Referral Authorization` table (patient, practice, billed insurance, active-match) and an `## Authorizations` table (status, auth #, details) when present. The raw authorizations payload stays in `structuredContent`.

## Agent Instruction Guidance

Use this in the realtime coding workflow after summary checks pass. Feed `has_active_pa` into CPT-generation prompts for Spravato/PA-sensitive decisions.
