Using external QR code libraries through CHT Extension Lib

Is it currently possible to use for example this through the extension libraries feature?

I do not have a solid answer here. On one hand, it should be possible to include a dependency like this in your extension-lib, (particularly if you use webpack to wrap everything up). Then your code/dependency should be executing in the browser context for the user. The main concern I would have is that the extension-lib function “output” needs to be synchronous (which I guess would not be the case when you are trying to scan a QR code).

@Jennifer_Quesada I know we were recently discussing the possibility of reading QR codes in forms. Do you remember the conclusion we came to? I cannot remember off the top of my head if the barcode widget actually works with CHT/Enekto… :man_facepalming: Another thing I remember being mentioned was using the android-app-launcher to pop into a separate app to collect the QR code info and then bring that back to the form. This seems like the most promising approach if the normal barcode widget does not actually work… (Then if you had extra logic you needed to do with the data from the QR code, you could still have an extension-lib function that took the QR code data as input and did whatever calculations you needed on top of it…)

1 Like

@Jennifer_Quesada , @michael , @jkuester

To give more context to my initial request, our goal is to capture the client health card IDs via QR code utilizing CHV routine visits.

So during a routine visit, a CHV would open a client’s contact form, click on the external QR code and automatically capture the ID. I see our use case very similar to this one and so I decided to give a try using this XLS.

However, I cannot install the app used in the demo on my device because it is no longer supported. I therefore used another scanner app (com.gamma.scan) and updated the example xls on line 53. While clicking the “Launch App” button, the scanner app did not open.

Is there any other configuration that I need to setup?

I have a question about the use case, but this shouldn’t affect the technical side of things, I’ll let @Jennifer_Quesada / @jkuester provide some advice there.

So you’d have this on both your contact create and contact edit forms? Is the “client health card ID” unique to the patient… or unique to the card itself, for example… would a patient ever need to have multiple health card IDs associated to them or is this ID a unique identifier for the patient (like a national ID)? Is it just a several digit numeric or alphanumeric code?

Hi @michael , this would be in both create and edit forms. The ID will be unique to the client and it will be numeric.

1 Like

This is part of the ODK Collect app, and sadly not included in Enketo.

Correct, the Android App Launcher is a form widget that opens third-party apps with public Android’s intents.

The third-party app defines how other apps interact with it by using public intents. Imagine Intents like something to configure that allows communication between 2 parties. This configuration relies entirely on the third-party app.

I suggest to find an open source app, then it’s easier to look at their code and find the intent configuration. Another option is to contact com.gamma.scan team and get that information from them. Because these are third-party apps, I recommend to also check their privacy policy to make sure they fit to your project needs.

1 Like