-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathGenericRegistrationTestFormWithObs.html
More file actions
348 lines (322 loc) · 16.2 KB
/
Copy pathGenericRegistrationTestFormWithObs.html
File metadata and controls
348 lines (322 loc) · 16.2 KB
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<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">
<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.given_name">Given Name: <span class="required">*</span></label>
<input class="form-control" id="patient.given_name" name="patient.given_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>
<div class="section repeat" data-group="patient.personattribute">
<h3>Attributes</h3>
<div class="form-group group-set other_identifier_type" id="other_identifier_type">
<label for="attribute_type_uuid">Attribute Type</label>
<select class="form-control attribute_type_uuid" name="attribute_type_uuid" id="attribute_type_uuid">
<option value="">...</option>
<option value="8d871d18-c2cc-11de-8d13-0010c6dffd0f">Mother's Name</option>
<option value="8037ba06-fc79-4244-9d14-687baa44bd81">Contact Phone Number</option>
</select>
</div>
<div class="form-group phone_number">
<label for="patient.phone_number">Attribute Value: </label>
<input class="form-control phoneNumber" id="patient.phone_number" name="attribute_value" type="tel">
</div>
<div class="form-group mothers_name">
<label for="patient.mothers_name">Attribute Value: </label>
<input class="form-control mothers_name" id="patient.mothers_name" name="attribute_value" type="text">
</div>
</div>
<div class="section group-set repeat" data-group="patient.personaddress">
<h3>Address</h3>
<div class="form-group">
<label for="patient.county">County: </label>
<input class="form-control" id="countyDistrict" name="countyDistrict" type="text">
</div>
<div class="form-group">
<label for="patient.location">Location: </label>
<input class="form-control" id="address6" name="address6" type="text">
</div>
<div class="form-group">
<label for="patient.sub_location">Sub-location: </label>
<input class="form-control" id="address5" name="address5" type="text">
</div>
<div class="form-group">
<label for="patient.village">Village: </label>
<input class="form-control" id="cityVillage" name="cityVillage" type="text">
</div>
</div>
<div class="section">
<h3>Identifiers</h3>
<div class="form-group">
<label for="patient.medical_record_number">Medical Record Number : <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 checkDigit" id="identifier_value"
name="identifier_value" type="text" required="required">
<input data-metadata-for="identifier_value" type="hidden" id="identifier_type_uuid" name="identifier_type_uuid" value="8d793bee-c2cc-11de-8d13-0010c6dffd0f">
</div>
</div>
</div>
<div class="form-group">
<label>Other Identifiers:</label>
<div class="section repeat other_identifier" id="other_identifier" data-name="other_identifier" data-group="patient.otheridentifier">
<div class="form-group group-set other_identifier_type" id="other_identifier_type">
<label for="identifier_type_name">Identifier Type</label>
<select class="form-control identifier_type_name" name="identifier_type_name" id="identifier_type_name">
<option value="">...</option>
<option id="amrs_medical_record_number" value="AMRS Medical Record Number">AMRS Medical Record Number</option>
<option value="CCC Number">CCC Number</option>
<option id="hct_id" value="HCT ID">HCT ID</option>
<option value="KENYAN NATIONAL ID NUMBER">KENYAN NATIONAL ID NUMBER</option>
<option value="MTCT Plus ID">MTCT Plus ID</option>
<option value="MTRH Hospital Number">MTRH Hospital Number</option>
<option value="Old AMPATH Medical Record Number">Old AMPATH Medical Record Number</option>
<option id="pmtct_id" value="pMTCT ID">pMTCT ID</option>
</select>
</div>
<div class="identifier_value_section">
<div class="form-group">
<label for="other_identifier_value">Enter Identifier</label>
<input class="form-control check-other-identifier" id="other_identifier_value" required
name="identifier_value" type="text">
</div>
<div class="form-group">
<label for="confirm_other_identifier_value">Confirm Identifier</label>
<input class="form-control check-confirm-identifier" id="confirm_other_identifier_value" required
name="confirm_other_identifier_value" type="text">
</div>
</div>
</div>
</div>
</div>
<div class="section">
<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>
</div>
<div class="section">
<div class="form-group">
<label for="systolic_blood_pressure_phct">Systolic Blood Pressure from pHCT Screening card:</label>
<input class="form-control systolicBloodPressure" id="systolic_blood_pressure_phct"
name="systolic_blood_pressure_phct"
type="number" data-concept="5085^SYSTOLIC BLOOD PRESSURE^99DCT">
</div>
<div class="form-group">
<label for="diastolic_blood_pressure_phct">Diastolic Blood Pressure from pHCT Screening card:</label>
<input class="form-control lessThankSystolic" id="diastolic_blood_pressure_phct"
name="diastolic_blood_pressure_phct"
type="number" data-concept="5086^DIASTOLIC BLOOD PRESSURE^99DCT">
</div>
</div>
<div class="section">
<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>
</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 requireMedicalRecordNumber = htmlDataStore.isMedicalRecordNumberRequired();
if(requireMedicalRecordNumber){
$(".require_medical_record_number_hint").show();
$("#identifier_value").attr("required","required");
} else {
$(".require_medical_record_number_hint").hide();
$("#identifier_value").removeAttr("required","required");
}
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');
$.validator.addMethod(
"validateConfirmIdentifierElement",
function(confirm_other_identifier_value, confirm_identifier_element){
var other_identifier_value = $(confirm_identifier_element).closest('.repeat').find('.check-other-identifier').val();
if (other_identifier_value == confirm_other_identifier_value) {
return true;
} else {
return false;
}
},
"Other Identifiers do not match."
);
jQuery.validator.addClassRules({
'check-confirm-identifier':{
validateConfirmIdentifierElement: true
}
});
$('.identifier_type_name').change(function(){
var selected_val = $(this).val();
console.log(selected_val);
if(selected_val == ""){
$(this).closest('.repeat').find('.identifier_value_section').hide();
}else{
if(selected_val == $('#amrs_medical_record_number').val() || selected_val == $('#hct_id').val() || selected_val == $('#pmtct_id')){
$('#other_identifier_value').addClass('checkDigit');
$('#confirm_other_identifier_value').addClass('checkDigit');
}else{
$('#other_identifier_value').removeClass('checkDigit');
$('#confirm_other_identifier_value').removeClass('checkDigit');
}
$(this).closest('.repeat').find('.identifier_value_section').show();
}
});
$('.identifier_type_name').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");
});
</script>
</html>