| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | type | name | label::en | required | relevant | appearance | read_only | constraint | constraint_message | calculation | choice_filter | hint::en | default | notes | repeat_count | parameters | |||||||||||
2 | begin group | inputs | NO_LABEL | FALSE | |||||||||||||||||||||||
3 | begin group | user | NO_LABEL | ||||||||||||||||||||||||
4 | string | contact_id | NO_LABEL | Contact ID of the logged in user | |||||||||||||||||||||||
5 | string | facility_id | NO_LABEL | Place ID of the logged in user | |||||||||||||||||||||||
6 | string | name | NO_LABEL | Name of the logged in user | |||||||||||||||||||||||
7 | end group | user | |||||||||||||||||||||||||
8 | end group | ||||||||||||||||||||||||||
9 | |||||||||||||||||||||||||||
10 | |||||||||||||||||||||||||||
11 | begin group | init | NO_LABEL | field-list | |||||||||||||||||||||||
12 | select_one contact | create_new_person | Set the Primary Contact | yes | |||||||||||||||||||||||
13 | string | _id | Select the Primary Contact | selected(${create_new_person},'old_person') | select-contact type-team_lead | ||||||||||||||||||||||
14 | select_one place_type | place_type | Enter the name of this place | hidden | PLACE_TYPE | ||||||||||||||||||||||
15 | calculate | place_type_translation | jr:choice-name(${place_type},'${place_type}') | ||||||||||||||||||||||||
16 | end group | ||||||||||||||||||||||||||
17 | |||||||||||||||||||||||||||
18 | begin group | contact | New Person | selected(${create_new_person},'new_person') | field-list | ||||||||||||||||||||||
19 | hidden | parent | NO_LABEL | PARENT | |||||||||||||||||||||||
20 | hidden | type | NO_LABEL | contact | |||||||||||||||||||||||
21 | string | first_name | First Name | yes | |||||||||||||||||||||||
22 | string | last_name | Surname | yes | |||||||||||||||||||||||
23 | calculate | name | NO_LABEL | join(' ',${first_name}, ${last_name}) | |||||||||||||||||||||||
24 | string | Email Address | yes | ||||||||||||||||||||||||
25 | tel | phone | Cell Number | TRUE | Please enter a valid local number, or use the standard international format, which includes a plus sign (+) and country code. For example: +254712345678 | ||||||||||||||||||||||
26 | hidden | role | NO_LABEL | team_lead | |||||||||||||||||||||||
27 | |||||||||||||||||||||||||||
28 | hidden | contact_type | team_lead | Does not seem to get added automatically as with the team_lead create form | |||||||||||||||||||||||
29 | begin group | meta | NO_LABEL | hidden | |||||||||||||||||||||||
30 | calculate | created_by | ../../../inputs/user/name | ||||||||||||||||||||||||
31 | calculate | created_by_person_uuid | ../../../inputs/user/contact_id | ||||||||||||||||||||||||
32 | calculate | created_by_place_uuid | ../../../inputs/user/facility_id | ||||||||||||||||||||||||
33 | end group | ||||||||||||||||||||||||||
34 | end group | ||||||||||||||||||||||||||
35 | |||||||||||||||||||||||||||
36 | begin group | begin | field-list | ||||||||||||||||||||||||
37 | begin group | npo_data | NO_LABEL | hidden | |||||||||||||||||||||||
38 | string | _id | NO_LABEL | select-contact type-npo | ../../../PLACE_TYPE/parent | ||||||||||||||||||||||
39 | string | name | NO_LABEL | ||||||||||||||||||||||||
40 | string | location_type | NO_LABEL | ||||||||||||||||||||||||
41 | string | districts | NO_LABEL | ||||||||||||||||||||||||
42 | string | municipalities | NO_LABEL | ||||||||||||||||||||||||
43 | string | main_places | NO_LABEL | ||||||||||||||||||||||||
44 | string | sub_places | NO_LABEL | ||||||||||||||||||||||||
45 | |||||||||||||||||||||||||||
46 | calculate | is_rural | NO_LABEL | if(${location_type}!='',if(${location_type}='rural',1,0),'') | |||||||||||||||||||||||
47 | calculate | _d | ../districts | For referencing puproses | |||||||||||||||||||||||
48 | calculate | _ms | ../municipalities | For referencing puproses | |||||||||||||||||||||||
49 | calculate | _mps | ../main_places | For referencing puproses | |||||||||||||||||||||||
50 | calculate | _sps | ../sub_places | For referencing puproses | |||||||||||||||||||||||
51 | end group | npo_data | |||||||||||||||||||||||||
52 | string | name | Name | yes | |||||||||||||||||||||||
53 | select_multiple districts_rural | sm_rural | Districts | yes | ${is_rural}=1 | minimal | selected(${_d}, name) | ||||||||||||||||||||
54 | select_multiple districts_metro | sm_metro | Districts | yes | ${is_rural}=0 | minimal | selected(${_d}, name) | ||||||||||||||||||||
55 | calculate | sm_districts | if(${is_rural}!='',if(${is_rural}=1,${sm_rural},${sm_metro}),'') | ||||||||||||||||||||||||
56 | calculate | sm_district_count | NO_LABEL | count-selected(${sm_districts}) | |||||||||||||||||||||||
57 | string | external_id | External ID | ||||||||||||||||||||||||
58 | string | notes | Notes | multiline | |||||||||||||||||||||||
59 | end group | begin | |||||||||||||||||||||||||
60 | |||||||||||||||||||||||||||
61 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
62 | begin repeat | r_municipalities | Municipalities | count-selected(${sm_districts}) | |||||||||||||||||||||||
63 | calculate | district | selected-at(${sm_districts}, position(..)-1) | ||||||||||||||||||||||||
64 | |||||||||||||||||||||||||||
65 | calculate | ext_check | contains(${_ms}, ${district}) | ||||||||||||||||||||||||
66 | calculate | ext_start_key | concat(${district}, ':') | ||||||||||||||||||||||||
67 | calculate | ext_end_key | concat(':',${district}) | ||||||||||||||||||||||||
68 | calculate | ext_initial | ../ext_check | substring-after(${_ms},../ext_start_key) | |||||||||||||||||||||||
69 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
70 | note | test | Values | ../ext_values | |||||||||||||||||||||||
71 | |||||||||||||||||||||||||||
72 | select_multiple municipalities | sm_municipalities_initial | Select municipalities for district ${district} | hidden | ../ext_values | district=${district} | |||||||||||||||||||||
73 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | selected(${sm_municipalities_initial}, name) | |||||||||||||||||||||
74 | |||||||||||||||||||||||||||
75 | calculate | map_municipalities_for_district | join(':', ${district},join(':', ${sm_municipalities}, ${district})) | ||||||||||||||||||||||||
76 | end repeat | r_municipalities | |||||||||||||||||||||||||
77 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
78 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
79 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
80 | end group | g_municipalities | |||||||||||||||||||||||||
81 | |||||||||||||||||||||||||||
82 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
83 | calculate | count | if(${is_rural}!='',if(${is_rural}=1, count-selected(${all_selected_municipalities}), count-selected(${sm_districts})),0) | ||||||||||||||||||||||||
84 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
85 | calculate | district_ | ${is_rural}=0 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
86 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
87 | calculate | key | if(${is_rural}=1, ${municipality}, ${district_}) | ||||||||||||||||||||||||
88 | |||||||||||||||||||||||||||
89 | calculate | ext_check | contains(${_mps}, ${key}) | ||||||||||||||||||||||||
90 | calculate | ext_start_key | concat(${key}, ':') | ||||||||||||||||||||||||
91 | calculate | ext_end_key | concat(':',${key}) | ||||||||||||||||||||||||
92 | calculate | ext_initial | ../ext_check | substring-after(${_mps},../ext_start_key) | |||||||||||||||||||||||
93 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
94 | |||||||||||||||||||||||||||
95 | calculate | prev_main_places_rural | if(${location_type}='rural',../ext_values,'') | ||||||||||||||||||||||||
96 | calculate | prev_main_places_metro | if(${location_type}='metro',../ext_values,'') | ||||||||||||||||||||||||
97 | |||||||||||||||||||||||||||
98 | select_multiple main_places | sm_district_direct_main_places_initial | Select main places for district: ${district_} | ${is_rural}=0 | hidden | ../prev_main_places_metro | district=${district_} and municipality='NONE' | ||||||||||||||||||||
99 | select_multiple main_places | sm_district_direct_main_places | Select main places for district: ${district_} | yes | ${is_rural}=0 | minimal | selected(${sm_district_direct_main_places_initial}, name) | ||||||||||||||||||||
100 | select_multiple main_places | sm_municipality_main_places_initial | Select main places for municipality: ${municipality} | ${is_rural}=1 | hidden | ../prev_main_places_rural | municipality=${municipality} |