---
title: "social_network"
description: "Group of individuals connected by social interactions and personal relationships."
---

Group of individuals connected by social interactions and personal relationships.

**Purpose.** To record information about the key people who are connected to the individual through social interactions and personal relationships.

## Source

| Model | Leg | Role |
|---|---|---|
| `openEHR-EHR-EVALUATION.social_network.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. | — |
| `description` | `text` | yes | Description | `/data[at0001]/items[at0015]` |
| `partnership_status`<br />`partnership_status_code`<br />`partnership_status_system`<br />`partnership_status_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Partnership status | `/data[at0001]/items[at0002]` |
| `comment` | `text` | yes | Comment | `/data[at0001]/items[at0018]` |
| `last_updated` | `timestamptz` | yes | Last updated | `/protocol[at0010]/items[at0011]` |

## Constraints

```sql
check ((partnership_status_code is null and partnership_status_system is null and partnership_status_valueset_id is null) or (partnership_status is not null and partnership_status_code is not null and partnership_status_system is not null and partnership_status_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 |
| `partnership_status_valueset_id, partnership_status_code, partnership_status_system, partnership_status` | [`valueset_code`](/docs/tables/valueset_code) | restrict |

## Referenced by

- [`social_network_network`](/docs/tables/social_network_network) via `social_network_id`

## Indexes

- `social_network_form_id_idx` on `form_id`

## Child tables

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

### `social_network_network`

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

| Column | Type | Null | Description | Source |
|---|---|---|---|---|
| `id` | `uuid primary key` | no | Primary key. | — |
| `social_network_id` | `uuid` → [`social_network`](/docs/tables/social_network) | no | — | — |
| `position` | `integer` | no | Order of this row within its parent, from zero. | — |
| `organization_id` | `uuid` | yes | — | — |
| `person_id` | `uuid` | yes | — | — |

#### Constraints

```sql
check (num_nonnulls(organization_id, person_id) = 1)
```

#### Unique

- `social_network_id, position`

#### References

| Columns | Target | On delete |
|---|---|---|
| `social_network_id` | [`social_network`](/docs/tables/social_network) | cascade |
| `organization_id` | [`organization`](/docs/tables/organization) | no action |
| `person_id` | [`person`](/docs/tables/person) | no action |

#### Indexes

- `social_network_network_organization_id_idx` on `organization_id`
- `social_network_network_person_id_idx` on `person_id`

