> ## 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 Patient History

> Documentation for the Create Patient History action for Elation

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

# Parameters

**Action** `Parameters`

**parameters**

**Patient ID** `string`

`ID`
This field maps to the destination API `patientId` field.

**History Type** `elation.v1.HistoryType` *required*

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

```json Allowed Enumeration Values theme={null}
HISTORY_TYPE_PAST
HISTORY_TYPE_FAMILY
HISTORY_TYPE_SOCIAL
HISTORY_TYPE_HABITS
HISTORY_TYPE_DIET
HISTORY_TYPE_EXERCISE
HISTORY_TYPE_IMMUNIZATION
HISTORY_TYPE_LEGAL
HISTORY_TYPE_CONSULTATION
HISTORY_TYPE_HEALTH_MAINTENANCE
HISTORY_TYPE_PAST_SURGICAL
HISTORY_TYPE_COGNITIVE_STATUS
HISTORY_TYPE_FUNCTIONAL_STATUS
```

**Text** `string` *required*

`HI`
This field maps to the destination API `text` field.

**Rank** `int64`

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

```json Result Object Example theme={null}
{
  "$result_object_key": {
    "created_at": "2024-01-15T10:30:00Z",
    "deleted_date": "",
    "history_type": "HISTORY_TYPE_PAST",
    "id": "123456789",
    "patient_id": "987654321",
    "rank": 1,
    "text": "Patient has a history of hypertension"
  }
}
```

```json Result Object Description theme={null}
{
  "$result_object_key": {
    "created_at": "Timestamp when the history entry was created.",
    "deleted_date": "Timestamp when the history entry was deleted, if applicable.",
    "history_type": "Type of history entry.",
    "id": "Unique identifier for the history entry.",
    "patient_id": "ID of the patient this history belongs to.",
    "rank": "Rank or order of the history entry.",
    "text": "Content of the history entry. Must not be empty."
  }
}
```

### 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`.

**History** `Fetch Action Response Object`

**fields**

**id** `string` *required*

Unique identifier for the history entry.

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

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

**history\_type** `elation.v1.HistoryType` *required*

Type of history entry.

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

```json Example theme={null}
elation.v1.HistoryType.HISTORY_TYPE_PAST
elation.v1.HistoryType.HISTORY_TYPE_FAMILY
elation.v1.HistoryType.HISTORY_TYPE_SOCIAL
elation.v1.HistoryType.HISTORY_TYPE_HABITS
elation.v1.HistoryType.HISTORY_TYPE_DIET
elation.v1.HistoryType.HISTORY_TYPE_EXERCISE
elation.v1.HistoryType.HISTORY_TYPE_IMMUNIZATION
elation.v1.HistoryType.HISTORY_TYPE_LEGAL
elation.v1.HistoryType.HISTORY_TYPE_CONSULTATION
elation.v1.HistoryType.HISTORY_TYPE_HEALTH_MAINTENANCE
elation.v1.HistoryType.HISTORY_TYPE_PAST_SURGICAL
elation.v1.HistoryType.HISTORY_TYPE_COGNITIVE_STATUS
elation.v1.HistoryType.HISTORY_TYPE_FUNCTIONAL_STATUS
```

**patient\_id** `string` *required*

`ID` ID of the patient this history belongs to.

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

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

**text** `string` *required*

Content of the history entry. Must not be empty.

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

```json Example theme={null}
"Patient has a history of hypertension"
```

**rank** `int64` *required*

Rank or order of the history entry.

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

```json Example theme={null}
1
```

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

Timestamp when the history entry was created.

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

```json Example theme={null}
"2024-01-15T10:30:00Z"
```

**deleted\_date** `timing.v1.Timestamp`

Timestamp when the history entry was deleted, if applicable.

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

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


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