Hello All,
We have a requirement to upload and store documents (PDFs, scans etc) for patients/persons. These documents will be clinical most of the times, but may also have non-clinical documents like Insurance details. Patients often bring past documents before procedures which need to be uploaded (old diagnostic report, vaccination details, or sometimes even a clinical note etc) - meaning these documents didn’t origin at the hospital/clinic of service, and potentially will not have references (practitioner, location etc) in the OMRS.
We are considering leveraging a model for storing the metadata for such documents in FHIR Document Reference model. OpenMRS platform, does not have a structured way to record and manage documents with metadata, so we believe it will be beneficial for all if we can agree on a common model and source.
Below is a suggested DB model for the same.
Note:
document_reference.person_id- reference is to a person, not patient. We want to keep this option open.document_reference.master_identifier- this has been removed in R6. But this is an important document attribute (e.g. insurance policy no) for subsequent searches. When we move to R6, I think we can merge this with identifiers list for some “system”.document_reference.date_created- will translate toDocumentReference.dateanddocument_reference.date_startedanddocument_reference.date_endedwill form the basis for “DocumentReference.period” (not in R4, but present in R6 - and for now, we would this as extension)document_reference.order_id- links to the order (service request) that may have resulted this document. (e.g. a Mental Health Assessment Report - classified as super private). This maps to FHIR R6DocumentReference.basedOnwhich isnt there in R4. So we are going to use extension for this.document_reference.encounter_id- links to FHIRDocumentReference.context.encounter. The structure has changed in R6, where its a simple reference. Anyways, we are suggesting only encounter reference, so this should be absolutely fine.
The content is separated out to different table. Maybe there is a case, where documents can be in different format and content type. So suggests FHIR as well.
document_reference_content.content_typestores the mimeType (e.g. application/pdf, image/jpeg etc).document_reference_content.content_url- stores the actual reference URL where the document is physically stored.
There are certain other attributes we may require and I don’t know if an Attribute Type model for DocumentReference is preferrable. e.g. issuing authority - some may relate that to FHIR DocumentReference.custodian, but often the EMR system would not have the such referential relations setup, and just capturing the “name” of the issuer is enough within the clinic/hospital.
Please let us know your thoughts/feedbacks and ideas.
erDiagram
document_reference ||--o{ document_reference_content : "has"
document_reference }o--o| concept : "type_concept"
document_reference }o--o| concept : "security_concept"
document_reference }o--o| provider : "author"
document_reference }o--o| location : "location"
document_reference }o--o| encounter : "encounter"
document_reference }o--o| orders : "order"
document_reference }o--o| person : "person"
document_reference }o--|| users : "creator"
document_reference }o--o| users : "changed_by"
document_reference_content }o--|| users : "creator"
document_reference_content }o--o| users : "changed_by"
document_reference_content }o--o| users : "voided_by"
document_reference {
int id PK "auto_increment"
char(38) uuid UK "not null"
varchar(100) master_identifier
varchar(50) status "not null"
varchar(50) doc_status
int type_concept_id FK
datetime date_started
datetime date_ended
int author_id FK
int location_id FK
text description
int security_concept_id FK
int encounter_id FK
int person_id FK
int order_id FK
int creator FK "not null"
datetime date_created "not null"
int changed_by FK
datetime date_changed
}
document_reference_content {
int id PK "auto_increment"
int document_reference_id FK "not null"
varchar(255) content_type
varchar(512) content_url
boolean voided "default false, not null"
int creator FK "not null"
datetime date_created "not null"
int changed_by FK
datetime date_changed
int voided_by FK
datetime date_voided
varchar(255) void_reason
char(38) uuid UK "not null"
}
concept {
int concept_id PK
}
provider {
int provider_id PK
}
location {
int location_id PK
}
encounter {
int encounter_id PK
}
orders {
int order_id PK
}
person {
int person_id PK
}
users {
int user_id PK
}
@ibacher @dkayiwa @burke @mksd @mohant @akhilmalhotra @grace