Skip to content

4. Server

Máximo Ramírez edited this page Nov 2, 2017 · 6 revisions

ODK Aggregate

EpiSample allows to send out multiple teams with multiple devices to conduct a census and aggregate all of the census data onto one device (such as a team leader device) for sampling, without the need for a laptop, Internet or cables. This is really useful for working on the field where there is no Internet connection and there is no capacity for setting up a local area network for the enumerators devices to transfer the data to a local server.

However, at the end, data consumers expect to have the collected data in a server. Therefore, EpiSample allows to link the App (client) with an ODK Aggregate instance running on a server and send finalized forms (both census and survey forms). Normally, the only instance communicating with the ODK Aggregate service will be the team leader device (where is supposed to be all the data aggregated), although this will depend on the current workflow, as EpiSample allows to link and transfer data to any instance, including the enumerators devices.

How to add the census form to ODK Aggregate

The census questionnaire is an ODK 2.0 data collection instrument located in the Android device (internal storage or sdcard) at:

/episample/survey/tables/census

This folder follows the structure of any instrument designed with the ODK Application Designer:

  • census
    • forms
      • census
        • formDef.json
        • census.xlsx
    • html
      • census_detail.html
      • census_list.html
    • instances
    • js
      • census_detail.js
      • census_list.js

However, we need an XML version of the census form to add it to the ODK Aggregate server. Therefore, the first step is to convert this form to XML.

For ODK 1.0 users, the first action would be to use the XLSForm tool for converting the census.xlsx file into an XML file. However, if you try to follow this method you will be returned with the following error:

Error: Unknown question type 'assign'.

This error is related to the formName variable which is a calculated field based on the placeName, headName and houseNumber variables.

In order to get correctly the XML version of the census form, we will need to use the Legacy XML tool of the ODK Application Designer. This tool allows to generate a Stub Form Definition (XML) that can be uploaded into ODK Aggregate to enable ODK Survey (EpiSample) to send submissions into ODK Aggregate's XForms XML submissions path (the one used by ODK Collect). Legacy XML expects a formDef.json file with the form definition to generate the XML version of the form.

Note: Therefore, it is required the ODK 2.0 suite of tools to convert questionnaires to XForms as it was stated in the How to install page.

For the census instrument you may find the different versions of this for in this GitHub repository.

To upload the census form to the ODK Aggregate server you may use the formDef.xml file.

How to add the survey form to ODK Aggregate

Like with the census form, we need to convert the formDef.json file which contains the questionnaires definition to a XML file. For doing that we will use the tool Legacy XML provided by the ODK Application Designer. Then, we will upload this XML file to the ODK Aggregate server as usually. As you can see the process is the same than with the census instrument.

For the survey example you may find the different versions in this GitHub repository.

To upload the survey example form to the ODK Aggregate server you may use the formDef.xml file.

Clone this wiki locally