document_reference
Maximal set merged from: http://hl7.org/fhir/us/core/StructureDefinition/us-core-adi-documentreference, http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference
Maximal set merged from: http://hl7.org/fhir/us/core/StructureDefinition/us-core-adi-documentreference, http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference
Source
| Model | Leg | Role |
|---|
us-core-adi-documentreference+us-core-documentreference | FHIR | defines this table |
Columns
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | DocumentReference.id | — |
created_at | timestamptz | no | Row creation timestamp. | — |
updated_at | timestamptz | no | Row update timestamp; maintained by the application. | — |
created_by | text | no | Actor who created the row. | — |
updated_by | text | no | Actor who last updated the row. | — |
master_identifier_value
master_identifier_system | text, text
text, text | yes | Master Version Specific Identifier | DocumentReference.masterIdentifier |
identifier_value
identifier_system | text, text
text, text | yes | Other identifiers for the document | DocumentReference.identifier |
status | text | yes | current | superseded | entered-in-error | DocumentReference.status |
doc_status | text | yes | preliminary | final | amended | entered-in-error | DocumentReference.docStatus |
type
type_code
type_system
type_valueset_id | coded text
text, text, text, text | yes | Kind of document (LOINC if possible) | DocumentReference.type |
subject_device_id
subject_patient_id
subject_practitioner_id | uuid, uuid, uuid
uuid, uuid, uuid | yes | Who/what is the subject of the document | DocumentReference.subject |
date | timestamptz | yes | When this document reference was created | DocumentReference.date |
authenticator_organization_id
authenticator_practitioner_id
authenticator_practitioner_role_id | uuid, uuid, uuid
uuid, uuid, uuid | yes | Who/what authenticated the document | DocumentReference.authenticator |
custodian_id | uuid | yes | Organization which maintains the document | DocumentReference.custodian |
description | text | yes | Human-readable description | DocumentReference.description |
context_period_start
context_period_end | timestamptz, timestamptz
timestamptz, timestamptz | yes | Time of service that is being documented | DocumentReference.context.period |
Constraints
check (master_identifier_system is null or master_identifier_value is not null)
check (identifier_system is null or identifier_value is not null)
check ((type is null and type_code is null and type_system is null and type_valueset_id is null) or (type is not null and type_code is not null and type_system is not null and type_valueset_id is not null))
check (num_nonnulls(subject_device_id, subject_patient_id, subject_practitioner_id) <= 1)
check (num_nonnulls(authenticator_organization_id, authenticator_practitioner_id, authenticator_practitioner_role_id) <= 1)
check (context_period_start is null or context_period_end is null or context_period_start <= context_period_end)
References
Referenced by
Indexes
document_reference_subject_device_id_idx on subject_device_iddocument_reference_subject_patient_id_idx on subject_patient_iddocument_reference_subject_practitioner_id_idx on subject_practitioner_iddocument_reference_authenticator_organization_id_idx on authenticator_organization_iddocument_reference_authenticator_practitioner_id_idx on authenticator_practitioner_iddocument_reference_authenticator_practitioner_role_id_idx on authenticator_practitioner_role_iddocument_reference_custodian_id_idx on custodian_id
Child tables
7 tables hang off document_reference, one row per repetition.
document_reference_other_identifier
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
identifier_value | text | no | — | — |
identifier_system | text | yes | — | — |
identifier_use | text | yes | — | — |
valid_from | timestamptz | yes | — | — |
valid_until | timestamptz | yes | — | — |
Unique
document_reference_id, identifier_system, identifier_value
References
document_reference_category
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
category
category_code
category_system | text, text, text
text, text, text | yes | Categorization of document | DocumentReference.category |
Constraints
check ((category_code is null and category_system is null) or (category_code is not null and category_system is not null))
References
Indexes
document_reference_category_document_reference_id_idx on document_reference_id
document_reference_author
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
device_id
organization_id
patient_id
practitioner_id
practitioner_role_id
related_person_id | uuid, uuid, uuid, uuid, uuid, uuid
uuid, uuid, uuid, uuid, uuid, uuid | yes | Who and/or what authored the document | DocumentReference.author |
Constraints
check (num_nonnulls(device_id, organization_id, patient_id, practitioner_id, practitioner_role_id, related_person_id) = 1)
References
Indexes
document_reference_author_document_reference_id_idx on document_reference_iddocument_reference_author_device_id_idx on device_iddocument_reference_author_organization_id_idx on organization_iddocument_reference_author_patient_id_idx on patient_iddocument_reference_author_practitioner_id_idx on practitioner_iddocument_reference_author_practitioner_role_id_idx on practitioner_role_iddocument_reference_author_related_person_id_idx on related_person_id
document_reference_relates_to
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
code | text | yes | replaces | transforms | signs | appends | DocumentReference.relatesTo.code |
target_id | uuid | yes | Target of the relationship | DocumentReference.relatesTo.target |
References
Indexes
document_reference_relates_to_document_reference_id_idx on document_reference_iddocument_reference_relates_to_target_id_idx on target_id
document_reference_security_label
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
security_label
security_label_code
security_label_system | text, text, text
text, text, text | yes | Document security-tags | DocumentReference.securityLabel |
Constraints
check ((security_label_code is null and security_label_system is null) or (security_label_code is not null and security_label_system is not null))
References
Indexes
document_reference_security_label_document_reference_id_idx on document_reference_id
document_reference_content
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
attachment | uuid → attachment | yes | Where to access the document | DocumentReference.content.attachment |
format
format_code
format_system | text, text, text
text, text, text | yes | Format/content rules for the document | DocumentReference.content.format |
Constraints
check ((format_code is null and format_system is null) or (format_code is not null and format_system is not null))
References
Indexes
document_reference_content_document_reference_id_idx on document_reference_iddocument_reference_content_attachment_idx on attachment
document_reference_encounter
Child table — one row per repetition, deleted with its parent.
| Column | Type | Null | Description | Source |
|---|
id | uuid primary key | no | Primary key. | — |
document_reference_id | uuid → document_reference | no | — | — |
encounter_id | uuid | no | Context of the document content | DocumentReference.context.encounter |
Unique
document_reference_id, encounter_id
References
Indexes
document_reference_encounter_encounter_id_idx on encounter_id
Value sets
| Value set | Codes |
|---|
http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1115.41 | 0 |