# Download Referral Document

> Perform Download Referral Document through athenahealth.

Source: [https://genhealth.ai/docs/workflows/integrations/athenahealth/athena_download_referral_document](https://genhealth.ai/docs/workflows/integrations/athenahealth/athena_download_referral_document)

Integration: [athenahealth](https://genhealth.ai/docs/workflows/integrations/athenahealth.md)

- Handler: `athena_download_referral_document`

- Connection type: `athenahealth`

## Inputs

- `document_id` — Document Id (expression, required)
  Required literal value or workflow expression.
- `document_class` — Document Class (expression)
  Optional literal value or workflow expression.
  Default: `"ADMIN"`
- `document_type` — Document Type (expression)
  Optional literal value or workflow expression.
  Default: `"Referral"`
- `apply_rotation` — Apply Rotation (boolean)
  Optional true-or-false value.
  Default: `true`

## Outputs

- `success` — Success
- `document_id` — Document Id
- `athena_document_id` — Athena Document Id
- `athena_document_class` — Athena Document Class
- `athena_document_sub_class` — Athena Document Sub Class
- `athena_document_status` — Athena Document Status
- `page_count` — Page Count
- `rotated_page_count` — Rotated Page Count
- `size` — Size
- `sha256` — Sha256
- `was_existing` — Was Existing
- `error` — Error
- `error_message` — Error Message

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `write`
- Confirmation recommended: no
- Retry safe: no
- Dry run supported: no

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "required": [
    "document_id"
  ],
  "properties": {
    "document_id": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_type": {
      "default": "Referral",
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "apply_rotation": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "document_class": {
      "default": "ADMIN",
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "size": {},
    "error": {},
    "sha256": {},
    "success": {},
    "page_count": {},
    "document_id": {},
    "was_existing": {},
    "error_message": {},
    "athena_document_id": {},
    "rotated_page_count": {},
    "athena_document_class": {},
    "athena_document_status": {},
    "athena_document_sub_class": {}
  },
  "additionalProperties": true
}
```
