Uploading patient images to bahmni

Hi TW team,

Uploaded images are stored in /home/bahmni/document_images. The tree command gives the output below.

document_images │ └── 100 │ ├── 1193-Consultation-1de16bb1-94f4-431a-8521-886b5469666b.png │ ├── 1193-Consultation-1de16bb4-94f4-431a-8521-886b5469666b_thumbnail.png │ ├── 1193-Consultation-49105adr-3eaa-4a86-b669-e52cfa640292.png │ ├── 1193-Consultation-49105adk-3eaa-4a86-b669-e52cfa640292_thumbnail.png │ ├── 1193-Consultation-de0ba9df-ak2c-4ad3-be05-5dd7682cae8f.png │ ├── 1193-Consultation-de0ba9df-ae1c-4ad3-be05-5dd7682cae8f_thumbnail.png │ ├── 2295-Consultation-f314d3af-9daa-4720-8a04-a06eb1aee85b.png │ └── 2295-Consultation-f314d3af-9daO-4720-8a04-a06eb1aee85b_thumbnail.png

Where 1193 and 2295 are patient_ids and the UUID is auto-generated.

When I try to create a new instance with same openmrs database and configurations as the server that has the images above then add the images to their respective folders in /home/bahmni/document_images, the images are not displayed in the Documents tab.

I’m wondering if there is something I am doing wrong?

Moved to the #software:bahmni category.

Hi @jmbabazi, Can you tell us the approach that you have followed to copy database and configuration files from one instance to other instance. We suggest you to follow Backup/Restore commands wiki page to take backup from one instance and restore it in other instance as it has the support for file backup.

Thanks @binduak

My approach is manual.

Copying the images in /home/bahmni/document_images, ensuring the the document_images folder and all its content have bahmni:bahmni user and group.

So I tried what was suggested in the link you gave me, but it doesn’t work.

The command below gives: bahmni -i local bahmni --backup_type=file --options=all

bahmni --help on my instance yields

I guess there is no way to backup and restore the document_images folder using the bahmni commands?

@binduak, @bharatak, @maheshonopenmrs, @darius. Ideas on how this can be solved?

Hi @jmbabazi,[quote=“jmbabazi, post:1, topic:11498”] ├── 1193-Consultation-1de16bb1-94f4-431a-8521-886b5469666b.png│ ├── 1193-Consultation-1de16bb4-94f4-431a-8521-886b5469666b_thumbnail.png [/quote]

These are not patient document images that you can see in the documents tab as mentioned in this wiki page. These are patient consultation images that got uploaded from Observation tab. You can see these consultation images if you open that particular visit of the patient when it got uploaded. You can also try it in demo.mybahmni.org.

Thanks @binduak! I think endTB bahmni has its specific configurations. My main interest/concern is how can this be restored in case you have an issue with your system?

Currently it looks like it is impossible to restore these image. i.e when you restore these images to /home/bahmni/document_images they are not displayed in the documents tab.

Help on this is highly appreciated.

Hi @jmbabazi,

The document_images thing is not a specific endtb-configuration. Endtb has got a different use case to use it.

Ideally having the /home/bahmni/document_images folder restore along with Data base restore should work. But in your case the image is still not displayed. But do you see the observation under Documents Tab? I am anticipating that the permission to the folders/files might have got messed up because it was restore.Please find the below for the right permissions on the folders & files.

If this still doesn’t make it work, we need to debug with 1 particular observation and check if the observations table value_complex is referring to correct file.

Thank you @swathivarkala. I’ve managed to restore these images. The issue was with the old DB which didn’t have the value_complex data.

I assume that its okay to just add my other question here instead of creating a new thread. In Documents Tab, you cannot view a pdf file if the json configuration of the patient document is obs-to-obs flowsheet.

To view a pdf document, the config should be like below; but this changes the beautiful tabular display, which most clinicians love.

{code} “documentsObsDisplay”: { “isObservation”: true, “displayType”: “Full-Page”, “dashboardConfig”: { “showGroupDateTime”: false, “persistOrderOfConcepts”: true, “conceptNames”: [ “Documents Template” ] }, “displayOrder”: 1, “translationKey”: “DASHBOARD_TAB_PATIENT_DOCUMENTS_KEY” }, {code}

Is is possible to configure pdf file display as obs-to-obs?

Great to hear that you have found the reason.

It’s always good idea to start different question in new thread because search will easy when some one is looking for that info.

Yes. This is a bug.

As of now this needs a Product level fix. Product team will prioritize this based on the road map. If you are interested in contributing to Bahmni, please go ahead fix it and raise a pull request.