Search for contacts using barcodes

Your Organization: Medic + I-TECH + Lighthouse Trust

Organization Type: NGO

What Other Organizations Would Benefit From This Feature: MoH

Describe the Feature: As a healthcare worker I want to search for clients in the CHT using barcodes so that I can correctly identify clients.

What “Pain Point” Does The Proposed Feature Address: [Is there an unmet need impacting patients, providers, managers, developers, etc?]
Searching for clients on the peoples tab using names is not preferred because some clients have the same the first name and surname. The other search approach available is by using national IDs which requires manual entry of a 16 digit alphanumeric code, a process that is prone to data entry errors.

Proposed Solution: [How you would like to solve the “pain point”? This is a starting point for conversation, and can be high-leveled / general.] Scan a barcode label to retrieve the national ID in order to search for clients in the app.

Do you have funding to cover external developers? No

Do You Have Resources (Designers, Developers, PMs) Available: Yes

Links To Supporting Information / Uploads: [feature specs or designs, examples of similar features etc]

Thanks so much for the feature request @mureithi !

Can you clarify your use case? I’m wondering if:

  • it is on a mobile handset in the CHT Android APK or a desktop browser?
  • it is for an online or offline user?
  • if you already have the barcode data entered and searchable, and just need need a way to search for the value?
  • it is on a mobile handset in the CHT Android APK or a desktop browser?

CHT Android APK installed on a tablet.

  • it is for an online or offline user?

Offline user

  • if you already have the barcode data entered and searchable, and just need need a way to search for the value?

We scan barcodes during client registration and now want to scan barcodes in the “Search” field from the CHT Android app.

The 4.4.1-FR-barcode feature release is available which supports search by barcode. Please reach out if you are interested in using this feature.

A few key considerations:

  • It works in Android Chrome, PWA, and CHT Android app
  • This feature is enabled by using can_use_barcode_scanner permission
  • This feature isn’t supported on desktops and in browsers older than Chrome/Wedview v90.
  • When clicking on the barcode icon to scan, the OS will open an option to take a picture or pick from the gallery
  • The user needs to grant permission to use the camera
  • Some browsers might not support all the barcode types
  • The DB Admin user doesn’t have access to this feature

Check out the PR for more details and videos of this feature in action. Learn more about Feature Releases in the docs.

1 Like

Hi @michael , I tested the PR but for me the barcode feature did not show up. The “About” page shows a message saying “For a better app experience, please contact your administrator or supervisor. Let them know to update cht-android”

Here’s what I did to launch the app on my phone, taking into account the dependencies for deploying CHT v4.4.1:

  1. Checked out the latest branch from cht-android to build the apk.
  2. Added CAN_USE_BARCODE_SCANNER permission in the manifest file.
  3. Ensured the chrome version I am using is 90+, webview version is 90+.


Hi @iesmail, thanks for trying out the new feature.

I would like to assist you in resolving the issue you are facing. Please clarify the following.

  1. Are you using an emulator or a real device (If you are using a real device, what is the make of the mobile phone?)
  2. What is the browser version you are using on your device ? (Please share the exact version displayed when you view App info )
  3. What CHT Android version are you using?

Hi @iesmail,

I recommend to take the app from an official release like v1.1.0-1 because the main branch is code under development.

Hi @Ben_Kiarie,

  1. I am using a real device. It’s a Samsung Galaxy F13.
  2. The chrome version is 122.0.6261.105
  3. For cht-android, I have used this tag → v1.1.1 Is this what you mean by cht-android version?

Hi @Jennifer_Quesada,

I used v1.1.1 which seems to be more recent than v1.1.0-1.

I have checked with the team. The v1.1.1 is a mistake and we are in the process of removing the tag to avoid future confusion. The correct official release is v1.1.0-1 and can be found in the home page of the GitHub repository. Apologies for the confusion it caused.

This isn’t an Android manifest permission but a CHT permission. The can_use_barcode_scanner permission should be added in the project’s ‘app_settings.json’ file under permissions section, then assign the user roles. For example:

"permissions": {
    "can_use_barcode_scanner": [
      "chw_supervisor",
      "chw"
    ],
}

After the user logins, the user should sync to get the latest configuration for the app.
If barcode icon still doesn’t display next to the search icon, please check the feedback docs in CouchDB, there should be errors related to the barcode.

Hi @Jennifer_Quesada,

I used the version you recommended and also added the barcode scanner permission in the app_settings but I am still seeing this error when I open the “About” page:

Thanks @iesmail

One more thing that you can try is this:

  • Update Google Play services - this app is usually available on all Android phones; here is the Play Store link.
    • The browser uses the Android OS to detect different barcode types; these types are packed in Google Play services

Source: Troubleshooting section from this comment.

If that still doesn’t fix it, do you have access to the feedback docs of your instance? You can look for something similar to Barcode Detector API... or Supported barcode formats... and that can give more information about the problem.

@Jennifer_Quesada , Google play services is up-to-date. I logged in as an admin to view the feedback docs but I did not find any.

Hi @iesmail

Thanks for getting back to us with the update.

I tried to reproduce your experience, and so far the feature is working for me. I made a video that hopefully will bring some ideas about your setup.

In this video, I have created an instance and upgraded to the feature release 4.4.1-FR-barcode-beta.1. I also use an Android 14 phone, while testing I observed that the About page doesn’t display any warning.

One thing different is that I used the newest CHT Android that was released last week, this version includes support for Android 14. I would also suggest to not use an Admin user, try first with an offline user.

If this continues to fail, we need to get the logs. For that, please sync the application to upload feedback docs into the server, then check the medic-user-{username}-meta or medic-users-meta databases to find the feedback docs.

Another alternative is debugging the feature by connecting your phone to the computer while using the application, then the logs should print in Chrome’s console. You can find more information in our documentation and also in the official Chrome documentation.

2 Likes

@Jennifer_Quesada, thanks for posting the video. It is now working for me. I realized that I used “chv” instead of “chw” in the app_settings.

Is it possible to utilize this feature within a form as an alternative to the search bar? Our specific scenario involves reading a QR code within the form and then capturing it in an input field located within that same form.

2 Likes

@iesmail at the moment this feature is only available in the Contact’s search bar (FYI @michael)

The closest we have available is the android-app-launcher that can connect with a third party app to read barcodes, I suggest finding an open source app (ref. previous conversation).

1 Like