--- title: "specimen" description: "A physical sample collected from, or related to, an individual for the purpose of investigation, examination or analysis." --- A physical sample collected from, or related to, an individual for the purpose of investigation, examination or analysis. **Purpose.** To record details about a physical sample collected from, or related to, an individual for the purpose of investigation, examination or analysis. ## Source | Model | Leg | Role | |---|---|---| | `openEHR-EHR-CLUSTER.specimen.v1` | openEHR | defines this table | ## Columns | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `specimen_type`
`specimen_type_code`
`specimen_type_system`
`specimen_type_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Specimen type | `/items[at0029]` | | `specimen_label` | `text` | yes | Specimen label | `/items[at0098]` | | `specimen_description` | `text` | yes | Specimen description | `/items[at0097]` | | `number_of_fragments` | `integer` | yes | Number of fragments | `/items[at0099]` | | `laboratory_specimen_identifier_value`
`laboratory_specimen_identifier_system` | text, text
`text`, `text` | yes | Laboratory specimen identifier | `/items[at0001]` | | `external_identifier_value`
`external_identifier_system` | text, text
`text`, `text` | yes | External identifier | `/items[at0088]` | | `date_time_received` | `timestamptz` | yes | Date/time received | `/items[at0034]` | | `sampling_context`
`sampling_context_code`
`sampling_context_system`
`sampling_context_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Sampling context | `/items[at0008]` | | `collection_method`
`collection_method_code`
`collection_method_system`
`collection_method_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Collection method | `/items[at0007]` | | `collection_description` | `text` | yes | Collection description | `/items[at0079]` | | `source_site`
`source_site_code`
`source_site_system`
`source_site_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Source site | `/items[at0087]` | | `collection_date_time` | `timestamptz` | yes | Collection date/time | `/items[at0015]` | | `hazard_warning`
`hazard_warning_code`
`hazard_warning_system`
`hazard_warning_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Hazard warning | `/items[at0005]` | | `collection_setting`
`collection_setting_code`
`collection_setting_system`
`collection_setting_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Collection setting | `/items[at0067]` | | `specimen_collector_identifier_value`
`specimen_collector_identifier_system` | text, text
`text`, `text` | yes | Specimen collector identifier | `/items[at0070]` | | `number_of_containers` | `integer` | yes | Number of containers | `/items[at0080]` | | `parent_specimen_identifier_value`
`parent_specimen_identifier_system` | text, text
`text`, `text` | yes | Parent specimen identifier | `/items[at0003]` | | `specimen_quality_issue`
`specimen_quality_issue_code`
`specimen_quality_issue_system`
`specimen_quality_issue_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Specimen quality issue | `/items[at0042]` | | `adequacy_for_testing`
`adequacy_for_testing_code`
`adequacy_for_testing_system`
`adequacy_for_testing_valueset_id` | coded text
`text`, `text`, `text`, `text` | yes | Adequacy for testing | `/items[at0041]` | | `comment` | `text` | yes | Comment | `/items[at0045]` | ## Constraints ```sql check ((specimen_type_code is null and specimen_type_system is null and specimen_type_valueset_id is null) or (specimen_type is not null and specimen_type_code is not null and specimen_type_system is not null and specimen_type_valueset_id is not null)) check (laboratory_specimen_identifier_system is null or laboratory_specimen_identifier_value is not null) check (external_identifier_system is null or external_identifier_value is not null) check ((sampling_context_code is null and sampling_context_system is null and sampling_context_valueset_id is null) or (sampling_context is not null and sampling_context_code is not null and sampling_context_system is not null and sampling_context_valueset_id is not null)) check ((collection_method_code is null and collection_method_system is null and collection_method_valueset_id is null) or (collection_method is not null and collection_method_code is not null and collection_method_system is not null and collection_method_valueset_id is not null)) check ((source_site_code is null and source_site_system is null and source_site_valueset_id is null) or (source_site is not null and source_site_code is not null and source_site_system is not null and source_site_valueset_id is not null)) check ((hazard_warning_code is null and hazard_warning_system is null and hazard_warning_valueset_id is null) or (hazard_warning is not null and hazard_warning_code is not null and hazard_warning_system is not null and hazard_warning_valueset_id is not null)) check ((collection_setting_code is null and collection_setting_system is null and collection_setting_valueset_id is null) or (collection_setting is not null and collection_setting_code is not null and collection_setting_system is not null and collection_setting_valueset_id is not null)) check (specimen_collector_identifier_system is null or specimen_collector_identifier_value is not null) check (number_of_containers is null or number_of_containers >= 0) check (parent_specimen_identifier_system is null or parent_specimen_identifier_value is not null) check ((specimen_quality_issue_code is null and specimen_quality_issue_system is null and specimen_quality_issue_valueset_id is null) or (specimen_quality_issue is not null and specimen_quality_issue_code is not null and specimen_quality_issue_system is not null and specimen_quality_issue_valueset_id is not null)) check ((adequacy_for_testing_code is null and adequacy_for_testing_system is null and adequacy_for_testing_valueset_id is null) or (adequacy_for_testing is not null and adequacy_for_testing_code is not null and adequacy_for_testing_system is not null and adequacy_for_testing_valueset_id is not null)) ``` ## References | Columns | Target | On delete | |---|---|---| | `specimen_type_valueset_id, specimen_type_code, specimen_type_system, specimen_type` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `sampling_context_valueset_id, sampling_context_code, sampling_context_system, sampling_context` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `collection_method_valueset_id, collection_method_code, collection_method_system, collection_method` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `source_site_valueset_id, source_site_code, source_site_system, source_site` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `hazard_warning_valueset_id, hazard_warning_code, hazard_warning_system, hazard_warning` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `collection_setting_valueset_id, collection_setting_code, collection_setting_system, collection_setting` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `specimen_quality_issue_valueset_id, specimen_quality_issue_code, specimen_quality_issue_system, specimen_quality_issue` | [`valueset_code`](/docs/tables/valueset_code) | restrict | | `adequacy_for_testing_valueset_id, adequacy_for_testing_code, adequacy_for_testing_system, adequacy_for_testing` | [`valueset_code`](/docs/tables/valueset_code) | restrict | ## Referenced by - [`investigation_screening_specific_investigation_additiona_45e74e`](/docs/tables/investigation_screening_specific_investigation_additiona_45e74e) via `specimen_id` - [`laboratory_test_result_specimen_detail`](/docs/tables/laboratory_test_result_specimen_detail) via `specimen_id` - [`specimen_structured_source_site`](/docs/tables/specimen_structured_source_site) via `specimen_id` - [`specimen_specimen_collector_details`](/docs/tables/specimen_specimen_collector_details) via `specimen_id` - [`specimen_container_details`](/docs/tables/specimen_container_details) via `specimen_id` - [`specimen_digital_representation`](/docs/tables/specimen_digital_representation) via `specimen_id` - [`specimen_container_contents`](/docs/tables/specimen_container_contents) via `specimen_id` - [`specimen_summary_specimen_details`](/docs/tables/specimen_summary_specimen_details) via `specimen_id` ## Child tables 4 tables hang off `specimen`, one row per repetition. ### `specimen_structured_source_site` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `specimen_id` | `uuid` → [`specimen`](/docs/tables/specimen) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `anatomical_location_id` | `uuid` | yes | — | — | | `anatomical_location_circle_id` | `uuid` | yes | — | — | | `anatomical_location_relative_id` | `uuid` | yes | — | — | #### Constraints ```sql check (num_nonnulls(anatomical_location_id, anatomical_location_circle_id, anatomical_location_relative_id) = 1) ``` #### Unique - `specimen_id, position` #### References | Columns | Target | On delete | |---|---|---| | `specimen_id` | [`specimen`](/docs/tables/specimen) | cascade | | `anatomical_location_id` | [`anatomical_location`](/docs/tables/anatomical_location) | no action | | `anatomical_location_circle_id` | [`anatomical_location_circle`](/docs/tables/anatomical_location_circle) | no action | | `anatomical_location_relative_id` | [`anatomical_location_relative`](/docs/tables/anatomical_location_relative) | no action | #### Indexes - `specimen_structured_source_site_anatomical_location_id_idx` on `anatomical_location_id` - `specimen_structured_source_site_anatomical_location_circ_21cf7d` on `anatomical_location_circle_id` - `specimen_structured_source_site_anatomical_location_rela_ce854e` on `anatomical_location_relative_id` ### `specimen_specimen_collector_details` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `specimen_id` | `uuid` → [`specimen`](/docs/tables/specimen) | 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 - `specimen_id, position` #### References | Columns | Target | On delete | |---|---|---| | `specimen_id` | [`specimen`](/docs/tables/specimen) | cascade | | `organization_id` | [`organization`](/docs/tables/organization) | no action | | `person_id` | [`person`](/docs/tables/person) | no action | #### Indexes - `specimen_specimen_collector_details_organization_id_idx` on `organization_id` - `specimen_specimen_collector_details_person_id_idx` on `person_id` ### `specimen_container_details` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `specimen_id` | `uuid` → [`specimen`](/docs/tables/specimen) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `specimen_container_id` | `uuid` | no | Container details | `/items[at0085]` | #### Unique - `specimen_id, position` - `specimen_id, specimen_container_id` #### References | Columns | Target | On delete | |---|---|---| | `specimen_id` | [`specimen`](/docs/tables/specimen) | cascade | | `specimen_container_id` | [`specimen_container`](/docs/tables/specimen_container) | no action | #### Indexes - `specimen_container_details_specimen_container_id_idx` on `specimen_container_id` ### `specimen_digital_representation` Child table — one row per repetition, deleted with its parent. | Column | Type | Null | Description | Source | |---|---|---|---|---| | `id` | `uuid primary key` | no | Primary key. | — | | `specimen_id` | `uuid` → [`specimen`](/docs/tables/specimen) | no | — | — | | `position` | `integer` | no | Order of this row within its parent, from zero. | — | | `attachment_id` | `uuid` | no | Digital representation | `/items[at0096]` | #### Unique - `specimen_id, position` - `specimen_id, attachment_id` #### References | Columns | Target | On delete | |---|---|---| | `specimen_id` | [`specimen`](/docs/tables/specimen) | cascade | | `attachment_id` | [`attachment`](/docs/tables/attachment) | restrict | #### Indexes - `specimen_digital_representation_attachment_id_idx` on `attachment_id` ## Value sets | Value set | Codes | |---|---| | `org.openehr::openEHR-EHR-CLUSTER.specimen.v1/adequacy_for_testing` | 3 | | `org.openehr::openEHR-EHR-CLUSTER.specimen.v1/specimen_quality_issue` | 10 |