-
-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support XForms that "compile" into SMS messages #4812
Comments
This should hook up to this: #4811 |
Additionally, we need to come up with a strategy for "consolidating" SMS messages back to their data counterparts. In other words:
|
Can we not generate a doc if we're sending an SMS? That would solve the report merging problem but would leave the user in an unknown state until they replicate the report from the server. If the UI is too bad we could generate a different kind of doc which records that the SMS was sent but never gets replicated to the server and throw it away once the real report gets generated. This might be sufficient for the first round with a better solution later if needed? |
Please find below the XLS for patient assessment under 5 and over 5 forms. Let me know if there is anything missing |
Further to comment above, form XML is available at |
@alxndrsn reviewed and back to you. So sorry it took this long, that was very much unintentional! |
For AT, you should read https://github.com/medic/medic-docs/blob/master/configuration/forms.md#sending-reports-as-sms and make sure that both the document makes sense and the code works as described. |
I gave this a try. I didn't test the integration with Android at all, I hacked webapp in a branch to not do the android wrapper checks, and instead of calling the wrapper At first, I did not update any of my forms (forms from standard config). Also, by default, all forms send sms. When a form doesn't have the So, in order to have a form not send an SMS, it requires you to either:
The custom SMS generation looks good: expressions evaluate as described. Invalid expressions throw an error which is logged in console and submitted as feedback. |
@SCdF do we need to make changes based on @dianabarsan review? Who's responsible for this now? Also, we may have added code that handles the sending but we aren't requesting permissions to do so. Not sure if that was intentional or not but Logcat spits out the error below so we'd never be able to send SMS as far as I can tell. This is in medic-android. 2019-05-29 16:58:57.363 9997-10163/? W/System.err: java.lang.SecurityException: Sending SMS message: uid 10161 does not have android.permission.SEND_SMS. |
I wonder if we should check for permission and show an error in the UI if we don't have it. Otherwise this will just fail silently :/ |
Reading the docs from google we should be prompting or we'll never be able to send SMS.
https://developer.android.com/guide/topics/permissions/overview#dangerous-permission-prompt and details on requesting the permission. https://developer.android.com/training/permissions/requesting.html#perm-request |
Ok, I was able to build a version of the android app locally leveraging the permission requesting we already have and was able to use the Medic version of sending sms. However, when I try to follow the ODK standards for compact submission I cannot upload the app through the admin console. https://opendatakit.github.io/xforms-spec/#compact-record-representation-(for-sms)
|
It looks that our parser fails when you add the |
I tried without prefix and only delimiter and still failing.
|
You have 2 delimiter attributes :) |
Thanks to @dianabarsan I'm able to send SMS in our standard and the ODK standard. |
Assigned to @dianabarsan to update the documentation and raise a new issue for any improvements. |
Updated documentation about ODK compaction and medics SMS sending. medic/cht-core#4812
Docs have been updated . |
See this section of this document for discussion specific pertaining to the project that requires this: https://docs.google.com/document/d/1Ygpi5JzVKYbfWF-uEIc1RCvAPSGq-ut0N8cHMSn5eXY/edit#heading=h.2vg9c5lgu2ld
The developer should also work with @maremegaye so they have the specific form that is needed to test with and make sure the implementation works for that form. This is important because:
We could also consider hooking into PouchDB and only sending SMS if the form can't be replicated upward immediately. That could be hard though, and for time constraint reasons it's fine to not do this
The text was updated successfully, but these errors were encountered: