---
title: "specimen_container"
description: "Details of a container used to hold, transport and/or archive a specimen for laboratory examination."
---

Details of a container used to hold, transport and/or archive a specimen for laboratory examination.

**Purpose.** To record details of a container used to hold, transport and/or archive a specimen for laboratory examination.

## Source

| Model | Leg | Role |
|---|---|---|
| `openEHR-EHR-CLUSTER.specimen_container.v1` | openEHR | defines this table |

## Columns

| Column | Type | Null | Description | Source |
|---|---|---|---|---|
| `id` | `uuid primary key` | no | Primary key. | — |
| `container_type`<br />`container_type_code`<br />`container_type_system`<br />`container_type_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Container type | `/items[at0005]` |
| `container_id_value`<br />`container_id_system` | text, text<br />`text`, `text` | yes | Container ID | `/items[at0003]` |
| `description` | `text` | yes | Description | `/items[at0013]` |
| `components` | `text` | yes | Components | `/items[at0037]` |
| `additive_s`<br />`additive_s_code`<br />`additive_s_system`<br />`additive_s_valueset_id` | coded text<br />`text`, `text`, `text`, `text` | yes | Additive/s | `/items[at0026]` |
| `capacity_magnitude`<br />`capacity_units` | quantity<br />`numeric`, `text` | yes | Capacity | `/items[at0035]` |
| `minimum_volum_magnitude`<br />`minimum_volum_units` | quantity<br />`numeric`, `text` | yes | Minimum volum | `/items[at0038]` |
| `comment` | `text` | yes | Comment | `/items[at0036]` |

## Constraints

```sql
check ((container_type_code is null and container_type_system is null and container_type_valueset_id is null) or (container_type is not null and container_type_code is not null and container_type_system is not null and container_type_valueset_id is not null))
check (container_id_system is null or container_id_value is not null)
check ((additive_s_code is null and additive_s_system is null and additive_s_valueset_id is null) or (additive_s is not null and additive_s_code is not null and additive_s_system is not null and additive_s_valueset_id is not null))
check ((capacity_magnitude is null and capacity_units is null) or (capacity_magnitude is not null and capacity_units is not null))
check ((minimum_volum_magnitude is null and minimum_volum_units is null) or (minimum_volum_magnitude is not null and minimum_volum_units is not null))
```

## References

| Columns | Target | On delete |
|---|---|---|
| `container_type_valueset_id, container_type_code, container_type_system, container_type` | [`valueset_code`](/docs/tables/valueset_code) | restrict |
| `additive_s_valueset_id, additive_s_code, additive_s_system, additive_s` | [`valueset_code`](/docs/tables/valueset_code) | restrict |

## Referenced by

- [`specimen_container_details`](/docs/tables/specimen_container_details) via `specimen_container_id`
- [`specimen_container_contents`](/docs/tables/specimen_container_contents) via `specimen_container_id`
- [`specimen_container_contents`](/docs/tables/specimen_container_contents) via `contents_specimen_container_id`

## Child tables

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

### `specimen_container_contents`

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

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

#### Constraints

```sql
check (num_nonnulls(specimen_id, contents_specimen_container_id) = 1)
```

#### Unique

- `specimen_container_id, position`

#### References

| Columns | Target | On delete |
|---|---|---|
| `specimen_container_id` | [`specimen_container`](/docs/tables/specimen_container) | cascade |
| `specimen_id` | [`specimen`](/docs/tables/specimen) | no action |
| `contents_specimen_container_id` | [`specimen_container`](/docs/tables/specimen_container) | no action |

#### Indexes

- `specimen_container_contents_specimen_id_idx` on `specimen_id`
- `specimen_container_contents_contents_specimen_container_id_idx` on `contents_specimen_container_id`

