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

# Create Or Update Referring Provider

> Documentation for the Create Or Update Referring Provider action for Healthie

![images/healthie.svg](https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/healthie.svg?fit=max\&auto=format\&n=EU2WCxuXGIUQcziR\&q=85\&s=d168a24dbae69f2202ca63dd7aa2e1f3)

Morf's Healthie Create Or Update Referring Provider action uses backend logic to avoid creating duplicate referring providers.

## Deduplication Logic

If no referring provider ID is specified in the node configuration, Morf will:

1. List all organization referring physicians already stored in Healthie, filtered to those with first and last names.
2. Check if any existing referring physician matches by **city, state, and business name** — but only if that information is included in the node. A referring physician must match **all** criteria provided in the node to be updated.
3. If a match is found, update that referring physician. Otherwise, create a new one.

# Parameters

**Action** `Parameters`

**parameters**

**ID** `string`

This field maps to the destination API `id` field.

**First Name** `string` *required*

This field maps to the destination API `first_name` field.

**Last Name** `string` *required*

This field maps to the destination API `last_name` field.

**City** `string`

This field maps to the destination API `location.city` field.

**State** `string`

This field maps to the destination API `location.state` field.

**Specialty** `string`

This field maps to the destination API `specialty` field.

**Business Name** `string`

This field maps to the destination API `business_name` field.

**Phone Number** `string`

This field maps to the destination API `phone_number` field.

**Email** `string`

This field maps to the destination API `email` field.

**National Provider Identifier** `string`

This field maps to the destination API `npi` field.

**Fax Number** `string`

This field maps to the destination API `fax_number` field.

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "business_name": "Dr. John",
    "created_at": "2024-05-10T08:46:04Z",
    "email": "john.doe@example.com",
    "first_name": "John",
    "full_name": "John Doe",
    "id": "57211",
    "last_name": "Doe",
    "location": {
      "city": "San Francisco",
      "country": "USA",
      "line1": "123 Main Street",
      "line2": "Suite 100",
      "state": "CA",
      "zip": "94117"
    },
    "npi": "1000321231",
    "phone_number": "+15551234123"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "business_name": "Provider's business name",
    "created_at": "Provider's creation date",
    "email": "Provider's email",
    "first_name": "Provider's first name",
    "full_name": "Provider's full name",
    "id": "Provider ID",
    "last_name": "Provider's last name",
    "location": {
      "city": "City",
      "country": "Country",
      "line1": "First line of the address",
      "line2": "Second line of the address",
      "state": "State",
      "zip": "Zip code"
    },
    "npi": "Provider's NPI",
    "phone_number": "Provider's phone number"
  }
}
```

### Result Object Field Details

You can use the result of the action's data as inputs to downstream workflow actions.

Each fetch action requires an object name, which nests the action's result data inside the downstream data context in the workflow. See [Passing Data Between Actions](https://docs.morf.health/docs/knowledge_base/passing_data_between_actions.md) for how to set it and reference the result from downstream nodes.

Here we demonstrate how to refer to this data using the prefix `$result_object_key`.

**ReferringProvider** `Fetch Action Response Object`

**fields**

**id** `string` *required*

Provider ID

```json CEL theme={null}
$result_object_key.id
```

```json Example theme={null}
"57211"
```

**first\_name** `string` *required*

`PII` Provider's first name

```json CEL theme={null}
$result_object_key.first_name
```

```json Example theme={null}
"John"
```

**last\_name** `string` *required*

`PII` Provider's last name

```json CEL theme={null}
$result_object_key.last_name
```

```json Example theme={null}
"Doe"
```

**location** `object` *required*

`PII` Provider's location

```json CEL theme={null}
$result_object_key.location
```

```json Example theme={null}
{
"city": "San Francisco",
"country": "USA",
"line1": "123 Main Street",
"line2": "Suite 100",
"state": "CA",
"zip": "94117"
}
```

**location.line1** `string`

First line of the address

```json CEL theme={null}
$result_object_key.location.line1
```

```json Example theme={null}
"123 Main Street"
```

**location.line2** `string`

Second line of the address

```json CEL theme={null}
$result_object_key.location.line2
```

```json Example theme={null}
"Suite 100"
```

**location.city** `string`

City

```json CEL theme={null}
$result_object_key.location.city
```

```json Example theme={null}
"San Francisco"
```

**location.state** `string`

State

```json CEL theme={null}
$result_object_key.location.state
```

```json Example theme={null}
"CA"
```

**location.zip** `string`

Zip code

```json CEL theme={null}
$result_object_key.location.zip
```

```json Example theme={null}
"94117"
```

**location.country** `string`

Country

```json CEL theme={null}
$result_object_key.location.country
```

```json Example theme={null}
"USA"
```

**created\_at** `timing.v1.Timestamp` *required*

Provider's creation date

```json CEL theme={null}
$result_object_key.created_at
```

```json Example theme={null}
"2024-05-10T08:46:04Z"
```

**business\_name** `string`

`PII` Provider's business name

```json CEL theme={null}
$result_object_key.business_name
```

```json Example theme={null}
"Dr. John"
```

**phone\_number** `string`

`PII` Provider's phone number

```json CEL theme={null}
$result_object_key.phone_number
```

```json Example theme={null}
"+15551234123"
```

**email** `string`

`PII` Provider's email

```json CEL theme={null}
$result_object_key.email
```

```json Example theme={null}
"john.doe@example.com"
```

**full\_name** `string`

`PII` Provider's full name

```json CEL theme={null}
$result_object_key.full_name
```

```json Example theme={null}
"John Doe"
```

**npi** `string`

Provider's NPI

```json CEL theme={null}
$result_object_key.npi
```

```json Example theme={null}
"1000321231"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.