Schema reference / Tables / view MDX source
advance_care_directive
A framework to communicate the preferences of an individual for future medical treatment and care.
A framework to communicate the preferences of an individual for future medical treatment and care.
Purpose. To record the preferences of an individual for future medical treatment and care.
Source
| Model | Leg | Role |
|---|---|---|
openEHR-EHR-EVALUATION.advance_care_directive.v2 | 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. | — |
type_of_directivetype_of_directive_codetype_of_directive_systemtype_of_directive_valueset_id | coded texttext, text, text, text | yes | Type of directive | /data[at0001]/items[at0005] |
statusstatus_codestatus_systemstatus_valueset_id | coded texttext, text, text, text | yes | Status | /data[at0001]/items[at0004] |
description | text | yes | Description | /data[at0001]/items[at0006] |
conditioncondition_codecondition_systemcondition_valueset_id | coded texttext, text, text, text | yes | Condition | /data[at0001]/items[at0007] |
comment | text | yes | Comment | /data[at0001]/items[at0038] |
valid_period_start | timestamptz | yes | Valid period start | /protocol[at0010]/items[at0053] |
valid_period_end | timestamptz | yes | Valid period end | /protocol[at0010]/items[at0054] |
review_due_date | timestamptz | yes | Review due date | /protocol[at0010]/items[at0056] |
last_updated | timestamptz | yes | Last updated | /protocol[at0010]/items[at0055] |
mandate | text | yes | Mandate | /protocol[at0010]/items[at0027] |
digital_representation | uuid | yes | Digital representation | /protocol[at0010]/items[at0060] |
Constraints
check ((type_of_directive_code is null and type_of_directive_system is null and type_of_directive_valueset_id is null) or (type_of_directive is not null and type_of_directive_code is not null and type_of_directive_system is not null and type_of_directive_valueset_id is not null))
check ((status_code is null and status_system is null and status_valueset_id 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 ((condition_code is null and condition_system is null and condition_valueset_id is null) or (condition is not null and condition_code is not null and condition_system is not null and condition_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 |
type_of_directive_valueset_id, type_of_directive_code, type_of_directive_system, type_of_directive | valueset_code | restrict |
status_valueset_id, status_code, status_system, status | valueset_code | restrict |
condition_valueset_id, condition_code, condition_system, condition | valueset_code | restrict |
digital_representation | attachment | restrict |
Referenced by
advance_care_directive_witnessviaadvance_care_directive_idadvance_care_directive_directive_locationviaadvance_care_directive_id
Indexes
advance_care_directive_form_id_idxonform_idadvance_care_directive_digital_representation_idxondigital_representation
Child tables
2 tables hang off advance_care_directive, one row per repetition.
advance_care_directive_witness
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|---|---|---|---|
id | uuid primary key | no | Primary key. | — |
advance_care_directive_id | uuid → advance_care_directive | no | — | — |
position | integer | no | Order of this row within its parent, from zero. | — |
person_id | uuid | no | Witness | /protocol[at0010]/items[at0025] |
Unique
advance_care_directive_id, positionadvance_care_directive_id, person_id
References
| Columns | Target | On delete |
|---|---|---|
advance_care_directive_id | advance_care_directive | cascade |
person_id | person | no action |
Indexes
advance_care_directive_witness_person_id_idxonperson_id
advance_care_directive_directive_location
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|---|---|---|---|
id | uuid primary key | no | Primary key. | — |
advance_care_directive_id | uuid → advance_care_directive | no | — | — |
position | integer | no | Order of this row within its parent, from zero. | — |
location | text | yes | Location | /protocol[at0010]/items[at0058]/items[at0030] |
copy_holder | uuid | yes | Copy holder | /protocol[at0010]/items[at0058]/items[at0059] |
Unique
advance_care_directive_id, position
References
| Columns | Target | On delete |
|---|---|---|
advance_care_directive_id | advance_care_directive | cascade |
copy_holder | person | no action |
Indexes
advance_care_directive_directive_location_copy_holder_idxoncopy_holder
Value sets
| Value set | Codes |
|---|---|
org.openehr::openEHR-EHR-EVALUATION.advance_care_directive.v2/status | 3 |