documents


If there is patient data for this table the file for this export will be found in the extracted zip folder location under the filename of documents.csv

If there are non-patient data column elements that are not part of the designated record set they will be marked in the Comment's column for that data element

Description

Stores all of the digital documents that are connected to a patient.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id INT 10 0
notes.foreign_id Defined in XML R
procedure_result.document_id Defined in XML R

Surrogate id of the record used as the primary incrementing key

uuid BINARY 16 null

Binary of Unique User Identifier that is for both external reference to this entity and for future offline use.

type enum('file_url', 'blob', 'web_url') 8 null

Type of the document (e.g., ‘file_url’, ‘blob’, ‘web_url’)

size INT 10 null

Size of the document in bytes

date DATETIME 19 null

Date when the document was created

date_expires DATETIME 19 null

Date when the document expires and is no longer available.

url VARCHAR 255 null

URL of the document

thumb_url VARCHAR 255 null

URL of the document’s thumbnail

mimetype VARCHAR 255 null

MIME type of the document

pages INT 10 null

If the document is a multi-page format like tiff and has at least 1 page this will be 1 or greater,if a non-multi-page format this should be null or empty

owner INT 10 null
users.id Defined in XML R

Foreign key identifier to users of who initially persisted the document

revision TIMESTAMP 19 null

Timestamp of the last time the document was changed and persisted

foreign_id BIGINT 19 null
patient_data.pid Defined in XML R

The internal patient identifier

docdate DATE 10 null

Date (YYYY-MM-DD) logically associated with the document, e.g. when a picture was taken.

hash VARCHAR 255 null

Hash value of the document from when it was uploaded

list_id BIGINT 19 0
lists.id Defined in XML R

FK to lists.id associated with the document when the document is related to an issue

name VARCHAR 255 null

Name of the document. Populated since OpenEMR versions 6.0.0+

drive_uuid BINARY 16 null

UUID of the document’s drive. Empty in export

couch_docid VARCHAR 100 null

CouchDB document ID

couch_revid VARCHAR 100 null

CouchDB revision ID

storagemethod TINYINT 3 0

Storage method (0->Harddisk, 1->CouchDB)

path_depth TINYINT 3 1

Depth of path to use in the URL to find the document. Not applicable for CouchDB. . Empty in export.

imported TINYINT 3 0

Parsing status for CCR/CCD/CCDA importing

encounter_id BIGINT 19 0
form_encounter.encounter Defined in XML R

Encounter ID if tagged

encounter_check BIT 1 0

If an encounter is created while tagging (0 or 1)

audit_master_approval_status TINYINT 3 1

Approval status from audit_master table

audit_master_id INT 10 null

ID from the audit_master table

documentationOf VARCHAR 255 null

Used for CCDA and lab documents where the individual / contents of the documentation of a service event is recorded

encrypted TINYINT 3 0

Encryption status (0->No, 1->Yes)

document_data MEDIUMTEXT 16777215 null

Additional metadata concerning the document is stored here. CCDA/CDA documents store their validation log in this field and DICOM files store a JSON history of actions taken on the DICOM in this field

deleted BIT 1 0

Flag indicating if the document is deleted (0 or 1). If a file has been marked as deleted the underlying file stored in the file storage system is NOT included in data exports and is no longer available for retrieval

foreign_reference_id BIGINT 19 null

DB Unique identifier reference to another table record in the database. This is not unique in the document. The table that this record points to is in the foreign_reference_table

foreign_reference_table VARCHAR 40 null

Table associated with the foreign reference_id will be populated if foreign_reference_id is populated

Indexes

Constraint Name Type Sort Column(s)
PRIMARY Primary key Asc id
drive_uuid Must be unique Asc drive_uuid
foreign_id Performance Asc foreign_id
foreign_reference Performance Asc/Asc foreign_reference_id + foreign_reference_table
owner Performance Asc owner
revision Performance Asc revision
uuid Must be unique Asc uuid

Relationships