# Update Patient Usual Provider

> Perform Update Patient Usual Provider through athenahealth.

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

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

- Handler: `athena_update_patient_primary_provider`

- Connection type: `athenahealth`

## Inputs

- `patient_id` — Patient Id (expression, required)
  Required literal value or workflow expression.
- `provider_id` — Provider Id (select, required, dynamic options)
  Required selected identifier or value. Retrieve allowed values from the dynamic options endpoint.
- `expected_current_provider_id` — Expected Current Provider Id (expression)
  Optional literal value or workflow expression.
- `write_enabled` — Write Enabled (boolean)
  Optional true-or-false value.
  Default: `false`

## Outputs

- `success` — Success
- `submitted` — Submitted
- `write_skipped` — Write Skipped
- `verified` — Verified
- `patient_id` — Patient Id
- `previous_provider_id` — Previous Provider Id
- `provider_id` — Provider Id
- `error` — Error
- `error_message` — Error Message
- `failure_phase` — Failure Phase
- `error_code` — Error Code

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": [
    "patient_id",
    "provider_id"
  ],
  "properties": {
    "patient_id": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "provider_id": {
      "type": "string",
      "description": "Required selected identifier or value. Retrieve allowed values from the dynamic options endpoint.",
      "x-dynamic-options": true,
      "x-workflow-field-type": "select"
    },
    "write_enabled": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "expected_current_provider_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "success": {},
    "verified": {},
    "submitted": {},
    "error_code": {},
    "patient_id": {},
    "provider_id": {},
    "error_message": {},
    "failure_phase": {},
    "write_skipped": {},
    "previous_provider_id": {}
  },
  "additionalProperties": true
}
```
