Schema reference / Tables / view MDX source
social_network
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 | 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_statuspartnership_status_codepartnership_status_systempartnership_status_valueset_id | coded texttext, 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
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 | cascade |
form_id, form_block_id | form_block | cascade |
partnership_status_valueset_id, partnership_status_code, partnership_status_system, partnership_status | valueset_code | restrict |
Referenced by
social_network_networkviasocial_network_id
Indexes
social_network_form_id_idxonform_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 | 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
social_network_id, position
References
| Columns | Target | On delete |
|---|---|---|
social_network_id | social_network | cascade |
organization_id | organization | no action |
person_id | person | no action |
Indexes
social_network_network_organization_id_idxonorganization_idsocial_network_network_person_id_idxonperson_id