| 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 | trigger | |||||||||||
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 | ||||||||||||||||||||||||||
8 | end group | ||||||||||||||||||||||||||
9 | |||||||||||||||||||||||||||
10 | |||||||||||||||||||||||||||
11 | begin group | init | NO_LABEL | field-list | Updated to be a group, due to 3889 | ||||||||||||||||||||||
12 | calculate | parent_districts | NO_LABEL | once(../npo_data/districts) | For referencing puproses | ||||||||||||||||||||||
13 | calculate | parent_municipalities | NO_LABEL | once(../npo_data/municipalities) | For referencing puproses | ||||||||||||||||||||||
14 | calculate | parent_main_places | NO_LABEL | once(../npo_data/main_places) | For referencing puproses | ||||||||||||||||||||||
15 | calculate | parent_sub_places | NO_LABEL | once(../npo_data/sub_places) | For referencing puproses | ||||||||||||||||||||||
16 | calculate | is_rural | NO_LABEL | once(if(${location_type}!='',if(${location_type}='rural',1,0),'')) | For referencing puproses | ||||||||||||||||||||||
17 | note | test1 | Parent districts | ${parent_districts} | |||||||||||||||||||||||
18 | note | test2 | Parent municipalities | ${parent_municipalities} | |||||||||||||||||||||||
19 | note | test3 | Parent main places | ${parent_main_places} | |||||||||||||||||||||||
20 | note | test4 | Parent sub places | ${parent_sub_places} | |||||||||||||||||||||||
21 | begin group | npo_data | NO_LABEL | hidden | |||||||||||||||||||||||
22 | string | _id | NO_LABEL | select-contact type-npo | ../../../PLACE_TYPE/parent | ||||||||||||||||||||||
23 | string | name | NO_LABEL | ||||||||||||||||||||||||
24 | string | location_type | NO_LABEL | ||||||||||||||||||||||||
25 | string | districts | NO_LABEL | ||||||||||||||||||||||||
26 | string | municipalities | NO_LABEL | ||||||||||||||||||||||||
27 | string | main_places | NO_LABEL | ||||||||||||||||||||||||
28 | string | sub_places | NO_LABEL | ||||||||||||||||||||||||
29 | end group | npo_data | |||||||||||||||||||||||||
30 | |||||||||||||||||||||||||||
31 | calculate | prev_districts | NO_LABEL | once(../../PLACE_TYPE/districts) | |||||||||||||||||||||||
32 | calculate | prev_districts_rural | NO_LABEL | once(if(${is_rural}=1,${prev_districts},'')) | |||||||||||||||||||||||
33 | calculate | prev_districts_metro | NO_LABEL | once(if(${is_rural}=0,${prev_districts},'')) | |||||||||||||||||||||||
34 | calculate | prev_municipalities | NO_LABEL | once(../../PLACE_TYPE/municipalities) | |||||||||||||||||||||||
35 | calculate | prev_main_places | NO_LABEL | once(../../PLACE_TYPE/main_places) | |||||||||||||||||||||||
36 | calculate | prev_sub_places | NO_LABEL | once(../../PLACE_TYPE/sub_places) | |||||||||||||||||||||||
37 | |||||||||||||||||||||||||||
38 | begin group | contact | |||||||||||||||||||||||||
39 | string | _id | Primary Contact | select-contact type-team_lead | once(../../../PLACE_TYPE/contact/_id) | Select the Primary Contact | |||||||||||||||||||||
40 | end group | ||||||||||||||||||||||||||
41 | string | name | Name | yes | once(../../PLACE_TYPE/name) | ||||||||||||||||||||||
42 | select_multiple districts_rural | sm_rural | Districts | yes | ${is_rural}=1 | minimal | once(${prev_districts_rural}) | selected(${parent_districts}, name) | |||||||||||||||||||
43 | select_multiple districts_metro | sm_metro | Districts | yes | ${is_rural}=0 | minimal | once(${prev_districts_metro}) | selected(${parent_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 | once(../../PLACE_TYPE/external_id) | |||||||||||||||||||||||
47 | string | notes | Notes | multiline | once(../../PLACE_TYPE/notes) | ||||||||||||||||||||||
48 | end group | ||||||||||||||||||||||||||
49 | |||||||||||||||||||||||||||
50 | |||||||||||||||||||||||||||
51 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
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(${prev_municipalities}, ${district}) | ||||||||||||||||||||||||
56 | calculate | ext_start_key | concat(${district}, ':') | ||||||||||||||||||||||||
57 | calculate | ext_end_key | concat(':',${district}) | ||||||||||||||||||||||||
58 | calculate | ext_initial | ../ext_check | substring-after(${prev_municipalities},../ext_start_key) | |||||||||||||||||||||||
59 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
60 | |||||||||||||||||||||||||||
61 | calculate | parent_values_initial | substring-after(${parent_municipalities},../ext_start_key) | ||||||||||||||||||||||||
62 | calculate | parent_municipality_values | substring-before(../parent_values_initial,../ext_end_key) | ||||||||||||||||||||||||
63 | |||||||||||||||||||||||||||
64 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | once(../ext_values) | selected(${parent_municipality_values}, name) | ||||||||||||||||||||
65 | |||||||||||||||||||||||||||
66 | calculate | map_municipalities_for_district | join(':', ${district},join(':', ${sm_municipalities}, ${district})) | ||||||||||||||||||||||||
67 | end repeat | r_municipalities | |||||||||||||||||||||||||
68 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
69 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
70 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
71 | end group | g_municipalities | |||||||||||||||||||||||||
72 | |||||||||||||||||||||||||||
73 | |||||||||||||||||||||||||||
74 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
75 | calculate | count | if(${is_rural}!='',if(${is_rural}=1, count-selected(${all_selected_municipalities}), count-selected(${sm_districts})),0) | ||||||||||||||||||||||||
76 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
77 | calculate | district_ | ${is_rural}=0 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
78 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
79 | calculate | key | if(${is_rural}=1, ${municipality}, ${district_}) | ||||||||||||||||||||||||
80 | |||||||||||||||||||||||||||
81 | calculate | ext_check | contains(${prev_main_places}, ${key}) | ||||||||||||||||||||||||
82 | calculate | ext_start_key | concat(${key}, ':') | ||||||||||||||||||||||||
83 | calculate | ext_end_key | concat(':',${key}) | ||||||||||||||||||||||||
84 | calculate | ext_initial | ../ext_check | substring-after(${prev_main_places},../ext_start_key) | |||||||||||||||||||||||
85 | calculate | ext_values | ../ext_check | substring-before(../ext_initial,../ext_end_key) | |||||||||||||||||||||||
86 | calculate | ext_values_rural | if(${is_rural}=1,../ext_values,'') | ||||||||||||||||||||||||
87 | calculate | ext_values_metro | if(${is_rural}=0,../ext_values,'') | ||||||||||||||||||||||||
88 | |||||||||||||||||||||||||||
89 | calculate | parent_values_initial | substring-after(${parent_main_places},../ext_start_key) | ||||||||||||||||||||||||
90 | calculate | parent_main_place_values | substring-before(../parent_values_initial,../ext_end_key) | ||||||||||||||||||||||||
91 | |||||||||||||||||||||||||||
92 | select_multiple main_places | sm_district_direct_main_places | Select main places for district: ${district_} | yes | ${is_rural}=0 | minimal | once(${ext_values_metro}) | selected(${parent_main_place_values}, name) | |||||||||||||||||||
93 | select_multiple main_places | sm_municipality_main_places | Select main places for municipality: ${municipality} | yes | ${is_rural}=1 | minimal | once(${ext_values_rural}) | selected(${parent_main_place_values}, name) | |||||||||||||||||||
94 | calculate | sm_main_places | if(${is_rural}=1, ${sm_municipality_main_places}, ${sm_district_direct_main_places}) | ||||||||||||||||||||||||
95 | |||||||||||||||||||||||||||
96 | calculate | map_main_places_for_municipality | join(':', ${key}, join(':', ${sm_main_places}, ${key})) | ||||||||||||||||||||||||
97 | end repeat | r_main_places | |||||||||||||||||||||||||
98 | calculate | mapping_main_places_for_municipalities | join(',',${map_main_places_for_municipality}) | ||||||||||||||||||||||||
99 | note | test2 | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
100 | calculate | all_selected_main_places | join(' ', ${sm_main_places}) |