As part of our work with CloudWorks we need to build a prototype integration to the Rapid Diagnostic Toolkit Android application.
The workflow for the prototype will be an assessment form that provisions a test, and then a follow up task which would have a button to check for the status of the test. If the test is still pending, the user could wait in the form to press the button again until the return status is that the test is complete.
This integration requires an Enketo widget to provision a test in the RDToolkit app, and another Enketo widget to collect the test result:
Since tests take a significant amount of time to resolve, the default execution mode is a two phase interaction. The first phase is an activity callout to provision a diagnostic test, and the second phase is request to capture the result of the test.
The result widget would store the return value as a JSON blob for now, with the status being queryable from within the form itself. That way the field could be required, and preventing advancing in the form until a completed/success status is returned.
1st prototype links
1st prototype - implementation document
Test instance
CHT Core branch
medic-android branch
Demo videos
Demo video # 1: TLDR video with first version of implementation. Not commentary, just chill music.
Demo video # 2: Longer video showing more scenarios with improved code. It has commentary
Status:
We are freezing development until the partner provides feedback about the demo.
Update:
âś… Connect with Cloudworks API and reflect results in their dashboards
âś… Support xls form - quick guide
✅ Make it configurable from “outside” medic-android
🔄 Support image storage and display
-> Android 10+ doesn’t allow to access other apps’ images, shared resources need to be stored in "share storage". The partner will fix the issue in their app and notify when their new release is done then we can continue the work in this item.
Update:
The partner informed today that they are currently working on the fix for the Android 10+ issue.
I've found another issue between RDToolkit and their Dashboard API where images are stored twice in the dashboard, maybe something to do with the app going to sleep and non blocking queue of requests. I've provided the steps, screenshots and other details.
I've moved this out of 3.11.0 and added it to the team workstream so it doesn't block the release.
Update:
The partner is working on fixing the issue related with the store of images for Android 10+. They're almost done, when it's ready, then we can do the integration work.
They resolved the issue with duplicate images in their dashboard, I verified it was working.
Constrain:
Because RD Toolkit app uses libraries that supports sdk 21+ and our medic-android supports 19+, we can't build an apk XWalk. This is the error:
uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.github.dimagi:rd-toolkit:0.9.0] as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
Will this integration retire our need for the existing MRDT app?
This is being considered, but not a given. In the next two months we might be involved in exploring Rapid Diagnostic Test workflows, which will help answer that question more definitively.
Update:
The issue related to retrieving images in Android 10+ is fixed and I've added the support in medic-android and CHT-Core.
We still have the constrain were xwalk build is failing because RD Toolkit app uses libraries that supports sdk 21+ and our medic-android supports 19+ but we can make a webview apk for Android5+ (sdk 21+) to not block the feature.
The documentation docs are updated and accessible here.
I've tested the feature in Android 11 and opened PRs for review :)