# Create Referral Draft

> Perform Create Referral Draft through Cori.

Source: [https://genhealth.ai/docs/workflows/integrations/cori/cori_create_referral](https://genhealth.ai/docs/workflows/integrations/cori/cori_create_referral)

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

- Handler: `cori_create_referral`

- Connection type: `cori`

## Use in a workflow

Copy this discovered node config, fill params from the input contract, and validate the complete graph. Integration results are available as {{node_id.default.field}}. Check business success before dependent writes; completion alone does not prove business success.

```json

{
  "_group": "Cori",
  "params": {},
  "handler": "cori_create_referral"
}

```

[Action contracts](https://genhealth.ai/docs/workflows/action-contracts.md) · [Run recovery](https://genhealth.ai/docs/workflows/operations.md)

## Inputs

- `client_submission_key` — Client Submission Key (text, required)
  Required text value.
- `patient_first_name` — Patient First Name (text, required)
  Required text value.
- `patient_last_name` — Patient Last Name (text, required)
  Required text value.
- `date_of_birth` — Date Of Birth (text, required)
  Required text value.
- `address_line_1` — Address Line 1 (text)
  Optional text value.
- `address_line_2` — Address Line 2 (text)
  Optional text value.
- `city` — City (text)
  Optional text value.
- `state` — State (text)
  Optional text value.
- `postal_code` — Postal Code (text)
  Optional text value.
- `phone` — Phone (text)
  Optional text value.
- `gender` — Gender (text)
  Optional text value.
- `doctor_name` — Doctor Name (text)
  Optional text value.
- `doctor_npi` — Doctor Npi (text)
  Optional text value.
- `payer_name` — Payer Name (text)
  Optional text value.
- `policy_number` — Policy Number (text)
  Optional text value.
- `diagnosis_codes` — Diagnosis Codes (json)
  Optional JSON value.
- `due_date` — Due Date (text)
  Optional text value.
- `priority` — Priority (text)
  Optional text value.
  Options: High ("High"), Normal ("Normal"), Low ("Low")
- `notes` — Notes (text)
  Optional text value.
- `destination` — Destination (text)
  Optional text value.
- `owner` — Owner (text)
  Optional text value.
- `submitted_by_name` — Submitted By Name (text)
  Optional text value.
- `submitted_by_email` — Submitted By Email (text)
  Optional text value.
- `brightree_patient_ref` — Brightree Patient Ref (text)
  Optional text value.
- `brightree_order_ref` — Brightree Order Ref (text)
  Optional text value.
- `lines` — Lines (json)
  Optional JSON value.

## Outputs

- `success` — Success
- `operation` — Operation
- `data` — Data
- `referral_id` — Referral Id
- `document_id` — Document Id
- `s3_path` — S3 Path
- `cori_url` — Cori Url
- `error` — Error
- `error_kind` — Error Kind
- `indeterminate` — Indeterminate
- `retryable` — Retryable
- `was_existing` — Was Existing
- `already_submitted` — Already Submitted

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": [
    "client_submission_key",
    "patient_first_name",
    "patient_last_name",
    "date_of_birth"
  ],
  "properties": {
    "city": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "lines": {
      "description": "Optional JSON value.",
      "x-workflow-field-type": "json"
    },
    "notes": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "owner": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "phone": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "state": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "gender": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "due_date": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "priority": {
      "enum": [
        "High",
        "Normal",
        "Low"
      ],
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "doctor_npi": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "payer_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "destination": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "doctor_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "postal_code": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "date_of_birth": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "policy_number": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "address_line_1": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "address_line_2": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "diagnosis_codes": {
      "description": "Optional JSON value.",
      "x-workflow-field-type": "json"
    },
    "patient_last_name": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "submitted_by_name": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "patient_first_name": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "submitted_by_email": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "brightree_order_ref": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "brightree_patient_ref": {
      "type": "string",
      "description": "Optional text value.",
      "x-workflow-field-type": "text"
    },
    "client_submission_key": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "data": {},
    "error": {},
    "s3_path": {},
    "success": {},
    "cori_url": {},
    "operation": {},
    "retryable": {},
    "error_kind": {},
    "document_id": {},
    "referral_id": {},
    "was_existing": {},
    "indeterminate": {},
    "already_submitted": {}
  },
  "additionalProperties": true
}
```
