opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
50 stars 39 forks source link

Add (or use) QR code widget in Questionnaire #3350

Open pld opened 3 days ago

pld commented 3 days ago

Describe the feature request.

  1. In Questionnaires support setting the field type to "barcode", this renders as the QR code widget
  2. QR code fields show as a text entry with a QR code icon to the right of the input field
  3. When you tap the icon load a QR code reader, start with the ML Kit barcode reader, note in comments if there are challenges and we need to pursue alternatives
  4. After successfully reading a QR code, fill the field with the string read from the QR code
  5. The field is read-only, it cannot be edited except by text received from the QR code reader
  6. Extend the Questionnaire docs to add this field type

Additional context

Screenshot 2024-06-25 at 10 41 40 AM

Acceptance criteria

Area path

Write a Questionnaire that contains a qr-code type field and integrate the Questionnaire into the app

  1. Login to the app
  2. Launch the Questionnaire with a QR code
  3. Click on the field with the QR code icon
  4. Read a QR code
  5. Submit the Questionnaire
  6. Sync the device
  7. Inspect the QuestionnaireResponse stored on the server and device, validate that the QR code data is equivalent

Implementation plan (For Engineers)