This describes how to setup a form that will register a case for use with Messaging. You can currently only have one phone number per case. We need to save this phone number to a specially named case property called contact_phone_number.
Create and Setup a New Application
- In your project create a new application called Pregnancy Messaging.
- Update the first module to set the name to Pregnancy
- And then set the case type to pregnancy.
Create the Registration Form
This tutorial assumes you already know how to create a form with hidden values. Rename the Untitled Form to Registration and add questions so that it resembles the following. Some important things to note:
- We name the phone number question contact_phone_number. This is the name of the special case property that Messaging will look for when creating a new case. When entering a phone number here, it must include the country code. For example, for an US phone number you would enter 15551234567. For an Indian number you would enter a number like 919560196285.
- We add a hidden value called contact_phone_number_is_verified with a calculation of 1. This is also needed as a case property for Messaging to know to send messages to a case.
The full definition of the form is listed below:
|edd||Date||Expected Date of Delivery||Yes||. > today() and (. - today() <= 275)|
|contact_phone_number||Phone Number or Numerical ID||Phone Number|
Save the form and configure the case management to create a new case. Save all the questions as case properties. Its important the contact_phone_number and contact_phone_number_is_verified case properties are named correctly.
This form is now setup to create a register a new case that is setup to send and receive SMS messages. We'll now configure an Update form that the mobile worker can use to identify high mothers with any risk symptoms.