-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRegistration Form.html
297 lines (284 loc) · 14.9 KB
/
Registration Form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/muzima.css" rel="stylesheet">
<link href="css/ui-darkness/jquery-ui-1.10.4.custom.min.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/additional-methods.min.js"></script>
<script src="js/muzima.js"></script>
<title>Registration Form</title>
</head>
<body class="col-md-8 col-md-offset-2">
<div id="result"></div>
<form id="registration_form" name="registration_form">
<div id="pre_populate_data">
</div>
<h2 class="text-center">Registration Form</h2>
<div class="section">
<fieldset>
<div class="form-group">
<label for="encounter.location_id">Encounter Location:<span class="required">*</span></label>
<input class="form-control valid-location-only" id="encounter.location_id" type="text" placeholder="Start typing something..." required="required">
<input class="form-control" name="encounter.location_id" type="hidden">
</div>
<div class="form-group hidden">
<label for="encounter.location_id_select">Encounter Location <span class="required">*</span></label>
<select class="form-control" id="encounter.location_id_select" required="required">
<option>...</option>
</select>
</div>
<div class="form-group">
<label for="encounter.provider_id_select">Provider Name:</label>
<input class="form-control valid-provider-only" id="encounter.provider_id_select" type="text" placeholder="Start typing something...">
<input class="form-control" name="encounter.provider_id_select" type="hidden">
</div>
<div class="form-group hidden">
<select id="select_providers">
</select>
</div>
<div class="form-group show_provider_id_text">
<label for="encounter.provider_id">Provider's system-id:<span class="required">*</span></label>
<input class="form-control checkDigit" id="encounter.provider_id" name="encounter.provider_id"
type="text" required="required" disabled="disabled">
</div>
<div class="form-group">
<label for="encounter.encounter_datetime">Encounter Date <span class="required">*</span></label>
<input class="form-control nonFutureDate past-date datepicker" readonly="readonly" id="encounter.encounter_datetime"
name="encounter.encounter_datetime" type="text" required="required">
</div>
<div class="form-group">
<input class="form-control" id="encounter.form_uuid" name="encounter.form_uuid"
type="hidden" required="required">
</div>
</fieldset>
</div>
<div class="section">
<fieldset>
<h3>Names</h3>
<div class="form-group">
<input class="form-control" id="patient.uuid"
name="patient.uuid" type="hidden" readonly="readonly">
</div>
<div class="form-group">
<label for="patient.family_name">Family Name: <span class="required">*</span> </label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text"
required="required">
</div>
<div class="form-group">
<label for="patient.middle_name">Middle Name:</label>
<input class="form-control" id="patient.middle_name" name="patient.middle_name" type="text">
</div>
<div class="form-group">
<label for="patient.given_name">First Name: <span class="required">*</span></label>
<input class="form-control" id="patient.given_name" name="patient.given_name" type="text"
required="required">
</div>
</fieldset>
</div>
<div class="section">
<fieldset>
<h3>Attributes</h3>
<div class="form-group group-set" data-group="patient.personattribute^2">
<label for="patient.phone_number">Phone: </label>
<input class="form-control phoneNumber" id="patient.phone_number" name="attribute_value" type="tel">
<input type="hidden" id="attribute_type_namepn" name="attribute_type_name" value="Phone number">
<input type="hidden" id="attribute_type_uuida" name="attribute_type_uuid" value="d6bcc287-4576-4264-961b-6bf1c08fbf68">
</div>
<div class="form-group group-set" data-group="patient.personattribute^3">
<label for="patient.contact_person_name">Name of contact person: </label>
<input class="form-control" id="patient.contact_person_name" name="attribute_value" type="text">
<input type="hidden" id="attribute_type_nameat" name="attribute_type_name" value="Contact Person's Name">
<input type="hidden" id="attribute_type_uuiday" name="attribute_type_uuid" value="99cc76cc-3914-11e7-a919-92ebcb67fe33">
</div>
<div class="form-group group-set" data-group="patient.personattribute^4">
<label for="patient.contact_Person_phone_number">Contact person phone: </label>
<input class="form-control phoneNumber" id="patient.contact_Person_phone_number" name="attribute_value" type="tel">
<input type="hidden" id="attribute_type_nameap" name="attribute_type_name" value="Contact Person's Phone Number">
<input type="hidden" id="attribute_type_uuidd9" name="attribute_type_uuid" value="99cc76cc-3914-11e7-a919-92ebcb67fe44">
</div>
<div class="form-group group-set" data-group="patient.personattribute^1">
<label for="patient.health_facility">Health Facility: <span
class="required">*</span></label>
<input class="form-control healthFacility" id="patient.health_facility" name="attribute_value" type="text" required="required">
<input type="hidden" id="attribute_type_namehf" name="attribute_type_name" value="Health Facility">
<input type="hidden" id="attribute_type_uuid" name="attribute_type_uuid" value="8d87236c-c2cc-11de-8d13-0010c6dffd0f">
</div>
</fieldset>
</div>
<div class="section group-set" data-group="patient.personaddress">
<fieldset>
<h3>Address</h3>
<div class="form-group">
<label for="country">Country: </label>
<input class="form-control" id="country" name="country" type="text">
</div>
<div class="form-group">
<label for="stateProvince">Province: </label>
<input class="form-control" id="stateProvince" name="stateProvince" type="text">
</div>
<div class="form-group">
<label for="countyDistrict">District: </label>
<input class="form-control" id="countyDistrict" name="countyDistrict" type="text">
</div>
<div class="form-group">
<label for="cityVillage">Sector: </label>
<input class="form-control" id="cityVillage" name="cityVillage" type="text">
</div>
<div class="form-group">
<label for="address3">Cell: </label>
<input class="form-control" id="address3" name="address3" type="text">
</div>
<div class="form-group">
<label for="address1">Umudugudu: </label>
<input class="form-control" id="address1" name="address1" type="text">
</div>
</fieldset>
</div>
<div class="section">
<fieldset>
<h3>Identifiers</h3>
<div class="form-group">
<label for="patient.medical_record_number">Identifier : <span
class="required">*</span></label>
<div class="form-horizontal">
<div class="group-set" data-group="patient.medical_record_number">
<input type="button" class='btn barcode_btn'>
<input class="barcode_text form-control" id="identifier_value"
name="identifier_value" type="text" required="required">
<input type="hidden" id="attribute_type_nameai" name="attribute_type_name" value="ARCHIVING ID">
<input type="hidden" id="identifier_type_uuidiu" name="identifier_type_uuid" value="3c25bc40-8064-4b2a-a2cd-3493a3cfa4f3">
</div>
</div>
</div>
<div class="form-group">
<label for="patient.NatioanlId">National ID : </label>
<div class="form-horizontal">
<div class="group-set" data-group="patient.National_ID">
<input class="form-control" id="patient.NatioanlId"
name="patient.NatioanlId" type="text" >
<input type="hidden" id="attribute_type_name" name="attribute_type_name" value="NID number">
<input type="hidden" id="identifier_type_uuid" name="identifier_type_uuid" value="85c63542-587f-476c-9e69-c733bd285a57">
</div>
</div>
</div>
</fieldset>
</div>
<div class="section">
<fieldset>
<div class="form-group">
<label for="patient.sex">Sex: <span class="required">*</span></label>
<select class="form-control" id="patient.sex" name="patient.sex" required="required">
<option value="">...</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</div>
<div class="form-group">
<label for="tmp.birthdate_type">Will Record Date of Birth... <span class="required">*</span></label>
<select class="form-control" name="tmp.birthdate_type" id="tmp.birthdate_type" required="required">
<option value="">...</option>
<option value="birthdate">By Birth-date</option>
<option value="age">By Age</option>
</select>
</div>
<div class="form-group show_birthdate">
<label for="patient.birth_date">Select Birthdate <span class="required">*</span></label>
<input class="form-control birth_date_picker nonFutureDate past-date" id="patient.birth_date" name="patient.birth_date"
type="text" required="required" readonly="readonly">
</div>
<div class="form-group show_birthdate">
<label for="patient.birthdate_estimated">Is this birthdate an estimate? <span
class="required">*</span></label>
<select class="form-control" id="patient.birthdate_estimated" name="patient.birthdate_estimated"
required="required">
<option>...</option>
<option value="true">Yes</option>
<option value="false">No</option>
</select>
</div>
<div class="form-group show_age">
<label for="tmp.age_in_years">How old are you in Years <span class="required">*</span></label>
<input class="form-control" id="tmp.age_in_years" name="tmp.age_in_years" type="number" required="required">
</div>
</fieldset>
</div>
</form>
</body>
<script type="text/javascript">
$(document).ready(function () {
var dateFormat = "dd-mm-yy";
var currentDate = $.datepicker.formatDate(dateFormat, new Date());
var encounterDatetime = $('#encounter\\.encounter_datetime');
if ($(encounterDatetime).val() == "") {
$(encounterDatetime).val(currentDate);
}
var currentYear = new Date().getFullYear();
var birthdate_start_year = currentYear - 140;
$('.birth_date_picker').datepicker({
dateFormat: dateFormat,
changeMonth: true,
changeYear: true,
yearRange: birthdate_start_year + ':' + currentYear,
});
$('#save_draft').click(function () {
// pre process the medications
$(this).prop('disabled', true);
document.saveDraft(this);
$(this).prop('disabled', false);
});
$('#submit_form').click(function () {
// pre process the medications
$(this).prop('disabled', true);
document.submit();
$(this).prop('disabled', false);
});
$.fn.calculateFields = function () {
var tempAgeInYears = $.trim($("#tmp\\.age_in_years").val());
if (tempAgeInYears != '') {
$('#patient\\.birthdate_estimated').val('true');
$('#patient\\.birth_date').val($.fn.getTempBirthDate(tempAgeInYears));
}
return true;
};
$.fn.customValidationCheck = function () {
return $.fn.calculateFields();
};
var dobType = $('#tmp\\.birthdate_type');
dobType.change(function () {
var $show_birth_date = $('.show_birthdate');
var $show_age = $('.show_age');
if ($('#tmp\\.birthdate_type').val() == 'age') {
$show_age.show();
$show_birth_date.find('input').val('');
$show_birth_date.hide();
} else {
$show_age.hide();
$show_age.find('input').val('');
$show_birth_date.show();
}
});
dobType.trigger('change');
document.setupAutoCompleteData('encounter\\.location_id');
document.setupAutoCompleteDataForProvider('encounter\\.provider_id_select');
$('#registration_form').validate({rules: {
'tmp.age_in_years': {
range: [0, 120]
}
}
});
document.setupValidationForProvider("$('#encounter\\.provider_id_select').val()","encounter\\.provider_id");
document.setupValidationForLocation("$('#encounter\\.location_id').val()","encounter\\.location_id");
//Function to set health facility whenever the encounter location is change
$('#encounter\\.location_id').change(function(){
var selected_health_facility_id = $('input[name="encounter.location_id"]').val();
console.log("FFF: "+selected_health_facility_id);
$('#patient\\.health_facility').val(selected_health_facility_id);
});
//trigger a change event so as to set the initial value on form load
$('#encounter\\.location_id').trigger('change');
});
</script>
</html>