Skip to content

Commit 34d9da7

Browse files
committed
Merge branch 'main' into cht-sync-174-bastion-postgres-access
2 parents dd2fc8f + acfd42c commit 34d9da7

File tree

77 files changed

+798
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+798
-236
lines changed

content/en/building/concepts/care-guides.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >
55
Taking health workers through care protocols and providing decision support
66
keywords: care-guides
77
relatedContent: >
8-
building/concepts/forms
8+
building/forms
99
building/tasks/#care-guides
1010
building/contact-summary/contact-summary-templated/#care-guides
1111
aliases:

content/en/building/contact-management/contacts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66
Contacts and users overview
77
keywords: hierarchy contacts care-guides
88
relatedContent: >
9-
building/reference/forms/contact
9+
building/forms/contact
1010
building/contact-summary/contact-summary-templated
1111
building/contact-management/moving-contacts
1212
building/contact-management/contact-and-users-1

content/en/building/contact-summary/contact-summary-templated.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 2
55
description: >
66
Customizing the fields, cards, and actions on profile pages
77
relatedContent: >
8-
building/guides/forms/form-inputs
8+
building/forms/configuring/form-inputs
99
relevantLinks: >
1010
docs/building/features/contacts
1111
docs/building/concepts/hierarchies
@@ -55,14 +55,14 @@ Each field that can be shown on a contact's profile is defined as an object in t
5555
| `width` | `integer` | The horizontal space for the field. Common values are 12 for full width, 6 for half width, or 3 for quarter width. Default 12. | no |
5656
| `translate` | `boolean` | Whether or not to translate the `value`. Defaults to false. | no |
5757
| `context` | `object` | When `translate: true` and `value` uses [translation variables](https://angular-translate.github.io/docs/#/guide/06_variable-replacement), this value should provide the translation variables. | no |
58-
| `appliesIf` | `function()` or `boolean` | Return true if the field should be shown. | no |
58+
| `appliesIf` | `function()` | Return `true` if the field should be shown, and `false` if it should be hidden. Default is `true`. | no |
5959
| `appliesToType` | `string[]` | Filters the contacts for which `appliesIf` will be evaluated. For example, `['person']` or `['clinic', 'health_center']`. It defaults to all types if it is not defined. | no |
6060

6161
<!-- TODO: See [How to configure profile pages]() for an example. -->
6262

6363
## Condition Cards
6464

65-
Each condition card is defined as a card object in the `cards` array of `contact-summary.templated.js`. The properties for each object determine how and when the card and its fields are shown.
65+
Each condition card is defined as a card object in the `cards` array of `contact-summary.templated.js`. Condition cards are conditional and are configured to appear when a certain report is submitted or condition is met. The properties for each object determine how and when the card and its fields are shown.
6666

6767
### `contact-summary.templated.js .cards[]`
6868

@@ -87,7 +87,7 @@ Each condition card is defined as a card object in the `cards` array of `contact
8787

8888
## Care Guides
8989

90-
Each care guide accessible from a contact profile is defined as an [App Form]({{< ref "building/reference/forms/app" >}}). Context information can be provided to forms via the `context` object of `contact-summary.templated.js`.
90+
Each care guide accessible from a contact profile is defined as an [App Form]({{< ref "building/forms/app" >}}). Context information can be provided to forms via the `context` object of `contact-summary.templated.js`.
9191

9292
To show an App Form on a contact's profile, the form's `expression` field in its properties file must evaluate to true for that contact. The context information from the profile is accessible as the variable `summary`.
9393

content/en/building/examples/anc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66
Reference application for maternal and newborn care for CHW's using a mobile app
77
relatedContent: >
88
building/concepts
9-
building/reference/forms/app
9+
building/forms/app
1010
building/tasks/tasks-js
1111
aliases:
1212
- /apps/examples/anc
@@ -37,7 +37,7 @@ Once a [hierarchy]({{< relref "building/workflows/hierarchy" >}}) of people and
3737

3838
{{< figure src="forms-hierarchy.png" link="forms-hierarchy.png" class="right col-12 col-lg-12" >}}
3939

40-
{{< see-also page="building/reference/forms/app" title="Controlling form properties" >}}
40+
{{< see-also page="building/forms/app" title="Controlling form properties" >}}
4141

4242
## Workflows
4343

content/en/building/examples/covid-rdt-reference-app.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ weight:
55
description: >
66
CHT example application that uses a third party app to capture the result of a Rapid Diagnostic Test.
77
relatedContent: >
8-
building/reference/forms/app/#android-app-launcher
9-
building/reference/forms/app/#cht-xform-widgets
10-
building/reference/forms/app/#parse-timestamp-to-date
8+
building/forms/app/#android-app-launcher
9+
building/forms/app/#cht-xform-widgets
10+
building/forms/app/#parse-timestamp-to-date
1111
aliases:
1212
- /apps/examples/covid-rdt-reference-app
1313
---
@@ -41,7 +41,7 @@ For more information on these features, see the ["Related Content"](#related-con
4141

4242
Additional requirements for this application beyond CHT 3.13, include [CHT Android 0.10.0](https://github.com/medic/cht-android) or later and Dimagi's [RD-Toolkit 0.9.8](https://github.com/dimagi/rd-toolkit/) or later.
4343

44-
While this application calls the RD-Toolkit, the integration features in the CHT Core and CHT Android are generic. This means you could use a different RDT Android application if you prefer. Beyond the scope of RDTs, you could use this integration feature to launch any other Android app to perform an action and save the result in the CHT. To read more about this feature, see the [Android App Launcher section in the Forms reference documentation]({{< ref "building/reference/forms/app#android-app-launcher" >}}).
44+
While this application calls the RD-Toolkit, the integration features in the CHT Core and CHT Android are generic. This means you could use a different RDT Android application if you prefer. Beyond the scope of RDTs, you could use this integration feature to launch any other Android app to perform an action and save the result in the CHT. To read more about this feature, see the [Android App Launcher section in the Forms reference documentation]({{< ref "building/forms/app#android-app-launcher" >}}).
4545

4646
## Workflow
4747

@@ -165,7 +165,7 @@ These are the files in the COVID-19 app where you'll want to focus your customiz
165165

166166
The `forms/app/covid19_rdt_provision` and `forms/app/covid19_rdt_capture` forms (`xlsx`, `xml` and `properties.json`) represent the provision and capture portions of the forms. The tasks that get created are defined in `tasks.js`. Not shown are standard contact definitions in `forms/contact/*` as well as supporting configurations for icons and other CHT application settings.
167167

168-
To read more about how these files all work together, see [app forms]({{< ref "building/reference/forms/app" >}}), [contact forms]({{< ref "building/reference/forms/contact" >}}), and [task]({{< ref "building/tasks/tasks-js" >}}) reference documentation
168+
To read more about how these files all work together, see [app forms]({{< ref "building/forms/app" >}}), [contact forms]({{< ref "building/forms/contact" >}}), and [task]({{< ref "building/tasks/tasks-js" >}}) reference documentation
169169

170170
## Example form submission
171171

content/en/building/examples/direct-to-client.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66
Reference for Direct-to-client, two-way texting workflows with CHT and RapidPro
77
relatedContent: >
88
building/concepts
9-
building/reference/forms/app
9+
building/forms/app
1010
building/tasks/tasks-js
1111
aliases:
1212
- /apps/examples/direct-to-client

content/en/building/examples/supervisor-reference-app.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: >
77
relatedContent: >
88
building/concepts
99
building/features/supervision
10-
building/reference/forms/app
10+
building/forms/app
1111
building/tasks/tasks-js
1212
aliases:
1313
- /apps/examples/supervisor-reference-app

content/en/building/features/messaging/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66
relatedContent: >
77
building/reference/app-settings/schedules
88
building/guides/messaging
9-
building/guides/forms/app-form-sms
9+
building/forms/configuring/app-form-sms
1010
aliases:
1111
- /apps/features/messaging/
1212
---

content/en/building/features/reports/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66
relatedContent: >
77
building/reference/app-settings/patient_reports
88
building/guides/data/invalid-reports
9-
building/guides/forms/report-titles
9+
building/forms/configuring/report-titles
1010
aliases:
1111
- /apps/features/reports/
1212
---
@@ -92,7 +92,7 @@ The buttons at the bottom are configurable. The ones you see will depend on your
9292
## Defining Forms
9393

9494
The reports shown in your app are the completed and submitted *forms*. These forms must be defined and included with the application. There are two types of form definitions for reports:
95-
- **App forms**: actions within the app, such as a completed task, or an action on a contact's profile or reports tab. App forms are defined as [XForms]({{< ref "building/reference/forms/app" >}}).
95+
- **App forms**: actions within the app, such as a completed task, or an action on a contact's profile or reports tab. App forms are defined as [XForms]({{< ref "building/forms/app" >}}).
9696
- **JSON forms**: data coming from external channels such as SMS, or via interoperability with other tools. JSON forms are defined using a [JavaScript Object Notation schema]({{< ref "building/reference/app-settings/forms" >}}).
9797

9898

content/en/building/features/uhc-mode/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 11
55
description: >
66
Supporting equitable and timely care to families to increase Universal Health Coverage (UHC)
77
relatedContent: >
8-
building/guides/forms/uhc-mode
8+
building/forms/configuring/uhc-mode
99
building/reference/app-settings/user-roles
1010
building/reference/app-settings/user-permissions
1111
aliases:
@@ -28,4 +28,4 @@ The _UHC Mode_ in the CHT allows health workers to see when a household within t
2828
When using the _UHC Mode_, the households in the contact list can be sorted by when they were last visited. The days since the last visit is also shown in the app, along with the number of visits made to a household in a month period.
2929

3030
## Configurability
31-
The last visited date is calculated based on the number of days since an action was taken for that household, and the number of visits reflects the actions taken for that household in the current month. What constitutes as an action for a household, along with the start date for the reporting period, [are configurable]({{< relref "building/guides/forms/uhc-mode" >}}) to CHT app developers.
31+
The last visited date is calculated based on the number of days since an action was taken for that household, and the number of visits reflects the actions taken for that household in the current month. What constitutes as an action for a household, along with the start date for the reporting period, [are configurable]({{< relref "building/forms/configuring/uhc-mode" >}}) to CHT app developers.
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
---
2-
title: "Forms"
3-
linkTitle: "Forms"
4-
weight: 3
2+
title: Forms
3+
linkTitle: Forms
4+
weight: 7
55
description: >
66
Building block for all CHT apps
7-
keywords: app-forms contact-forms collect-forms json-forms
8-
relatedContent: >
9-
building/concepts/care-guides
10-
building/guides/forms
11-
building/reference/forms
12-
building/reference/app-settings/forms
137
aliases:
8+
- /building/reference/forms
9+
- /building/concepts/forms
1410
- /apps/concepts/forms
1511
---
1612

@@ -19,9 +15,8 @@ Forms are a building block of all CHT apps. They are used when creating or editi
1915
When a completed form is submitted, it is treated as a Report in the app. All reports can be viewed in the [Reports tab]({{< ref "building/features/reports" >}}) by those with the proper access within the [hierarchy]({{< ref "building/workflows/hierarchy" >}}).
2016

2117
There are four different types of forms:
22-
- [**Contact Forms**]({{< ref "building/reference/forms/contact" >}}): used to create and edit contacts. Defined as CHT-enhanced XForms.
23-
- [**App Forms**]({{< ref "building/reference/forms/app" >}}): serve as actions within the app, such as a task or an action. Defined as CHT-enhanced XForms.
24-
- [**Collect Forms**]({{< ref "building/reference/forms/collect" >}}): used to render forms in Medic Collect. Defined as ODK XForms and need a corresponding JSON form to receive data in CHT.
25-
- [**JSON Forms**]({{< ref "building/reference/app-settings/forms" >}}): used for data coming from external channels such as SMS, or via interoperability with other tools. Defined according to a JavaScript Object Notation schema.
18+
- [**Contact Forms**]({{< ref "building/forms/contact" >}}): used to create and edit contacts. Defined as CHT-enhanced XForms.
19+
- [**App Forms**]({{< ref "building/forms/app" >}}): serve as actions within the app, such as a task or an action. Defined as CHT-enhanced XForms.
20+
- [**Collect Forms**]({{< ref "building/forms/collect" >}}): used to render forms in Medic Collect. Defined as ODK XForms and need a corresponding JSON form to receive data in CHT.
2621

2722
Forms that can be completed in the app are built using a CHT-enhanced version of [ODK XForms](https://opendatakit.github.io/xforms-spec/) notation -- a XML definition of the structure and format for a set of questions. Since writing raw XML can be tedious, the [XLSForm standard](http://xlsform.org/) is commonly used to define forms. The [cht-conf](https://github.com/medic/cht-conf) command line tool can be used to convert to the XForm format and include the form in a CHT application. The instructions on this site assume some knowledge of XLSForm.

content/en/building/reference/forms/app.md renamed to content/en/building/forms/app.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
22
title: "app"
33
linkTitle: "app"
4-
weight: 5
4+
weight: 1
55
description: >
66
**App Forms**: Used to complete reports, tasks, and actions in the app
77
relevantLinks: >
88
docs/building/concepts/workflows
99
docs/design/best-practices
1010
relatedContent: >
11-
building/guides/forms/form-inputs
11+
building/forms/configuring/form-inputs
1212
keywords: workflows app-forms
1313
aliases:
14+
- /building/reference/forms/app
1415
- /apps/reference/forms/app
1516
---
1617

@@ -21,7 +22,7 @@ App forms are defined by the following files:
2122
- A XML form definition using a CHT-enhanced ODK XForm format
2223
- A XLSForm form definition, easier to write and converts to the XForm (optional)
2324
- Meta information in the `{form_name}.properties.json` file (optional)
24-
- Media files in the `{form_name}-media` directory (optional). How to [include multimedia files]( {{< ref "building/guides/forms/multimedia" >}} ).
25+
- Media files in the `{form_name}-media` directory (optional). How to [include multimedia files]( {{< ref "building/forms/configuring/multimedia" >}} ).
2526

2627
## XForm
2728

@@ -91,7 +92,7 @@ Some XForm widgets have been added or modified for use in CHT applications. The
9192
### Bikram Sambat Datepicker
9293

9394
Calendar widget using Bikram Sambat calendar, which is used by default for appropriate languages. The CHT documentation includes a [conversion tool](https://docs.communityhealthtoolkit.org/bikram-sambat/) to check the conversion between Gregorian and Bikram Sambat dates.
94-
{{< see-also page="building/reference/forms/app" title="`to-bikram-sambat` XPath function" anchor="to-bikram-sambat" >}}
95+
{{< see-also page="building/forms/app" title="`to-bikram-sambat` XPath function" anchor="to-bikram-sambat" >}}
9596

9697
### Countdown Timer
9798

@@ -109,7 +110,7 @@ The `trigger` implementation of the countdown timer is only supported for CHT ve
109110

110111

111112
### Contact Selector
112-
A dropdown field to search and select a person or place, and save their UUID in the report. The contact's data will also be mapped to fields with matching names within the containing group. If the contact selector's appearance includes `bind-id-only`, the associated data fields are not mapped. See [the form input guide]({{< ref "building/guides/forms/form-inputs#contact-selector" >}}) for an example.
113+
A dropdown field to search and select a person or place, and save their UUID in the report. The contact's data will also be mapped to fields with matching names within the containing group. If the contact selector's appearance includes `bind-id-only`, the associated data fields are not mapped. See [the form input guide]({{< ref "building/forms/configuring/form-inputs#contact-selector" >}}) for an example.
113114

114115
### Rapid Diagnostic Test Capture
115116
Take a picture of a Rapid Diagnotistic Test and save it with the report. Works with [rdt-capture Android application](https://github.com/medic/rdt-capture/). To use create a string field with appearance `mrdt-verify`.
@@ -312,7 +313,7 @@ _Added in 3.14.0._
312313

313314
This function converts a `date` to a `string` containing the value of the date formatted according to the [Bikram Sambat](https://en.wikipedia.org/wiki/Vikram_Samvat) calendar.
314315

315-
See also: [Bikram Sambat Datepicker]({{< ref "building/reference/forms/app#cht-xform-widgets" >}})
316+
See also: [Bikram Sambat Datepicker]({{< ref "building/forms/app#cht-xform-widgets" >}})
316317

317318
### `z-score`
318319

@@ -349,17 +350,17 @@ The data used by this function needs to be added to CouchDB. The example below s
349350

350351
## Input data
351352

352-
`app` forms have access to a variety of [input data]({{< ref "building/guides/forms/form-inputs#app-forms" >}}) depending on the source of the form.
353+
`app` forms have access to a variety of [input data]({{< ref "building/forms/configuring/form-inputs#app-forms" >}}) depending on the source of the form.
353354

354355
## CHT Special Fields
355356

356357
Some fields in app forms control specific aspects of CHT Apps, either to bring data into forms or for a feature outside of the form.
357358

358359
### Quintiles
359-
The `NationalQuintile` and `UrbanQuintile` fields on a form will be assigned to all people belonging to the place. This is helpful when household surveys have quintile information which could be used to target health services for individuals. {{< see-also prefix="Read More" page="building/guides/forms/wealth-quintiles" >}}
360+
The `NationalQuintile` and `UrbanQuintile` fields on a form will be assigned to all people belonging to the place. This is helpful when household surveys have quintile information which could be used to target health services for individuals. {{< see-also prefix="Read More" page="building/forms/configuring/wealth-quintiles" >}}
360361

361362
### UHC Mode
362-
When the `visited_contact_uuid` field is set at the top level of a form, this form is counted as a household visit in [UHC Mode]({{< relref "building/features/uhc-mode" >}}). This field must be a `calculate` field with the place UUID of the visited contact. You may run into performance issues if you configure this to look at forms submitted very frequently. {{< see-also prefix="Read More" page="building/guides/forms/uhc-mode" >}}
363+
When the `visited_contact_uuid` field is set at the top level of a form, this form is counted as a household visit in [UHC Mode]({{< relref "building/features/uhc-mode" >}}). This field must be a `calculate` field with the place UUID of the visited contact. You may run into performance issues if you configure this to look at forms submitted very frequently. {{< see-also prefix="Read More" page="building/forms/configuring/uhc-mode" >}}
363364

364365
## Uploading Binary Attachments
365366

content/en/building/reference/forms/collect.md renamed to content/en/building/forms/collect.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
title: "collect"
33
linkTitle: "collect"
4-
weight: 5
4+
weight: 3
55
description: >
66
**Collect Forms**: Served to the Medic Collect application
77
keywords: collect-forms collect
88
aliases:
9+
- /building/reference/forms/collect
910
- /apps/reference/forms/collect
1011
---
1112

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Configuring
3+
linkTitle: Configuring
4+
weight: 4
5+
description: >
6+
Configuring and using forms in the CHT
7+
aliases:
8+
- /building/guides/forms/
9+
- /apps/guides/forms/
10+
---

content/en/building/guides/forms/additional-docs.md renamed to content/en/building/forms/configuring/additional-docs.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ weight:
55
description: >
66
Integration for sending and receiving SMS
77
relatedContent: >
8-
building/guides/forms/app-form-sms
9-
building/guides/forms/multimedia
10-
building/reference/forms/contact
11-
8+
building/forms/configuring/app-form-sms
9+
building/forms/configuring/multimedia
10+
building/forms/contact
1211
aliases:
12+
- /building/guides/forms/additional-docs
1313
- /apps/guides/forms/additional-docs
1414
---
1515
In version 2.13.0 and higher, you can configure app forms to generate additional docs upon submission. You can create one or more docs using variations on the configuration described below. One case where this can be used is to register a newborn from a delivery report, as shown below. First, here is an overview of what you can do and how the configuration should look in XML:

content/en/building/guides/forms/app-form-sms.md renamed to content/en/building/forms/configuring/app-form-sms.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ weight:
55
description: >
66
Trigger calls and SMS from within the form, or send an SMS once submitted.
77
relatedContent: >
8-
building/guides/forms/additional-docs
9-
building/guides/forms/multimedia
10-
building/reference/forms/contact
8+
building/forms/configuring/additional-docs
9+
building/forms/configuring/multimedia
10+
building/forms/contact
1111
aliases:
12+
- /building/guides/forms/app-form-sms
1213
- /apps/guides/forms/app-form-sms
1314
---
1415

0 commit comments

Comments
 (0)