A bespoke solution for scanning MRZ-coded documents to extract data!
View Demo
ยท
Report Bug
ยท
Request Feature
Table of Contents
At the DIMA in the UNHCR Asia and Pacific Regional Bureau, we have developed a bespoke KoBo integration that allows data to be extracted from an MRZ-enabled document and imported into KoBo. This automated approach was created to limit the risk of mistakes during a Rapid Assessment conducted in AFG. The objective is to collect the POCs' Name, Family Name, Age, and Gender by automatically reading the data from their national ID cards and saving it in KoBo.
This application configures an Android intent. Intents are messaging objects used to request an action from another app component. Learn more in the Android docs.
Key Features:
- Integrates with KoBoCollect and ODKCollect
- Works 100% offline
- Pulls data from MRZ documents with capability to read other document types as well ๐
This is a template solution, no one KoBo form will serve all projects since your needs may be different (See usage for information on how to adapt this code for a different KoBo form). You may suggest changes by forking this repo and creating a pull request or opening an issue.
List of all major frameworks/libraries used to develop this project.
To get a local copy up and running follow these steps.
Required resources and how to install and build them.
- Download the installer for Node LTS.
- Install the ionic CLI globally
npm install -g ionic
Below is the instructions on installing and setting up the scanner app.
- Get a 30-day MicroBlink SDK trial Key at https://microblink.com/
- Clone the repo
git clone https://github.com/nawaaugustine/kobo-mrz.git
- Install NPM packages from your project root
npm install
- Enter your MicroBlink SDK key in
./src/app/scanner/scanner.page.ts
android: '<your_android_license>';
See the instructions on the usage below before building.
- Run
ionic build --prod
- Run
npx cap copy
- Run
npx cap sync
- Run
npx cap open android
ensure you already have android studio installed - Goto your android studio and build the APK
- Enjoy! ๐
The below code change is required in other to adabt this template to your KoBo form.
-
Change values in
./src/app/plugins/LauncherActivity.ts
. The new values should match exactly your KoBo data name labels -
Change values assignment in
./src/app/scanner/scanner.page.ts
-
Pass assigned values to main andriod activity in
./android/app/src/main/java/io/nawa/kobo/mrz/LauncherActivity.java
-
Recieve and push values to KoBo in
./android/app/src/main/java/io/nawa/kobo/mrz/MainActivity.java
KoBo field-list
group can have an intent attribute that allows an external application to populate it.
type | name | label | appearance | body::intent |
---|---|---|---|---|
begin_group | mygroup |
Fields to populate | field-list |
io.nawa.kobo.mrz |
text |
Tazkira_no_001 |
ID Number | ||
text |
name |
First Name | ||
text |
father_name |
Family Name | ||
integer |
hhh_age |
Age | ||
text |
hhh_gender |
Gender | ||
end_group |
Download the signed example APK here. Tested successfully on android version 8+
- Add Changelog
- Make value addition dynamic based on the value passed to the method
- Add a modal to preview scanned data before sending to KoBo?
- Support for data extraction from QRCode/BarCode
- Support for data extraction from other document types
- Remove scanning capability if scanner app is not launched from KoBo
- Multi-language Support?
- French
- Spanish
- Arabic
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Added some Amazing Feature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Augustine Nawa - @nawaaugustine - [email protected]
Project Link: https://github.com/nawaaugustine/kobo-mrz
Some useful resources