---
title: "substance_use_summary"
description: "Summary or persistent information about typical use of a specific substance or class of substances that may harm an individual's health or social well-being."
---

Summary or persistent information about typical use of a specific substance or class of substances that may harm an individual's health or social well-being.

**Purpose.** To record summary or persistent information about the typical use of a specific substance or class of substances that may harm an individual's health or social well-being.

## Source

| Model | Leg | Role |
|---|---|---|
| `openEHR-EHR-EVALUATION.substance_use_summary.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. | — |
| `substance_name`<br />`substance_name_code`<br />`substance_name_system`<br />`substance_name_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Substance name | `/data[at0001]/items[at0002]` |
| `overall_status`<br />`overall_status_code`<br />`overall_status_system`<br />`overall_status_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Overall status | `/data[at0001]/items[at0003]` |
| `overall_description` | `text` | yes | Overall description | `/data[at0001]/items[at0007]` |
| `first_ever_use` | `timestamptz` | yes | First ever use | `/data[at0001]/items[at0008]` |
| `regular_use_commenced` | `timestamptz` | yes | Regular use commenced | `/data[at0001]/items[at0009]` |
| `daily_use_commenced` | `timestamptz` | yes | Daily use commenced | `/data[at0001]/items[at0010]` |
| `overall_quit_date` | `timestamptz` | yes | Overall quit date | `/data[at0001]/items[at0028]` |
| `overall_comment` | `text` | yes | Overall comment | `/data[at0001]/items[at0030]` |
| `last_updated` | `timestamptz` | yes | Last updated | `/protocol[at0029]/items[at0031]` |

## Constraints

```sql
check ((substance_name_code is null and substance_name_system is null and substance_name_valueset_id is null) or (substance_name is not null and substance_name_code is not null and substance_name_system is not null and substance_name_valueset_id is not null))
check ((overall_status_code is null and overall_status_system is null and overall_status_valueset_id is null and overall_status is null) or (overall_status is not null and overall_status_code is not null and overall_status_system is not null and overall_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 |
| `substance_name_valueset_id, substance_name_code, substance_name_system, substance_name` | [`valueset_code`](/docs/tables/valueset_code) | restrict |
| `overall_status_valueset_id, overall_status_code, overall_status_system, overall_status` | [`valueset_code`](/docs/tables/valueset_code) | restrict |

## Referenced by

- [`substance_use_summary_per_episode`](/docs/tables/substance_use_summary_per_episode) via `substance_use_summary_id`

## Indexes

- `substance_use_summary_form_id_idx` on `form_id`

## Child tables

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

### `substance_use_summary_per_episode`

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

| Column | Type | Null | Description | Source |
|---|---|---|---|---|
| `id` | `uuid primary key` | no | Primary key. | — |
| `substance_use_summary_id` | `uuid` → [`substance_use_summary`](/docs/tables/substance_use_summary) | no | — | — |
| `position` | `integer` | no | Order of this row within its parent, from zero. | — |
| `episode_label` | `text` | yes | Episode label | `/data[at0001]/items[at0012]/items[at0013]` |
| `episode_start_date` | `timestamptz` | yes | Episode start date | `/data[at0001]/items[at0012]/items[at0014]` |
| `specific_substance_name`<br />`specific_substance_name_code`<br />`specific_substance_name_system`<br />`specific_substance_name_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Specific substance name | `/data[at0001]/items[at0012]/items[at0016]` |
| `status`<br />`status_code`<br />`status_system`<br />`status_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Status | `/data[at0001]/items[at0012]/items[at0017]` |
| `episode_description` | `text` | yes | Episode description | `/data[at0001]/items[at0012]/items[at0018]` |
| `pattern_coded_text`<br />`pattern_coded_text_code`<br />`pattern_coded_text_system`<br />`pattern_coded_text_valueset_id`<br />`pattern_quantity_magnitude`<br />`pattern_quantity_units` | coded text<br />`text`, `text`, `text`, `text`, `numeric`, `text` | yes | Pattern | `/data[at0001]/items[at0012]/items[at0019]` |
| `typical_amount_magnitude`<br />`typical_amount_units` | quantity<br />`numeric`, `text` | yes | Typical amount | `/data[at0001]/items[at0012]/items[at0023]` |
| `route`<br />`route_code`<br />`route_system`<br />`route_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Route | `/data[at0001]/items[at0012]/items[at0036]` |
| `episode_end_date` | `timestamptz` | yes | Episode end date | `/data[at0001]/items[at0012]/items[at0015]` |
| `number_of_quit_attempts` | `integer` | yes | Number of quit attempts | `/data[at0001]/items[at0012]/items[at0024]` |
| `episode_comment` | `timestamptz` | yes | Episode comment | `/data[at0001]/items[at0012]/items[at0026]` |

#### Constraints

```sql
check ((specific_substance_name_code is null and specific_substance_name_system is null and specific_substance_name_valueset_id is null) or (specific_substance_name is not null and specific_substance_name_code is not null and specific_substance_name_system is not null and specific_substance_name_valueset_id is not null))
check ((status_code is null and status_system is null and status_valueset_id is null and status is null) or (status is not null and status_code is not null and status_system is not null and status_valueset_id is not null))
check ((pattern_coded_text_code is null and pattern_coded_text_system is null and pattern_coded_text_valueset_id is null) or (pattern_coded_text is not null and pattern_coded_text_code is not null and pattern_coded_text_system is not null and pattern_coded_text_valueset_id is not null))
check ((pattern_quantity_magnitude is null and pattern_quantity_units is null) or (pattern_quantity_magnitude is not null and pattern_quantity_units is not null))
check (pattern_quantity_magnitude is null or (pattern_quantity_units = '1/d' and pattern_quantity_magnitude >= 0) or (pattern_quantity_units = '1/wk' and pattern_quantity_magnitude >= 0) or (pattern_quantity_units = '1/mo' and pattern_quantity_magnitude >= 0) or (pattern_quantity_units = '1/a' and pattern_quantity_magnitude >= 0))
check (num_nonnulls(pattern_coded_text, pattern_quantity_magnitude) <= 1)
check ((typical_amount_magnitude is null and typical_amount_units is null) or (typical_amount_magnitude is not null and typical_amount_units is not null))
check (typical_amount_magnitude is null or (typical_amount_units = 'mg/d' and typical_amount_magnitude >= 0) or (typical_amount_units = 'g/d' and typical_amount_magnitude >= 0) or (typical_amount_units = 'mg/wk' and typical_amount_magnitude >= 0) or (typical_amount_units = 'g/wk' and typical_amount_magnitude >= 0) or (typical_amount_units = 'mg/mo' and typical_amount_magnitude >= 0) or (typical_amount_units = 'g/mo' and typical_amount_magnitude >= 0) or (typical_amount_units = 'ug/d' and typical_amount_magnitude >= 0) or (typical_amount_units = 'ug/wk' and typical_amount_magnitude >= 0) or (typical_amount_units = 'ug/mo' and typical_amount_magnitude >= 0))
check ((route_code is null and route_system is null and route_valueset_id is null) or (route is not null and route_code is not null and route_system is not null and route_valueset_id is not null))
check (number_of_quit_attempts is null or number_of_quit_attempts >= 0)
```

#### Unique

- `substance_use_summary_id, position`

#### References

| Columns | Target | On delete |
|---|---|---|
| `substance_use_summary_id` | [`substance_use_summary`](/docs/tables/substance_use_summary) | cascade |
| `specific_substance_name_valueset_id, specific_substance_name_code, specific_substance_name_system, specific_substance_name` | [`valueset_code`](/docs/tables/valueset_code) | restrict |
| `status_valueset_id, status_code, status_system, status` | [`valueset_code`](/docs/tables/valueset_code) | restrict |
| `pattern_coded_text_valueset_id, pattern_coded_text_code, pattern_coded_text_system, pattern_coded_text` | [`valueset_code`](/docs/tables/valueset_code) | restrict |
| `route_valueset_id, route_code, route_system, route` | [`valueset_code`](/docs/tables/valueset_code) | restrict |

## Value sets

| Value set | Codes |
|---|---|
| `org.openehr::openEHR-EHR-EVALUATION.substance_use_summary.v1/overall_status` | 3 |
| `org.openehr::openEHR-EHR-EVALUATION.substance_use_summary.v1/pattern` | 2 |
| `org.openehr::openEHR-EHR-EVALUATION.substance_use_summary.v1/status` | 2 |

