# Create Incoming Referral

> Perform Create Incoming Referral through eClinicalWorks.

Source: [https://genhealth.ai/docs/workflows/integrations/eclinicalworks/ecw_create_incoming_referral](https://genhealth.ai/docs/workflows/integrations/eclinicalworks/ecw_create_incoming_referral)

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

- Handler: `ecw_create_incoming_referral`

- Connection type: `eclinicalworks`

## Inputs

- `patient_id` — Patient Id (text, required)
  Required text value.
- `auth_number` — Auth Number (text, required)
  Required text value.
- `visit_date` — Visit Date (date, required)
  Required date in YYYY-MM-DD format.
- `auth_start_date` — Auth Start Date (date, required)
  Required date in YYYY-MM-DD format.
- `auth_end_date` — Auth End Date (date, required)
  Required date in YYYY-MM-DD format.
- `reason` — Reason (text, required)
  Required text value.
- `sibling_visit_types` — Sibling Visit Types (json)
  Optional JSON value.
- `referring_provider_last_name` — Referring Provider Last Name (text, required)
  Required text value.
- `resolved_provider_last_name` — Resolved Provider Last Name (text)
  Optional text value.
- `encounter_id` — Encounter Id (text)
  Optional text value.
- `encounter_ids` — Encounter Ids (json)
  Optional JSON value.
- `visits_allowed` — Visits Allowed (number)
  Optional numeric value.
  Default: `1`
- `match_visit_date` — Match Visit Date (boolean)
  Optional true-or-false value.
  Default: `false`
- `link_notes` — Link Notes (textarea)
  Optional text value.

## Outputs

- `success` — Success
- `referral_id` — Referral Id
- `patient_id` — Patient Id
- `auth_number` — Auth Number
- `error` — Error

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",
    "auth_number",
    "visit_date",
    "auth_start_date",
    "auth_end_date",
    "reason",
    "referring_provider_last_name"
  ],
  "properties": {
    "reason": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "link_notes": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "textarea"
    },
    "patient_id": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "visit_date": {
      "type": "string",
      "format": "date",
      "description": "Required date in YYYY-MM-DD format.",
      "x-workflow-field-type": "date"
    },
    "auth_number": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "encounter_id": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "auth_end_date": {
      "type": "string",
      "format": "date",
      "description": "Required date in YYYY-MM-DD format.",
      "x-workflow-field-type": "date"
    },
    "encounter_ids": {
      "description": "Optional JSON value.",
      "x-workflow-field-type": "json"
    },
    "visits_allowed": {
      "type": "number",
      "default": 1,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "auth_start_date": {
      "type": "string",
      "format": "date",
      "description": "Required date in YYYY-MM-DD format.",
      "x-workflow-field-type": "date"
    },
    "match_visit_date": {
      "type": "boolean",
      "default": false,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "sibling_visit_types": {
      "description": "Optional JSON value.",
      "x-workflow-field-type": "json"
    },
    "resolved_provider_last_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "referring_provider_last_name": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "success": {},
    "patient_id": {},
    "auth_number": {},
    "referral_id": {}
  },
  "additionalProperties": true
}
```
