Adding Attachments to Upload & Store Documents (or Google Drive integration)

Hi,

Does DHIS2 have the functionality to upload and store external files at attachments within a data set? For example, if I’m capturing the date of when an application is received, and I also want to include a copy of the application as a PDF or Word/Excel document as evidence, is there a way to do that within the platform? Or if I am marking that an application is approved and I want other users to be able to view the approval letter, is that functionality available in the current version of DHIS2? I believe there is already a mechanism of attaching documents within the messaging system, but I want these attachments to be globally available to all users and linked to the specific data set.

We are keeping all these documents in Google Drive, so I guess if attachments are not possible, then perhaps there is a way to include a link to the document within the platform where the link to the document is the value within a data set? Or is there Google Drive integration with DHIS2 currently?

If this feature doesn’t currently exist, is this something in the pipeline for DHIS2 development? I could see other users having a use case for this function.

Cheers,
Nikhil

Hi @npatil55 ,

Yes, DHIS2 has the functionality to store files as part of a data set. Simply define your data elements with the “File” (or “Image”) value type. Please refer to this section of the documentation.

You can see an example of this on something like the “Project Management” data set on our play.dhis2.org demo instances:

I hope that helps.

Kind regards,
Phil

2 Likes

I didn’t know that too! ( : Thanks for the answer @phil! It should help in many implementations - thinking of EMIS as well!

hi @phil - yes! thank you!

1 Like

This was helpful, thank you! We see the images within the event in the Capture app. Can we access the photos from the user interface without going into the event? Like some sort of “File/Photo Gallery”? I didn’t see anything in Resources.

1 Like

@lnunez I’m not sure there is a direct way to list all the files/images uploaded to tracker since to access an event you’d first need to have access and then be able to preview/download image/file but it might have been possible to list only the files/images in the events the user has access to. I tried using the API but in the API the data element with file type showed value and some sort of id; for instance:

"createdAt": "2016-01-15T18:14:34.455",
"updatedAt": "2016-01-15T18:14:34.456",
"storedBy": "system",
"providedElsewhere": false,
"dataElement": "uf3svrmp8Oj",
"value": "csAhQpsk419"

The dataElement above is the Birth Certificate in the Child Program on a play instance.

I also tried to see if it’s possible to access this type of file using SQLView but couldn’t find a way to list all the birth certificates along with a link to the file. It could work with a more complex SQLView query that connects more than one table but this will require more testing and work.

Would you like to share the use case and why this is very important?

Thanks!

We ended up deciding to move forward as is, since the users can access the photos from the individual events. We figured one place that acts sort of like a gallery would make it easier to look up saved images, which it might, but is not necessary for our use case. Thank you!