| 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 | note | test1 | Parent via parent variable | ../../PLACE_TYPE/parent | |||||||||||||||||||||||
13 | note | test2 | Parent name | ../../npo_data/name | |||||||||||||||||||||||
14 | note | test3 | Parent sub places | ../../npo_data/sub_places | |||||||||||||||||||||||
15 | note | test4 | Place type translation | ../place_type_translation | |||||||||||||||||||||||
16 | |||||||||||||||||||||||||||
17 | select_one contact | create_new_person | Set the Primary Contact | yes | |||||||||||||||||||||||
18 | db:team_lead | select_person | Select the Primary Contact | yes | selected(${create_new_person},'old_person') | db-object | |||||||||||||||||||||
19 | select_one place_type | place_type | Enter the name of this place | hidden | PLACE_TYPE | ||||||||||||||||||||||
20 | calculate | place_type_translation | jr:choice-name(${place_type},'${place_type}') | ||||||||||||||||||||||||
21 | end group | ||||||||||||||||||||||||||
22 | |||||||||||||||||||||||||||
39 | |||||||||||||||||||||||||||
40 | begin group | begin | field-list | ||||||||||||||||||||||||
41 | string | name | Organisation name | yes | |||||||||||||||||||||||
42 | select_multiple districts_rural | sm_rural | Districts | yes | ${is_rural}=1 | minimal | selected(${districts}, name) | ||||||||||||||||||||
43 | select_multiple districts_metro | sm_metro | Districts | yes | ${is_rural}=0 | minimal | selected(${districts}, name) | ||||||||||||||||||||
44 | calculate | sm_districts | if(${is_rural}!='',if(${is_rural}=1,${sm_rural},${sm_metro}),'') | ||||||||||||||||||||||||
45 | calculate | sm_district_count | NO_LABEL | count-selected(${sm_districts}) | |||||||||||||||||||||||
46 | string | external_id | External ID | ||||||||||||||||||||||||
47 | string | notes | Notes | multiline | |||||||||||||||||||||||
48 | end group | begin | |||||||||||||||||||||||||
49 | |||||||||||||||||||||||||||
50 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
51 | calculate | _ms | ../../npo_data/municipalities | ||||||||||||||||||||||||
52 | begin repeat | r_municipalities | Municipalities | count-selected(${sm_districts}) | |||||||||||||||||||||||
53 | calculate | district | selected-at(${sm_districts}, position(..)-1) | ||||||||||||||||||||||||
54 | |||||||||||||||||||||||||||
55 | calculate | ext_check | contains(${_ms}, ${district}) | ||||||||||||||||||||||||
56 | calculate | ext_start_key | concat(${district}, ':') | ||||||||||||||||||||||||
57 | calculate | ext_end_key | concat(':',${district}) | ||||||||||||||||||||||||
58 | calculate | ext_initial | ../ext_check | substring-after(${_ms},../ext_start_key) | |||||||||||||||||||||||
59 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
60 | note | test | Values | ../ext_values | |||||||||||||||||||||||
61 | |||||||||||||||||||||||||||
62 | select_multiple municipalities | sm_municipalities_initial | Select municipalities for district ${district} | hidden | ../ext_values | district=${district} | |||||||||||||||||||||
63 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | selected(${sm_municipalities_initial}, name) | |||||||||||||||||||||
64 | |||||||||||||||||||||||||||
65 | calculate | map_municipalities_for_district | join(':', ${district},join(':', ${sm_municipalities}, ${district})) | ||||||||||||||||||||||||
66 | end repeat | r_municipalities | |||||||||||||||||||||||||
67 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
68 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
69 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
70 | end group | g_municipalities | |||||||||||||||||||||||||
71 | |||||||||||||||||||||||||||
72 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
73 | calculate | count | if(${is_rural}!='',if(${is_rural}=1, count-selected(${all_selected_municipalities}), count-selected(${sm_districts})),0) | ||||||||||||||||||||||||
74 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
75 | calculate | district_ | ${is_rural}=0 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
76 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
77 | calculate | key | if(${is_rural}=1, ${municipality}, ${district_}) | ||||||||||||||||||||||||
78 | |||||||||||||||||||||||||||
79 | calculate | ext_check | contains(${main_places}, ${key}) | ||||||||||||||||||||||||
80 | calculate | ext_start_key | concat(${key}, ':') | ||||||||||||||||||||||||
81 | calculate | ext_end_key | concat(':',${key}) | ||||||||||||||||||||||||
82 | calculate | ext_initial | ../ext_check | substring-after(${main_places},../ext_start_key) | |||||||||||||||||||||||
83 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
84 | |||||||||||||||||||||||||||
85 | calculate | prev_main_places_rural | if(${location_type}='rural',../ext_values,'') | ||||||||||||||||||||||||
86 | calculate | prev_main_places_metro | if(${location_type}='metro',../ext_values,'') | ||||||||||||||||||||||||
87 | |||||||||||||||||||||||||||
88 | 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' | ||||||||||||||||||||
89 | 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) | ||||||||||||||||||||
90 | 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} | ||||||||||||||||||||
91 | 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) | ||||||||||||||||||||
92 | calculate | sm_main_places | if(${is_rural}=1, ${sm_municipality_main_places}, ${sm_district_direct_main_places}) | ||||||||||||||||||||||||
93 | |||||||||||||||||||||||||||
94 | calculate | map_main_places_for_municipality | join(':', ${key}, join(':', ${sm_main_places}, ${key})) | ||||||||||||||||||||||||
95 | end repeat | r_main_places | |||||||||||||||||||||||||
96 | calculate | mapping_main_places_for_municipalities | join(',',${map_main_places_for_municipality}) | ||||||||||||||||||||||||
97 | note | test2 | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
98 | calculate | all_selected_main_places | join(' ', ${sm_main_places}) | ||||||||||||||||||||||||
99 | end group | g_main_places | |||||||||||||||||||||||||
100 | |||||||||||||||||||||||||||
101 | begin group | g_sub_places | field-list | ||||||||||||||||||||||||
102 | calculate | _sps | ../../npo_data/sub_places | ||||||||||||||||||||||||
103 | begin repeat | r_sub_places | Sub Places | count-selected(${all_selected_main_places}) | |||||||||||||||||||||||
104 | calculate | main_place | selected-at(${all_selected_main_places}, position(..)-1) | ||||||||||||||||||||||||
105 | |||||||||||||||||||||||||||
106 | calculate | ext_check | contains(${_sps}, ${main_place}) | ||||||||||||||||||||||||
107 | calculate | ext_start_key | concat(${main_place}, ':') | ||||||||||||||||||||||||
108 | calculate | ext_end_key | concat(':',${main_place}) | ||||||||||||||||||||||||
109 | calculate | ext_initial | ../ext_check | substring-after(${_sps},../ext_start_key) | |||||||||||||||||||||||
110 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
111 | |||||||||||||||||||||||||||
112 | select_multiple sub_places | sm_sub_places_initial | Select sub place for main place: ${main_place} | hidden | ../ext_values | main_place=${main_place} | |||||||||||||||||||||
113 | select_multiple sub_places | sm_sub_places | Select sub place for main place: ${main_place} | yes | minimal | selected(${sm_sub_places_initial}, name) | |||||||||||||||||||||
114 | |||||||||||||||||||||||||||
115 | calculate | map_sub_places_for_main_place | join(':', ${main_place},join(':', ${sm_sub_places}, ${main_place})) | ||||||||||||||||||||||||
116 | end repeat | r_sub_places |