Build > Forms > contact
Contact Forms: Used to create and edit people and places
Building CHT app forms
App forms allow users to submit reports from Android devices.
This tutorial will take you through how to build App forms for CHT applications, including:
You will be building assessment workflow that allows Community Health Workers to conduct a health assessment for children under the age of 5.
App forms serve as actions within the app.
XLSForm is a form standard created to help simplify the authoring of forms in Excel.
XForm is a CHT-enhanced version of the ODK XForm standard.
You should have a functioning CHT instance with cht-conf
installed locally and a project folder set up already.
Create a new spread sheet in Google Sheets or other preferred editor like Excel or LibreOffice. Name the spreadsheet assessment
. The final file name should be assessment.xlsx
.
Create 2 additional sheets. Rename the sheets survey
, choices
and settings
.
This rows are populated automatically before the form is rendered to the user. These fields are usually hidden by default but can be accessed to display certain information about the person being assessed.
Copy everything inside the table below by clicking the “📋 Copy survey sheet” button, then paste into cell A1 of a new sheet named survey
in Google Sheets or your prefered editor:
type | name | label | required | relevant | appearance | constraint | constraint_message | calculation | choice_filter | hint | default |
begin group | inputs | Patient | ./source = 'user' | field-list | |||||||
hidden | source | Source | user | ||||||||
hidden | source_id | Source_ID | |||||||||
hidden | task_id | Task_ID | |||||||||
begin group | contact | Contact | |||||||||
string | _id | Patient ID | select-contact type-person | Select a person from the list | |||||||
hidden | patient_id | Medic ID | |||||||||
hidden | name | Patient Name | |||||||||
begin group | parent | Parent | |||||||||
hidden | _id | Family UUID | |||||||||
begin group | parent | Grandparent | |||||||||
hidden | _id | CHW Area UUID | |||||||||
hidden | name | CHW Name | |||||||||
hidden | phone | CHW Phone | |||||||||
begin group | parent | Great Grandparent | |||||||||
hidden | _id | CU UUID | |||||||||
end group | |||||||||||
end group | |||||||||||
end group | |||||||||||
end group | |||||||||||
end group | |||||||||||
calculate | patient_id | ../inputs/contact/_id | |||||||||
calculate | patient_name | ../inputs/contact/name | |||||||||
begin group | group_assessment | Assessment | |||||||||
select_one yes_no | cough | Does ${patient_name} have a cough? | yes | ||||||||
select_one symptom_duration | cough_duration | How long has the cough lasted? | yes | ${cough} = 'yes' | |||||||
select_one yes_no | fever | Does ${patient_name} have a fever? | yes | ||||||||
select_one yes_no | diarrhea | Does ${patient_name} have diarrhea? | yes | ||||||||
end group | |||||||||||
end group |
Copy everything inside the table below by clicking the “📋 Copy choices sheet” button, then paste into cell A1 of a new sheet named choices
in Google Sheets or your prefered editor:
list_name | name | label |
yes_no | yes | Yes |
yes_no | no | No |
symptom_duration | 3 | 3 days or less |
symptom_duration | 7 | 4 - 7 days |
symptom_duration | 13 | 8 - 13 days |
symptom_duration | 14 | 14 days or more |
Copy everything inside the table below by clicking the “📋 Copy settings sheet” button, then paste into cell A1 of a new sheet named settings
in Google Sheets or your prefered editor:
form_title | form_id | version | style | path | instance_name | default_language |
Assess patient | assessment | 1 | pages | data | en |
Add the file to the forms/app
subfolder in your project.
project-name
forms
app
assessment.xlsx
To convert and upload the form to your local instance, run the following command from the root folder:
cht --url=https://<username>:<password>@localhost --accept-self-signed-certs convert-app-forms upload-app-forms -- assessment
Important
Be sure to replace the values <username>
and <password>
with the actual username and password of your test instance.
Contact Forms: Used to create and edit people and places
App Forms: Used to complete reports, tasks, and actions in the app
Best practices for configuring CHT Applications
Best practices for configuring CHT Applications
Best practices for configuring CHT Applications