| 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 | ||||||||||||||||||||||||||
8 | end group | ||||||||||||||||||||||||||
9 | begin group | init | NO_LABEL | field-list | |||||||||||||||||||||||
10 | select_one contact | create_new_person | Set the Primary Contact | yes | |||||||||||||||||||||||
11 | db:person | select_person | Select the Primary Contact | yes | selected(${create_new_person},'old_person') | db-object | |||||||||||||||||||||
12 | end group | ||||||||||||||||||||||||||
30 | |||||||||||||||||||||||||||
31 | |||||||||||||||||||||||||||
32 | begin group | begin | field-list | ||||||||||||||||||||||||
33 | string | _name | Organisation name | yes | |||||||||||||||||||||||
34 | select_multiple projects | sm_projects | Projects | minimal | |||||||||||||||||||||||
35 | select_one location_type | so_location_type | Location type | yes | minimal | ||||||||||||||||||||||
36 | calculate | is_rural | if(${so_location_type}!='',if(${so_location_type}='rural',1,0),'') | ||||||||||||||||||||||||
37 | select_multiple districts_rural | sm_rural | Districts | yes | ${is_rural}=1 | minimal | |||||||||||||||||||||
38 | select_multiple districts_metro | sm_metro | Districts | yes | ${is_rural}=0 | minimal | |||||||||||||||||||||
39 | calculate | sm_districts | if(${is_rural}!='',if(${is_rural}=1,${sm_rural},${sm_metro}),'') | ||||||||||||||||||||||||
40 | calculate | sm_district_count | NO_LABEL | count-selected(${sm_districts}) | |||||||||||||||||||||||
41 | string | _external_id | External ID | ||||||||||||||||||||||||
42 | string | _notes | Notes | multiline | |||||||||||||||||||||||
43 | end group | begin | |||||||||||||||||||||||||
44 | |||||||||||||||||||||||||||
45 | |||||||||||||||||||||||||||
46 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
47 | begin repeat | r_municipalities | Municipalities | count-selected(${sm_districts}) | |||||||||||||||||||||||
48 | calculate | district | selected-at(${sm_districts}, position(..)-1) | ||||||||||||||||||||||||
49 | |||||||||||||||||||||||||||
50 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | district=${district} | |||||||||||||||||||||
51 | |||||||||||||||||||||||||||
52 | calculate | map_municipalities_for_district | join(':', ${sm_municipalities}, ${district}) | ||||||||||||||||||||||||
53 | end repeat | r_municipalities | |||||||||||||||||||||||||
54 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
55 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
56 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
57 | end group | g_municipalities | |||||||||||||||||||||||||
58 | |||||||||||||||||||||||||||
59 | |||||||||||||||||||||||||||
60 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
61 | calculate | count | if(${is_rural}!='',if(${is_rural}=1, count-selected(${all_selected_municipalities}), count-selected(${sm_districts})),0) | ||||||||||||||||||||||||
62 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
63 | calculate | district_ | ${is_rural}=1 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
64 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
65 | calculate | key | if(${is_rural}=1, ${municipality}, ${district_}) | ||||||||||||||||||||||||
66 | |||||||||||||||||||||||||||
67 | select_multiple main_places | sm_district_direct_main_places | Select main places for district: ${district_} | yes | ${is_rural}=0 | minimal | district=${district_} and municipality='NONE' | ||||||||||||||||||||
68 | select_multiple main_places | sm_municipality_main_places | Select main places for municipality: ${municipality} | yes | ${is_rural}=1 | minimal | municipality=${municipality} | ||||||||||||||||||||
69 | calculate | sm_main_places | if(${is_rural}=1, ${sm_municipality_main_places}, ${sm_district_direct_main_places}) | ||||||||||||||||||||||||
70 | |||||||||||||||||||||||||||
71 | calculate | map_main_places_for_municipality | join(':', ${sm_main_places}, ${key}) | ||||||||||||||||||||||||
72 | end repeat | r_main_places | |||||||||||||||||||||||||
73 | calculate | mapping_main_places_for_municipalities | join(',',${map_main_places_for_municipality}) | ||||||||||||||||||||||||
74 | note | test2 | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
75 | calculate | all_selected_main_places | join(' ', ${sm_main_places}) | ||||||||||||||||||||||||
76 | end group | g_main_places | |||||||||||||||||||||||||
77 | |||||||||||||||||||||||||||
78 | |||||||||||||||||||||||||||
79 | begin group | g_sub_places | field-list | ||||||||||||||||||||||||
80 | begin repeat | r_sub_places | Sub Places | count-selected(${all_selected_main_places}) | |||||||||||||||||||||||
81 | calculate | main_place | selected-at(${all_selected_main_places}, position(..)-1) | ||||||||||||||||||||||||
82 | |||||||||||||||||||||||||||
83 | select_multiple sub_places | sm_sub_places | Select sub place for main place: ${main_place} | yes | minimal | main_place=${main_place} | |||||||||||||||||||||
84 | |||||||||||||||||||||||||||
85 | calculate | map_sub_places_for_main_place | join(':', ${sm_sub_places}, ${main_place}) | ||||||||||||||||||||||||
86 | end repeat | r_sub_places | |||||||||||||||||||||||||
87 | calculate | mapping_sub_places_for_main_places | join(',',${map_sub_places_for_main_place}) | ||||||||||||||||||||||||
88 | note | test3 | ${mapping_sub_places_for_main_places} | ||||||||||||||||||||||||
89 | end group | g_sub_places | |||||||||||||||||||||||||
90 | |||||||||||||||||||||||||||
91 | |||||||||||||||||||||||||||
92 | begin group | PLACE_TYPE | NO_LABEL | field-list | |||||||||||||||||||||||
93 | hidden | parent | NO_LABEL | PARENT | |||||||||||||||||||||||
94 | hidden | type | NO_LABEL | ||||||||||||||||||||||||
95 | calculate | name | NO_LABEL | ${_name} | |||||||||||||||||||||||
96 | calculate | projects | NO_LABEL | ${sm_projects} | |||||||||||||||||||||||
97 | calculate | location_type | NO_LABEL | ${so_location_type} | |||||||||||||||||||||||
98 | calculate | districts | NO_LABEL | ${sm_districts} | |||||||||||||||||||||||
99 | calculate | municipalities | NO_LABEL | if(${is_rural}=1,${mapping_municipalities_for_districts},'') | |||||||||||||||||||||||
100 | calculate | main_places | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
101 | calculate | sub_places | ${mapping_sub_places_for_main_places} | ||||||||||||||||||||||||
102 | calculate | external_id | External ID | ${_external_id} | |||||||||||||||||||||||
103 | calculate | notes | Notes | multiline | ${_notes} | ||||||||||||||||||||||
104 | calculate | contact | if(selected(${create_new_person},'none'), "", coalesce(${select_person},"NEW")) | ||||||||||||||||||||||||
105 | calculate | geolocation | concat(../../inputs/meta/location/lat, concat(' ', ../../inputs/meta/location/long)) | ||||||||||||||||||||||||
106 | begin group | meta | NO_LABEL | hidden | |||||||||||||||||||||||
107 | calculate | created_by | ../../../inputs/user/name | ||||||||||||||||||||||||
108 | calculate | created_by_person_uuid | ../../../inputs/user/contact_id | ||||||||||||||||||||||||
109 | calculate | created_by_place_uuid | ../../../inputs/user/facility_id | ||||||||||||||||||||||||
110 | end group | ||||||||||||||||||||||||||
111 | end group | ||||||||||||||||||||||||||
112 | |||||||||||||||||||||||||||
113 | |||||||||||||||||||||||||||
114 | |||||||||||||||||||||||||||
115 | |||||||||||||||||||||||||||
116 | |||||||||||||||||||||||||||
117 |