Building > Reference > forms/ > contact
Contact Forms: Used for creating and editing people and places
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 Open Office. Name the spreadsheet assessment
. The final file name should be assessment.xlsx
.
Create 2 additional sheets. Rename the sheets survey
, choices
and settings
.
Create the following columns in the survey sheet and then add the following rows that 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:
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 |
Add the following rows that define the data collection fields below the existing rows (leave out the column names):
type | name | label | required | relevant | appearance | constraint | constraint_message | calculation | choice_filter | hint | default |
---|---|---|---|---|---|---|---|---|---|---|---|
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’ | |||||||
end group |
Add the following column names and rows to the choices sheet:
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 |
Add the following column names and rows to the settings sheet:
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
<username>
and <password>
with the actual username and password of your test instance.In the next tutorial, you will define the form <form_id>.properties.json
which will allow you to define the form’s title and icon, as well as when and where the form should be available.
Contact Forms: Used for creating and editing people and places
App Forms: Used to complete reports, tasks, and actions in the app
This document covers the configuration best practices of forms, tasks, targets, and contact profiles when building your own community health app.
This document covers the configuration best practices of forms, tasks, targets, and contact profiles when building your own community health app.
This document covers the configuration best practices of forms, tasks, targets, and contact profiles when building your own community health app.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.