Wazimap USSD Application¶
-
States: states:display-data
¶ Returns confirmation of the location and category to query using ChoiceState. User can choose to receive the data via sms (states:retrieve-location), query another section (states:select-section), navigate to Main Menu (states:start) or exit (states:end)
-
States: states:display-provincial-data
¶ Returns confirmation of the category to query using ChoiceState. User can choose to receive the data via sms (states:retrieve-location), query another section (states:provincial-data), navigate to Main Menu (states:start) or exit (states:end)
-
States: states:end
¶ Ends the application with a farewell message to the user.
-
States: states:incorrect_location
¶ Returns options for the user to navigate to a new location entry (states:location), Main Menu (states:start) or exit (states:end) the application.
-
States: states:location
¶ Asks the user to input a location on Ward, Provincial or National level using the FreeText State.
The input is fed into a Wazimap URL and returns a list of json location results found in South Africa that match the input location (states:results) or returns (states:incorrect_location) if no matching location is found.:
Eg. http://wazimap.co.za/place-search/json/Claremont
-
States: states:location-sms
¶ Selects the section of json data for the Wazimap category selected. The sub_section functon then returns the specific results to be sent via sms.
An sms is sent and (states:end) is returned.
-
States: states:provincial-data
¶ Returns a PaginatedChoiceState of Wazimap for the user to query.
-
States: states:provincial-sms
¶ Returns the getProvinceData function which returns the Wazimap catetory per province.
An sms is sent with the data and (states:end) is returned.
-
States: states:results
¶ Returns a json list of location results using PaginatedChoiceState. The user selects the location to query and then (states:select-section) is returned.
-
States: states:retrieve-location
¶ Returns a delegator state that resturns json results for the location chosen by the user. This navigates to (states:sms)
-
States: states:select-section
¶ Returns Wazimap categories using ChoiceState.
-
States: states:start
¶ The initial state of Wazimap interactions. This loads a Main Menu environment for the user with the option of navigating towards querying a specific location (states:location), provincial data (states:provincial-data), or exiting the application (states:end) using ChoiceState.
-
function: capitaliseLocation
(string)¶ Function capitalises first letter of word for cases where input is lower case.
-
function: getHttp
(province_code, section_id)¶ Returns json text of a specific Wazimap category for a chosen province. Province codes in the format “province-FS”, “province-GT”.
-
function: getProvinceData
(section_id, section_name)¶ Lists the provincial codes and names. Calls the getHttp function and returns a promise of data for the catagory selected for all provinces queried.
-
function: provincial_section
(data, section_id, section_name)¶ - Returns a subsection of data received from the json query for the relevant province. We need to navigate through the json query to access specific results.:
eg. provincial_section.demographics = function(data) { return "Population: " + data.total_population.values.this; }
-
function: sub_section
(data, section)¶ - Returns a subsection of data received from the json query for the relevant location. We need to navigate through the json query to access specific results.:
eg. sub_section.demographics = function(data) { return "Population: " + data.total_population.values.this; }