| 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 | person | |||||||||||||||||||||||
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 | begin group | meta | NO_LABEL | hidden | |||||||||||||||||||||||
28 | calculate | created_by | ../../../inputs/user/name | ||||||||||||||||||||||||
29 | calculate | created_by_person_uuid | ../../../inputs/user/contact_id | ||||||||||||||||||||||||
30 | calculate | created_by_place_uuid | ../../../inputs/user/facility_id | ||||||||||||||||||||||||
31 | end group | ||||||||||||||||||||||||||
32 | end group | ||||||||||||||||||||||||||
33 | |||||||||||||||||||||||||||
34 | begin group | begin | field-list | ||||||||||||||||||||||||
35 | string | name | Organisation name | yes | |||||||||||||||||||||||
36 | select_multiple districts_rural | sm_rural | Districts | yes | ${is_rural}=1 | minimal | selected(${districts}, name) | ||||||||||||||||||||
37 | select_multiple districts_metro | sm_metro | Districts | yes | ${is_rural}=0 | minimal | selected(${districts}, name) | ||||||||||||||||||||
38 | calculate | sm_districts | if(${is_rural}!='',if(${is_rural}=1,${sm_rural},${sm_metro}),'') | ||||||||||||||||||||||||
39 | calculate | sm_district_count | NO_LABEL | count-selected(${sm_districts}) | |||||||||||||||||||||||
40 | string | external_id | External ID | ||||||||||||||||||||||||
41 | string | notes | Notes | multiline | |||||||||||||||||||||||
42 | end group | begin | |||||||||||||||||||||||||
43 | |||||||||||||||||||||||||||
44 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
45 | calculate | _ms | ../../npo_data/municipalities | ||||||||||||||||||||||||
46 | begin repeat | r_municipalities | Municipalities | count-selected(${sm_districts}) | |||||||||||||||||||||||
47 | calculate | district | selected-at(${sm_districts}, position(..)-1) | ||||||||||||||||||||||||
48 | |||||||||||||||||||||||||||
49 | calculate | ext_check | contains(${_ms}, ${district}) | ||||||||||||||||||||||||
50 | calculate | ext_start_key | concat(${district}, ':') | ||||||||||||||||||||||||
51 | calculate | ext_end_key | concat(':',${district}) | ||||||||||||||||||||||||
52 | calculate | ext_initial | ../ext_check | substring-after(${_ms},../ext_start_key) | |||||||||||||||||||||||
53 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
54 | note | test | Values | ../ext_values | |||||||||||||||||||||||
55 | |||||||||||||||||||||||||||
56 | select_multiple municipalities | sm_municipalities_initial | Select municipalities for district ${district} | hidden | ../ext_values | district=${district} | |||||||||||||||||||||
57 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | selected(${sm_municipalities_initial}, name) | |||||||||||||||||||||
58 | |||||||||||||||||||||||||||
59 | calculate | map_municipalities_for_district | join(':', ${district},join(':', ${sm_municipalities}, ${district})) | ||||||||||||||||||||||||
60 | end repeat | r_municipalities | |||||||||||||||||||||||||
61 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
62 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
63 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
64 | end group | g_municipalities | |||||||||||||||||||||||||
65 | |||||||||||||||||||||||||||
66 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
67 | calculate | count | if(${is_rural}!='',if(${is_rural}=1, count-selected(${all_selected_municipalities}), count-selected(${sm_districts})),0) | ||||||||||||||||||||||||
68 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
69 | calculate | district_ | ${is_rural}=0 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
70 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
71 | calculate | key | if(${is_rural}=1, ${municipality}, ${district_}) | ||||||||||||||||||||||||
72 | |||||||||||||||||||||||||||
73 | calculate | ext_check | contains(${main_places}, ${key}) | ||||||||||||||||||||||||
74 | calculate | ext_start_key | concat(${key}, ':') | ||||||||||||||||||||||||
75 | calculate | ext_end_key | concat(':',${key}) | ||||||||||||||||||||||||
76 | calculate | ext_initial | ../ext_check | substring-after(${main_places},../ext_start_key) | |||||||||||||||||||||||
77 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
78 | |||||||||||||||||||||||||||
79 | calculate | prev_main_places_rural | if(${location_type}='rural',../ext_values,'') | ||||||||||||||||||||||||
80 | calculate | prev_main_places_metro | if(${location_type}='metro',../ext_values,'') | ||||||||||||||||||||||||
81 | |||||||||||||||||||||||||||
82 | 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' | ||||||||||||||||||||
83 | 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) | ||||||||||||||||||||
84 | 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} | ||||||||||||||||||||
85 | 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) | ||||||||||||||||||||
86 | calculate | sm_main_places | if(${is_rural}=1, ${sm_municipality_main_places}, ${sm_district_direct_main_places}) | ||||||||||||||||||||||||
87 | |||||||||||||||||||||||||||
88 | calculate | map_main_places_for_municipality | join(':', ${key}, join(':', ${sm_main_places}, ${key})) | ||||||||||||||||||||||||
89 | end repeat | r_main_places | |||||||||||||||||||||||||
90 | calculate | mapping_main_places_for_municipalities | join(',',${map_main_places_for_municipality}) | ||||||||||||||||||||||||
91 | note | test2 | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
92 | calculate | all_selected_main_places | join(' ', ${sm_main_places}) | ||||||||||||||||||||||||
93 | end group | g_main_places | |||||||||||||||||||||||||
94 | |||||||||||||||||||||||||||
95 | begin group | g_sub_places | field-list | ||||||||||||||||||||||||
96 | calculate | _sps | ../../npo_data/sub_places | ||||||||||||||||||||||||
97 | begin repeat | r_sub_places | Sub Places | count-selected(${all_selected_main_places}) | |||||||||||||||||||||||
98 | calculate | main_place | selected-at(${all_selected_main_places}, position(..)-1) | ||||||||||||||||||||||||
99 | |||||||||||||||||||||||||||
100 | calculate | ext_check | contains(${_sps}, ${main_place}) |