ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJ
1
typenamelabel::en
required
relevantappearanceread_onlyconstraintconstraint_messagecalculationchoice_filterhint::endefaultnotes
repeat_count
trigger
2
begin groupinputsNO_LABELFALSE
3
begin groupuserNO_LABEL
4
stringcontact_idNO_LABEL
Contact ID of the logged in user
5
stringfacility_idNO_LABEL
Place ID of the logged in user
6
stringnameNO_LABEL
Name of the logged in user
7
end group
8
end group
9
10
11
begin groupstartfield-list
12
begin grouplookupNO_LABELhidden
13
string_idNO_LABEL
select-contact type-dwelling
../../../PLACE_TYPE/parent
14
stringnameNO_LABEL
15
stringparent_place_name../name
16
end grouplookup
17
notenote_place
Belongs to **${parent_place_name}**
18
19
calculateprev_nameonce(../../PLACE_TYPE/name)
20
calculateprev_reg_dateonce(../../PLACE_TYPE/reg_date)
21
calculateprev_additional_address_infoonce(../../PLACE_TYPE/additional_address_info)
22
calculateprev_consentonce(../../PLACE_TYPE/consent_granted)
23
calculateprev_share_dataonce(../../PLACE_TYPE/share_data_granted)
24
calculateprev_contactonce(../../PLACE_TYPE/contact/_id)
25
26
stringnameHousehold Nameyesstring-length(.) <= 50A name can be maximum 50 characters long.once(../prev_name)
27
datereg_dateHousehold Registration Dateyes. <= now()A future date can not be selectedonce(../prev_reg_date)
28
stringadditional_address_infoAdditional address informationonce(../prev_additional_address_info)
29
select_one yes_noconsent_granted
Was verbal consent received for COPC services?
yesonce(../prev_consent)
30
select_one yes_noshare_data_granted
Do you grant permission for data to be shared with the Department of Health?
yesstring(../consent_granted)='yes'once(../prev_share_data)
31
32
end group
33
34
begin groupinitNO_LABELstring(../start/consent_granted)='yes'field-list
35
select_one contactcreate_new_personSet the household headyesstring(../../start/consent_granted)='yes'once(if(../../start/prev_contact != '', 'old_person', ''))
36
begin grouplookupNO_LABEL
string(../../start/consent_granted)='yes' and selected(${create_new_person},'old_person')
37
stringselect_personSelect the household headyes
select-contact type-hhm
${selected_years} > 9
Please ensure the household head is 9 years or older.
once(../../../start/prev_contact)
38
hiddendate_of_birthRetrieves value from above selection
39
integerselected_yearshidden
cht:extension-lib(“date_diff.js”, ../date_of_birth, substring-before(now(),'T'),"years")
40
end grouplookup
41
end group
42
43
begin groupcontactNew Personselected(${create_new_person},'new_person')field-list
44
hiddenparentNO_LABELPARENT
45
hiddentypeNO_LABELcontact
46
stringfirst_nameFirst Nameyesstring-length(.) <= 20A first name can be maximum 20 characters long.
47
stringmiddle_nameMiddle Namestring-length(.) <= 20A first name can be maximum 20 characters long.
48
stringlast_nameSurname/Last Nameyesstring-length(.) <= 20
A surname/last name can be maximum 20 characters long.
49
stringmaiden_nameMaiden Namestring-length(.) <= 20A last name can be maximum 20 characters long.
50
calculatenameNO_LABELjoin(' ',${first_name}, ${last_name})
51
52
select_one yes_noresidentResident *member* of household?yeshorizontal
53
begin groupnon_residentstring(../resident)='no'
54
select_one non_resident_areaarea
Where does this person live most of the time (Residential Address area)
yesminimal
Add a lookup for each selection that can be made
55
stringaddressResidential Address detailsmultilinestring-length(.) <= 250
56
end group
57
58
stringphone_rawCell Numberselected(${create_new_person},'new_person')regex(., "^(?:\+27|0)\d{9}$")
Please enter a number starting with zero (0) or a plus sign (+) followed by 27. For example: 0xx xxx xxxx OR +27xx xxx xxxx
59
calculatephonestring-length(${phone_raw}) > 9
if(starts-with(${phone_raw}, "+27"), ${phone_raw},concat("+27", substr(${phone_raw}, 1, string-length(${phone_raw}))))
60
stringphone_raw_altAlternate Cell Numberselected(${create_new_person},'new_person')regex(., "^(?:\+27|0)\d{9}$")
Please enter a number starting with zero (0) or a plus sign (+) followed by 27. For example: 0xx xxx xxxx OR +27xx xxx xxxx
61
calculatephone_altstring-length(${phone_raw_alt}) > 9
if(starts-with(${phone_raw_alt}, "+27"), ${phone_raw_alt},concat("+27", substr(${phone_raw_alt}, 1, string-length(${phone_raw_alt}))))
62
select_one details_obtainedobtained_personal_detailsWere civilian ID details obtained?yesselected(${create_new_person},'new_person')horizontal
63
stringid_numberWhat is the Civilian ID Numberyes
string(../obtained_personal_details)!='' and string(../obtained_personal_details)!='no'
string(.)='9999999999999' or cht:extension-lib("validate_id.js", .)
A valid 13-digit ID number is required. If no ID number is available, then enter 9 thirteen times, e.g. 9999999999999.
64
integerpmi_numberPMI/Clinic Numberselected(${create_new_person},'new_person')number(.) > 0A PMI number cannot be negative or 0.
65
select_one male_femalesexSexyesselected(${create_new_person},'new_person')horizontal
66
datedate_of_birthDate of Birthyesselected(${create_new_person},'new_person'). <= now()Date of birth cannot be in the future
67
select_one dob_methoddob_methodIs this a confirmed or estimated DOB?yesselected(${create_new_person},'new_person')horizontal
68
69
integerweekshidden
cht:extension-lib(“date_diff.js”, ../date_of_birth, substring-before(now(),'T'),"weeks")
70
integermonthshidden
cht:extension-lib(“date_diff.js”, ../date_of_birth, substring-before(now(),'T'),"months")
71
integeryearshidden
cht:extension-lib(“date_diff.js”, ../date_of_birth, substring-before(now(),'T'),"years")
72
calculateage_unit
if(../date_of_birth != '', if(../years >= 5, "Years", if(../weeks > 14,"Months","Weeks")), 'Years')
73
integerageAge (${age_unit})yesselected(${create_new_person},'new_person')TRUE. >= 9 and . < 120
Please ensure the household head is 9 years or older.
if(../years >= 5, ../years, if(../weeks > 14, ../months, ../weeks))
74
75
select_one when_memberwhen_member
When did this person become a household member?
yesselected(${create_new_person},'new_person')
76
datemembership_start_dateMembership start dateyesstring(../when_member)='on_in_migration'
. <= now() and . > ../date_of_birth
Date cannot be in the future and has to be after birth.
77
hiddencontact_typeNO_LABELminimalhhm
78
begin groupmetaNO_LABELhidden
79
calculatecreated_by../../../inputs/user/name
80
calculatecreated_by_person_uuid../../../inputs/user/contact_id
81
calculatecreated_by_place_uuid../../../inputs/user/facility_id
82
startform_start
This field captures when the form is opened. It will be used in conjunction with the `reported_date` to calculate form completion duration. This is because the `end` question type has a known bug: https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416
83
end group
84
end group
85
86
begin groupPLACE_TYPENO_LABELfield-list
87
hiddenparentNO_LABELPARENT
88
hiddentypeNO_LABEL
89
90
calculatename../../start/name
91
calculatereg_date../../start/reg_date
92
calculateadditional_address_info../../start/additional_address_info
93
calculateconsent_granted../../start/consent_granted
94
calculateshare_data_granted../../start/share_data_granted
95
96
begin groupcontact
97
calculate_id
if(selected(../../consent_granted,'no'), "", coalesce(${select_person},"NEW"))
98
end groupcontact
99
calculategeolocation
concat(../../inputs/meta/location/lat, concat(' ', ../../inputs/meta/location/long))
100
begin groupmetaNO_LABELhidden