| 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 | end group | npo_data | |||||||||||||||||||||||||
48 | string | name | Organisation name | yes | |||||||||||||||||||||||
49 | select_multiple districts_rural | sm_rural | Districts | yes | ${is_rural}=1 | minimal | selected(${districts}, name) | ||||||||||||||||||||
50 | select_multiple districts_metro | sm_metro | Districts | yes | ${is_rural}=0 | minimal | selected(${districts}, name) | ||||||||||||||||||||
51 | calculate | sm_districts | if(${is_rural}!='',if(${is_rural}=1,${sm_rural},${sm_metro}),'') | ||||||||||||||||||||||||
52 | calculate | sm_district_count | NO_LABEL | count-selected(${sm_districts}) | |||||||||||||||||||||||
53 | string | external_id | External ID | ||||||||||||||||||||||||
54 | string | notes | Notes | multiline | |||||||||||||||||||||||
55 | end group | begin | |||||||||||||||||||||||||
56 | |||||||||||||||||||||||||||
57 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
58 | calculate | _ms | ../../begin/npo_data/municipalities | ||||||||||||||||||||||||
59 | begin repeat | r_municipalities | Municipalities | count-selected(${sm_districts}) | |||||||||||||||||||||||
60 | calculate | district | selected-at(${sm_districts}, position(..)-1) | ||||||||||||||||||||||||
61 | |||||||||||||||||||||||||||
62 | calculate | ext_check | contains(${_ms}, ${district}) | ||||||||||||||||||||||||
63 | calculate | ext_start_key | concat(${district}, ':') | ||||||||||||||||||||||||
64 | calculate | ext_end_key | concat(':',${district}) | ||||||||||||||||||||||||
65 | calculate | ext_initial | ../ext_check | substring-after(${_ms},../ext_start_key) | |||||||||||||||||||||||
66 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
67 | note | test | Values | ../ext_values | |||||||||||||||||||||||
68 | |||||||||||||||||||||||||||
69 | select_multiple municipalities | sm_municipalities_initial | Select municipalities for district ${district} | hidden | ../ext_values | district=${district} | |||||||||||||||||||||
70 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | selected(${sm_municipalities_initial}, name) | |||||||||||||||||||||
71 | |||||||||||||||||||||||||||
72 | calculate | map_municipalities_for_district | join(':', ${district},join(':', ${sm_municipalities}, ${district})) | ||||||||||||||||||||||||
73 | end repeat | r_municipalities | |||||||||||||||||||||||||
74 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
75 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
76 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
77 | end group | g_municipalities | |||||||||||||||||||||||||
78 | |||||||||||||||||||||||||||
79 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
80 | calculate | count | if(${is_rural}!='',if(${is_rural}=1, count-selected(${all_selected_municipalities}), count-selected(${sm_districts})),0) | ||||||||||||||||||||||||
81 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
82 | calculate | district_ | ${is_rural}=0 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
83 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
84 | calculate | key | if(${is_rural}=1, ${municipality}, ${district_}) | ||||||||||||||||||||||||
85 | |||||||||||||||||||||||||||
86 | calculate | ext_check | contains(${main_places}, ${key}) | ||||||||||||||||||||||||
87 | calculate | ext_start_key | concat(${key}, ':') | ||||||||||||||||||||||||
88 | calculate | ext_end_key | concat(':',${key}) | ||||||||||||||||||||||||
89 | calculate | ext_initial | ../ext_check | substring-after(${main_places},../ext_start_key) | |||||||||||||||||||||||
90 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
91 | |||||||||||||||||||||||||||
92 | calculate | prev_main_places_rural | if(${location_type}='rural',../ext_values,'') | ||||||||||||||||||||||||
93 | calculate | prev_main_places_metro | if(${location_type}='metro',../ext_values,'') | ||||||||||||||||||||||||
94 | |||||||||||||||||||||||||||
95 | 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' | ||||||||||||||||||||
96 | 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) | ||||||||||||||||||||
97 | 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} | ||||||||||||||||||||
98 | select_multiple main_places | sm_municipality_main_places | Select main places for municipality: ${municipality} | yes | ${is_rural}=1 | minimal | selected(${sm_municipality_main_places_initial}, name) | ||||||||||||||||||||
99 | calculate | sm_main_places | if(${is_rural}=1, ${sm_municipality_main_places}, ${sm_district_direct_main_places}) | ||||||||||||||||||||||||
100 |