---
title: "goal"
description: "A desired health, or well-being, outcome for the subject of care."
---

A desired health, or well-being, outcome for the subject of care.

**Purpose.** To record details about a health-related goal and any associated targets and deadlines.

## Source

| Model | Leg | Role |
|---|---|---|
| `openEHR-EHR-EVALUATION.goal.v1` | openEHR | defines this table |

## Columns

| Column | Type | Null | Description | Source |
|---|---|---|---|---|
| `id` | `uuid primary key` | no | Primary key. | — |
| `form_id` | `uuid` → [`form`](/docs/tables/form) | no | The form this entry was recorded on. | — |
| `form_block_id` | `uuid` | yes | The block within the form, when the entry is bound to one. | — |
| `goal_name` | `text` | yes | Goal name | `/data[at0001]/items[at0002]` |
| `goal_description` | `text` | yes | Goal description | `/data[at0001]/items[at0012]` |
| `clinical_indication` | `text` | yes | Clinical indication | `/data[at0001]/items[at0010]` |
| `goal_start_date` | `timestamptz` | yes | Goal start date | `/data[at0001]/items[at0025]` |
| `goal_proposed_date` | `date` | yes | Goal proposed date | `/data[at0001]/items[at0003]` |
| `goal_end_date` | `date` | yes | Goal end date | `/data[at0001]/items[at0004]` |
| `goal_outcome`<br />`goal_outcome_code`<br />`goal_outcome_system`<br />`goal_outcome_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Goal outcome | `/data[at0001]/items[at0013]` |
| `goal_comment` | `text` | yes | Goal comment | `/data[at0001]/items[at0022]` |
| `last_updated` | `timestamptz` | yes | Last updated | `/protocol[at0026]/items[at0029]` |

## Constraints

```sql
check ((goal_outcome_code is null and goal_outcome_system is null and goal_outcome_valueset_id is null) or (goal_outcome is not null and goal_outcome_code is not null and goal_outcome_system is not null and goal_outcome_valueset_id is not null))
```

## Unique

- `form_block_id`

## References

| Columns | Target | On delete |
|---|---|---|
| `form_id` | [`form`](/docs/tables/form) | cascade |
| `form_id, form_block_id` | [`form_block`](/docs/tables/form_block) | cascade |
| `goal_outcome_valueset_id, goal_outcome_code, goal_outcome_system, goal_outcome` | [`valueset_code`](/docs/tables/valueset_code) | restrict |

## Referenced by

- [`goal_target`](/docs/tables/goal_target) via `goal_id`

## Indexes

- `goal_form_id_idx` on `form_id`

## Child tables

1 table hang off `goal`, one row per repetition.

### `goal_target`

Child table — one row per repetition, deleted with its parent.

| Column | Type | Null | Description | Source |
|---|---|---|---|---|
| `id` | `uuid primary key` | no | Primary key. | — |
| `goal_id` | `uuid` → [`goal`](/docs/tables/goal) | no | — | — |
| `position` | `integer` | no | Order of this row within its parent, from zero. | — |
| `target_name` | `text` | yes | Target name | `/data[at0001]/items[at0005]/items[at0011]` |
| `target_quantity_magnitude`<br />`target_quantity_units`<br />`target_text` | quantity<br />`numeric`, `text`, `text` | yes | Target | `/data[at0001]/items[at0005]/items[at0007]` |
| `target_description` | `text` | yes | Target description | `/data[at0001]/items[at0005]/items[at0024]` |
| `target_path` | `text` | yes | Target path | `/data[at0001]/items[at0005]/items[at0006]` |
| `target_proposed_date` | `date` | yes | Target proposed date | `/data[at0001]/items[at0005]/items[at0008]` |
| `target_end_date` | `date` | yes | Target end date | `/data[at0001]/items[at0005]/items[at0009]` |
| `target_outcome`<br />`target_outcome_code`<br />`target_outcome_system`<br />`target_outcome_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Target outcome | `/data[at0001]/items[at0005]/items[at0018]` |
| `target_comment` | `text` | yes | Target comment | `/data[at0001]/items[at0005]/items[at0023]` |

#### Constraints

```sql
check ((target_quantity_magnitude is null and target_quantity_units is null) or (target_quantity_magnitude is not null and target_quantity_units is not null))
check (num_nonnulls(target_quantity_magnitude, target_text) <= 1)
check ((target_outcome_code is null and target_outcome_system is null and target_outcome_valueset_id is null) or (target_outcome is not null and target_outcome_code is not null and target_outcome_system is not null and target_outcome_valueset_id is not null))
```

#### Unique

- `goal_id, position`

#### References

| Columns | Target | On delete |
|---|---|---|
| `goal_id` | [`goal`](/docs/tables/goal) | cascade |
| `target_outcome_valueset_id, target_outcome_code, target_outcome_system, target_outcome` | [`valueset_code`](/docs/tables/valueset_code) | restrict |

## Value sets

| Value set | Codes |
|---|---|
| `org.openehr::openEHR-EHR-EVALUATION.goal.v1/goal_outcome` | 3 |
| `org.openehr::openEHR-EHR-EVALUATION.goal.v1/target_outcome` | 3 |

