Image capture for case management

Really hoping I have missed something and there is a way to do this or have someone at least confirm for me that it is or isn't possible?

Is there a way to capture an image to case management so that I can then view it in a follow-up form?
I see there is a similar post about this here:

or

For each unique case when I bring up a follow-up form, on that follow-up form I would like to display a QR code that is unique to that person?
These cases would be created via the API.

Any info or help would be greatly appreciated!

@erobinson
@Mazz
@Norman_Hooper
@Ethan_Soergel
@Simon_Kelly

VERY good questions Calvin

I know that I had an issue with displaying collected images on a follow up form. I am not sure if at all possible. Typically speaking multimedia needs to be part of the application configuration.

Displaying QR Codes: I know we can scan them, but not sure we can generate them in app in a QR format. only clear text or encrypted as far as i know.

I wonder if the real gurus have a solution for these requirements

Thanks for the response @Mazz, you kinda confirming what I have found. Hoping that there might be some sorta work around, probably not there for a reason im sure.

I see there is a depreciated feature flag (Multimedia Case Properties) that comes with a warning (This feature flag is being removed. Do not add any new projects to this list.) Which makes me very reluctant to use it.

I tried it out anyway and it allows you to save a picture to a case property.. However when loading the followup form and having set the default value of the image capture question to that case property no picture is displayed. So not sure that its going to do what I was hoping.

Hoping one of the gurus can give us some more info.. :slight_smile:

@Norman_Hooper
@Ethan_Soergel
@Simon_Kelly

Another line of thought... are there any options that integrate with CommCare for photo collection/display?

@Norman_Hooper
@Ethan_Soergel
@Simon_Kelly

@Calvin as you've discovered you can save images to cases as attachments but we've never built out a way to get those images back to the device. The main reason for this is that downloading all the images for all the case on the device could require a large amount of data and since CC is an 'offline first' app, it wouldn't really make sense to download them just in time.

One option which I have not tested is to use Markdown to render the image from a link. You could use normal form attachments to upload the image and save a reference to the image as a case property:

Hidden value in the form to construct the correct URL

concat('https://www.commcarehq.org/a/', instance('commcaresession')/session/user/data/commcare_project, '/api/form/attachment/', /data/meta/instanceID, '/', /data/picture_upload_question)

Markdown in a form or case list to display the image
Assuming the case property is called pic_link.

concat('![pic](', ./pic_link ,')')

Bear in mind that this will likely re-download the image every time it is displayed. Also, the image will be whatever size it was uploaded as.


Re QR codes, we do not have the ability to generate them in the app.

are there any options that integrate with CommCare for photo collection/display?

I'm not aware of anything currently available.

1 Like

Hi @Simon_Kelly,

Thank you so much for your response and confirming how it works. That very much makes sense regarding the download of a large amount of data and CC being an 'offline first' app.

Thank you for the example with the URL link, unfortunately that would require the user to be online via mobile network to download the image and in most cases they wont have a connection. I really appreciate the idea though.

What we are thinking is creating an external small app that stores all the images linked to a GUID. This GUID would be in the profile of the participant in the CC mobile app and then Using the "Android App Callout" question to reference it. Then when a mobile worker goes into the field they just make sure they have pulled down all the images to the external app with their unique GUIDs. Hope that makes sense.
https://confluence.dimagi.com/display/commcarepublic/Integrating+your+custom+Android+applications+with+CommCare
If this works like I think it does, we could possibly pass a unique GUID from commcare to the external photo app, take a picture which then gets stored with that GUID. Then later we can use that same GUID to call up that external photo app to display the picture associated with that GUID

Do you think that could work?

@erobinson
@Mazz
@Norman_Hooper
@Ethan_Soergel
@Simon_Kelly

you still have the requirement to connect to the internet at the time of either display like Simon said, or at the time where the images are being dumped onto the device.
an app call out to the gallery app might work if you can pass the path to the image. if not, then it wouldn't know which image to display.

the images that CommCare collect get stored with the caseid as part of the filename if I remember correctly - have not done this in a long time.

The issue with multimedia being used is just on the android app. it also affects Power BI.

I have had a really hard time getting Power BI to use the images that were collected because of the "s" in HTTPS. I couldn't figure out a way to authenticate the report during runtime.

basically, I had to do something very similar. download the images in bulk to a network resource that was made available to the report. it worked, but not ideal at all.

1 Like

Yes, it should be possible to make something like that work.

1 Like