service
A simple health-related service or activity delivered by a clinician, organisation or agency.
A simple health-related service or activity delivered by a clinician, organisation or agency.
Purpose. To record details about a simple health-related service or activity delivered by a clinician, organisation or agency.
Source
| Model | Leg | Role |
|---|
openEHR-EHR-ACTION.service.v1 | openEHR | defines this table |
Columns
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
form_id | uuid → 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. | — |
service_name
service_name_code
service_name_system
service_name_valueset_id | coded text
text, text, text, text | yes | Service name | /description[at0001]/items[at0011] |
service_type
service_type_code
service_type_system
service_type_valueset_id | coded text
text, text, text, text | yes | Service type | /description[at0001]/items[at0014] |
description | text | yes | Description | /description[at0001]/items[at0013] |
planned_date_time | timestamptz | yes | Planned date/time | /description[at0001]/items[at0032] |
scheduled_date_time | timestamptz | yes | Scheduled date/time | /description[at0001]/items[at0025] |
sequence | integer | yes | Sequence | /description[at0001]/items[at0021] |
reason | text | yes | Reason | /description[at0001]/items[at0012] |
comment | text | yes | Comment | /description[at0001]/items[at0028] |
requestor_identifier_value
requestor_identifier_system | text, text
text, text | yes | Requestor identifier | /protocol[at0015]/items[at0016] |
service_provider_identifier_value
service_provider_identifier_system | text, text
text, text | yes | Service provider identifier | /protocol[at0015]/items[at0018] |
Constraints
check ((service_name_code is null and service_name_system is null and service_name_valueset_id is null) or (service_name is not null and service_name_code is not null and service_name_system is not null and service_name_valueset_id is not null))
check ((service_type_code is null and service_type_system is null and service_type_valueset_id is null) or (service_type is not null and service_type_code is not null and service_type_system is not null and service_type_valueset_id is not null))
check (sequence is null or sequence >= 1)
check (requestor_identifier_system is null or requestor_identifier_value is not null)
check (service_provider_identifier_system is null or service_provider_identifier_value is not null)
Unique
References
| Columns | Target | On delete |
|---|
form_id | form | cascade |
form_id, form_block_id | form_block | cascade |
service_name_valueset_id, service_name_code, service_name_system, service_name | valueset_code | restrict |
service_type_valueset_id, service_type_code, service_type_system, service_type | valueset_code | restrict |
Referenced by
Indexes
service_form_id_idx on form_id
Child tables
3 tables hang off service, one row per repetition.
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
service_id | uuid → service | no | — | — |
position | integer | no | Order of this row within its parent, from zero. | — |
attachment_id | uuid | no | Multimedia representation | /description[at0001]/items[at0029] |
Unique
service_id, positionservice_id, attachment_id
References
Indexes
service_multimedia_representation_attachment_id_idx on attachment_id
service_requestor
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
service_id | uuid → service | no | — | — |
position | integer | no | Order of this row within its parent, from zero. | — |
organization_id | uuid | yes | — | — |
person_id | uuid | yes | — | — |
Constraints
check (num_nonnulls(organization_id, person_id) = 1)
Unique
References
Indexes
service_requestor_organization_id_idx on organization_idservice_requestor_person_id_idx on person_id
service_receiver
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
service_id | uuid → service | no | — | — |
position | integer | no | Order of this row within its parent, from zero. | — |
organization_id | uuid | yes | — | — |
person_id | uuid | yes | — | — |
Constraints
check (num_nonnulls(organization_id, person_id) = 1)
Unique
References
Indexes
service_receiver_organization_id_idx on organization_idservice_receiver_person_id_idx on person_id