| 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 | ||||||||||||||||||||||||||
13 | |||||||||||||||||||||||||||
14 | begin group | begin | field-list | ||||||||||||||||||||||||
15 | string | _name | Organisation name | yes | |||||||||||||||||||||||
16 | select_multiple projects | sm_projects | Projects | minimal | |||||||||||||||||||||||
17 | select_one location_type | so_location_type | Location type | yes | minimal | ||||||||||||||||||||||
18 | calculate | is_rural | if(${so_location_type}='rural',1,0) | ||||||||||||||||||||||||
19 | select_multiple districts | sm_districts | Districts | yes | minimal | is_rural=${is_rural} | |||||||||||||||||||||
20 | calculate | sm_district_count | NO_LABEL | count-selected(${sm_districts}) | |||||||||||||||||||||||
21 | string | _external_id | External ID | ||||||||||||||||||||||||
22 | string | _notes | Notes | multiline | |||||||||||||||||||||||
23 | end group | begin | |||||||||||||||||||||||||
24 | |||||||||||||||||||||||||||
41 | |||||||||||||||||||||||||||
42 | |||||||||||||||||||||||||||
43 | begin group | g_municipalities | ${is_rural}=1 | field-list | |||||||||||||||||||||||
44 | begin repeat | r_municipalities | Municipalities | count-selected(${sm_districts}) | |||||||||||||||||||||||
45 | calculate | district | selected-at(${sm_districts}, position(..)-1) | ||||||||||||||||||||||||
46 | |||||||||||||||||||||||||||
47 | select_multiple municipalities | sm_municipalities | Select municipalities for district ${district} | yes | minimal | district=${district} | |||||||||||||||||||||
48 | |||||||||||||||||||||||||||
49 | calculate | map_municipalities_for_district | join(':', ${sm_municipalities}, ${district}) | ||||||||||||||||||||||||
50 | end repeat | r_municipalities | |||||||||||||||||||||||||
51 | calculate | mapping_municipalities_for_districts | join(',',${map_municipalities_for_district}) | ||||||||||||||||||||||||
52 | note | test1 | ${mapping_municipalities_for_districts} | ||||||||||||||||||||||||
53 | calculate | all_selected_municipalities | join(' ', ${sm_municipalities}) | ||||||||||||||||||||||||
54 | end group | g_municipalities | |||||||||||||||||||||||||
55 | |||||||||||||||||||||||||||
56 | |||||||||||||||||||||||||||
57 | begin group | g_main_places | field-list | ||||||||||||||||||||||||
58 | calculate | count | if(${is_rural}=1,count-selected(${all_selected_municipalities}),count-selected(${sm_districts})) | ||||||||||||||||||||||||
59 | note | test3 | ${count} | ||||||||||||||||||||||||
60 | begin repeat | r_main_places | Main Places | ${count} | |||||||||||||||||||||||
61 | calculate | district_ | ${is_rural}=0 | selected-at(${sm_districts}, position(..)-1) | |||||||||||||||||||||||
62 | note | district_note | ${is_rural}=0 | ${district_} | |||||||||||||||||||||||
63 | calculate | municipality | selected-at(${all_selected_municipalities}, position(..)-1) | ||||||||||||||||||||||||
64 | |||||||||||||||||||||||||||
65 | calculate | key_parent | if(${is_rural}=1,${municipality},${district_}) | ||||||||||||||||||||||||
66 | calculate | parent_string | if(${is_rural}=1,'municipality','district') | ||||||||||||||||||||||||
67 | |||||||||||||||||||||||||||
68 | select_multiple main_places | sm_main_places | Select main places for ${parent_string}: ${key_parent} | yes | minimal | municipality=${municipality} | |||||||||||||||||||||
69 | |||||||||||||||||||||||||||
70 | calculate | map_main_places_for_municipality | join(':', ${sm_main_places}, ${key_parent}) | ||||||||||||||||||||||||
71 | end repeat | r_main_places | |||||||||||||||||||||||||
72 | calculate | mapping_main_places_for_municipalities | join(',',${map_main_places_for_municipality}) | ||||||||||||||||||||||||
73 | note | test2 | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
74 | calculate | all_selected_main_places | join(' ', ${sm_main_places}) | ||||||||||||||||||||||||
75 | end group | g_main_places | |||||||||||||||||||||||||
76 | |||||||||||||||||||||||||||
77 | |||||||||||||||||||||||||||
78 | begin group | g_sub_places | field-list | ||||||||||||||||||||||||
79 | begin repeat | r_sub_places | Sub Places | count-selected(${all_selected_main_places}) | |||||||||||||||||||||||
80 | calculate | main_place | selected-at(${all_selected_main_places}, position(..)-1) | ||||||||||||||||||||||||
81 | |||||||||||||||||||||||||||
82 | select_multiple sub_places | sm_sub_places | Select sub place for main place: ${main_place} | yes | minimal | main_place=${main_place} | |||||||||||||||||||||
83 | |||||||||||||||||||||||||||
84 | calculate | map_sub_places_for_main_place | join(':', ${sm_sub_places}, ${main_place}) | ||||||||||||||||||||||||
85 | end repeat | r_sub_places | |||||||||||||||||||||||||
86 | calculate | mapping_sub_places_for_main_places | join(',',${map_sub_places_for_main_place}) | ||||||||||||||||||||||||
87 | note | test3 | ${mapping_sub_places_for_main_places} | ||||||||||||||||||||||||
88 | end group | g_sub_places | |||||||||||||||||||||||||
89 | |||||||||||||||||||||||||||
90 | |||||||||||||||||||||||||||
91 | begin group | PLACE_TYPE | NO_LABEL | field-list | |||||||||||||||||||||||
92 | hidden | parent | NO_LABEL | PARENT | |||||||||||||||||||||||
93 | hidden | type | NO_LABEL | ||||||||||||||||||||||||
94 | calculate | name | NO_LABEL | ${_name} | |||||||||||||||||||||||
95 | calculate | projects | NO_LABEL | ${sm_projects} | |||||||||||||||||||||||
96 | calculate | location_type | NO_LABEL | ${so_location_type} | |||||||||||||||||||||||
97 | calculate | districts | NO_LABEL | ${sm_districts} | |||||||||||||||||||||||
98 | calculate | municipalities | NO_LABEL | ${mapping_municipalities_for_districts} | |||||||||||||||||||||||
99 | calculate | main_places | ${mapping_main_places_for_municipalities} | ||||||||||||||||||||||||
100 | calculate | sub_places | ${mapping_sub_places_for_main_places} | ||||||||||||||||||||||||
101 | calculate | external_id | External ID | ${_external_id} | |||||||||||||||||||||||
102 | calculate | notes | Notes | multiline | ${_notes} | ||||||||||||||||||||||
103 | calculate | contact | if(selected(${create_new_person},'none'), "", coalesce(${select_person},"NEW")) | ||||||||||||||||||||||||
104 | calculate | geolocation | concat(../../inputs/meta/location/lat, concat(' ', ../../inputs/meta/location/long)) | ||||||||||||||||||||||||
105 | begin group | meta | NO_LABEL | hidden | |||||||||||||||||||||||
106 | calculate | created_by | ../../../inputs/user/name | ||||||||||||||||||||||||
107 | calculate | created_by_person_uuid | ../../../inputs/user/contact_id | ||||||||||||||||||||||||
108 | calculate | created_by_place_uuid | ../../../inputs/user/facility_id | ||||||||||||||||||||||||
109 | end group | ||||||||||||||||||||||||||
110 | end group | ||||||||||||||||||||||||||
111 | |||||||||||||||||||||||||||
112 | |||||||||||||||||||||||||||
113 | |||||||||||||||||||||||||||
114 | |||||||||||||||||||||||||||
115 | |||||||||||||||||||||||||||
116 |