forked from muzima/muzima-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChew.html
executable file
·597 lines (552 loc) · 27.5 KB
/
Chew.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
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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<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>CDM CHEW Form v 0.01</title>
</head>
<body class="col-md-10 col-md-offset-1">
<div id="pre_populate_data"></div>
<h2 class="text-center">CDM CHEW Form v 0.01</h2>
<form id="chew_form" name="chew_form">
<div class="section">
<h3>Demographics</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.medical_record_number">AMRS ID Number:</label>
<input class="form-control" id="patient.medical_record_number" name="patient.medical_record_number" type="text"
readonly="readonly" disabled="disabled">
</div>
<div class="form-group">
<label for="patient.family_name">Family Name:</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text" readonly="readonly"
disabled="disabled">
</div>
<div class="form-group">
<label for="patient.given_name">Given Name:</label>
<input class="form-control" id="patient.given_name" name="patient.given_name" type="text" readonly="readonly"
disabled="disabled">
</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" readonly="readonly"
disabled="disabled">
</div>
<div class="form-group">
<label for="patient.sex">Gender:</label>
<select class="form-control" id="patient.sex" name="patient.sex" disabled="disabled">
<option value="">...</option>
<option value="M">Male</option>
<option value="F">Female</option>
</select>
</div>
<div class="form-group">
<label for="patient.birth_date">Date Of Birth:</label>
<input class="form-control" id="patient.birth_date" name="patient.birth_date" type="text"
readonly="readonly" disabled="disabled">
</div>
</div>
<div class="section">
<div class="form-group">
<label for="encounter.location_id">Name of Dispensary:<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 value="">...</option>
<option value="9" data-location="Ampath MTRH">Ampath MTRH</option>
<option value="7" data-location="Chulaimbo">Chulaimbo</option>
<option value="17" data-location="Iten">Iten</option>
<option value="2" data-location="Mosoriot">Mosoriot</option>
<option value="3" data-location="Turbo">Turbo</option>
<option value="8" data-location="Webuye">Webuye</option>
</select>
</div>
<div class="form-group">
<label for="encounter.encounter_datetime">
Encounter Date:<span class="required">*</span>
</label>
<input class="form-control datepicker nonFutureDate past-date" id="encounter.encounter_datetime"
name="encounter.encounter_datetime" type="text" readonly="readonly"
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>
<div class="section hidden">
<div class="form-group">
<label for="previous_follow_up">Previous date this form was filled:</label>
<input class="form-control datepicker nonFutureDate past-date" id="previous_follow_up"
name="previous_follow_up" type="text" readonly="readonly"
data-concept="9167^DATE OF LAST FOLLOW-UP^99DCT">
</div>
<div class="form-group">
<label for="missed_appointment_date">Missed appointment date:</label>
<input class="form-control datepicker nonFutureDate past-date" id="missed_appointment_date"
name="missed_appointment_date" type="text" readonly="readonly"
data-concept="1592^MISSED APPOINTMENT DATE^99DCT">
</div>
</div>
<div class="section hidden">
<h4>PHCT Blood Sugar Readings</h4>
<div class="form-group">
<label for="random_blood_sugar">Random blood sugar (RBS):</label>
<div class="input-group">
<input class="form-control" id="random_blood_sugar"
name="random_blood_sugar" type="number"
data-concept="887^SERUM GLUCOSE^99DCT">
<span class="input-group-addon">mmol/L</span>
</div>
</div>
<div class="form-group">
<label for="fasting_blood_sugar">Fasting blood sugar (FBS):</label>
<div class="input-group">
<input class="form-control" id="fasting_blood_sugar"
name="fasting_blood_sugar" type="number"
data-concept="6252^SERUM GLUCOSE, FASTING^99DCT">
<span class="input-group-addon">mmol/L</span>
</div>
</div>
</div>
<div class="section hidden">
<h4>PHCT Blood Pressure Readings</h4>
<div class="form-group">
<label for="systolic_blood_pressure">Systolic blood pressure:</label>
<div class="input-group">
<input class="form-control" id="systolic_blood_pressure"
name="systolic_blood_pressure" type="number"
data-concept="5085^SYSTOLIC BLOOD PRESSURE^99DCT">
<span class="input-group-addon">mmHg</span>
</div>
</div>
<div class="form-group">
<label for="diastolic_blood_pressure">Diastolic blood pressure:</label>
<div class="input-group">
<input class="form-control" id="diastolic_blood_pressure"
name="diastolic_blood_pressure" type="number"
data-concept="5086^DIASTOLIC BLOOD PRESSURE^99DCT">
<span class="input-group-addon">mmHg</span>
</div>
</div>
</div>
<div class="section hidden" data-concept="1932^REFERRALS ORDERED, DETAILED^99DCT">
<div class="form-group">
<label for="referrals_ordered">Name of facility client was referred to:</label>
<input class="form-control" id="referrals_ordered"
name="referrals_ordered" type="text"
data-concept="1272^REFERRALS ORDERED^99DCT">
</div>
</div>
<div class="section hidden">
<div class="form-group">
<label for="date_referred">Date referred:</label>
<input class="form-control datepicker nonFutureDate past-date" id="date_referred"
name="date_referred" type="text" readonly="readonly"
data-concept="9158^DATE REFERRED^99DCT">
</div>
</div>
<div class="section hidden" data-concept="6750^REFERRED BY, DETAILED^99DCT">
<h4>Client referred from:<span class="required">*</span></h4>
<fieldset name="6749^REFERRED BY^99DCT">
<div class="form-group">
<label class="font-normal">
<input id="referred_by.phct" type="checkbox"
data-concept="6749^REFERRED BY^99DCT"
value="8227^PHCT^99DCT">
PHCT
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="referred_by.mch" type="checkbox"
data-concept="6749^REFERRED BY^99DCT"
value="2050^MATERNAL CHILD HEALTH PROGRAM^99DCT">
MCH
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="referred_by.clinic" type="checkbox"
data-concept="6749^REFERRED BY^99DCT"
value="7037^REFERRED FROM CLINIC^99DCT">
Clinic
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input class="has-other" id="referred_by.other_non_coded" type="checkbox"
data-concept="6749^REFERRED BY^99DCT"
value="5622^OTHER NON-CODED^99DCT">
Other
</label>
</div>
<div class="form-group freetext">
<label for="referred_by.freetext_general">Specify<span class="required">*</span></label>
<input class="form-control" id="referred_by.freetext_general"
name="referred_by.freetext_general" type="text" required="required"
data-concept="1915^FREETEXT GENERAL^99DCT">
</div>
</fieldset>
</div>
<div class="section" data-concept="9168^TYPE OF FOLLOW-UP, DETAILED^99DCT">
<h4>Type of CHW follow up:<span class="required">*</span></h4>
<fieldset name="2332^TYPE OF FOLLOW-UP^99DCT">
<div class="form-group">
<label class="font-normal">
<input id="follow_up_type.hypertension" type="checkbox"
data-concept="2332^TYPE OF FOLLOW-UP^99DCT"
value="7286^KNOWN HYPERTENSIVE PATIENT^99DCT">
Hypertension
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="follow_up_type.diabetic" type="checkbox"
data-concept="2332^TYPE OF FOLLOW-UP^99DCT"
value="7282^KNOWN DIABETIC PATIENT^99DCT">
Diabetic
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input class="has-other" id="follow_up_type.other_non_coded" type="checkbox"
data-concept="2332^TYPE OF FOLLOW-UP^99DCT"
value="5622^OTHER NON-CODED^99DCT">
Other
</label>
</div>
<div class="form-group freetext">
<label for="follow_up_type.freetext_general">Specify<span class="required">*</span></label>
<input class="form-control" id="follow_up_type.freetext_general"
name="follow_up_type.freetext_general" type="text" required="required"
data-concept="1915^FREETEXT GENERAL^99DCT">
</div>
</fieldset>
</div>
<div class="section" data-concept="6114^REASON FOR ATTEMPTED CONTACT, DETAILED^99DCT">
<h4>Reason for follow up:<span class="required">*</span></h4>
<fieldset name="9081^PATIENT ON OUTREACH FOLLOW-UP CATEGORY^99DCT">
<div class="form-group">
<label class="font-normal">
<input id="follow_up_category.not_linked_to_care" type="checkbox"
data-concept="9081^PATIENT ON OUTREACH FOLLOW-UP CATEGORY^99DCT"
value="9160^NOT LINKED TO CARE^99DCT">
Not linked to care
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="follow_up_category.lost_to_follow_up" type="checkbox"
data-concept="9081^PATIENT ON OUTREACH FOLLOW-UP CATEGORY^99DCT"
value="9159^LOST TO FOLLOW-UP, NOS^99DCT">
Lost to follow up
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input class="has-other" id="follow_up_category.other_non_coded" type="checkbox"
data-concept="9081^PATIENT ON OUTREACH FOLLOW-UP CATEGORY^99DCT"
value="5622^OTHER NON-CODED^99DCT">
Other
</label>
</div>
<div class="form-group freetext">
<label for="follow_up_category.freetext_general">Specify<span class="required">*</span></label>
<input class="form-control" id="follow_up_category.freetext_general"
name="follow_up_category.freetext_general" type="text" required="required"
data-concept="1915^FREETEXT GENERAL^99DCT">
</div>
</fieldset>
</div>
<div class="section" data-concept="6187^REASON FOR MISSED VISIT, DETAILED^99DCT">
<h4>Reason for missed appointment:<span class="required">*</span></h4>
<fieldset name="1733^REASON FOR MISSED VISIT^99DCT">
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.lack_of_time" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="9148^COMMITMENTS^99DCT">
Lack of time
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.lack_of_money" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="6295^FINANCIAL BARRIER^99DCT">
Lack of money
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.lack_of_confidence" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="9161^LACK OF CONFIDENCE^99DCT">
Lack of confidence in health care worker(s)
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.lack_of_transport" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="820^TRANSPORT PROBLEMS^99DCT">
Lack of transport
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.asymptomatic" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="5006^ASYMPTOMATIC^99DCT">
No symptoms of illness
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.visited_not_seen" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="9162^VISITED HEALTH CARE FACILITY, NOT SEEN^99DCT">
Visited not seen
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.visited_dispensary_closed" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="9163^VISITED HEALTH CARE FACILITY, CLOSED^99DCT">
Visited dispensary closed
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.distance_too_far" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="1551^DISTANCE TOO FAR^99DCT">
Distance (too far)
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input id="missed_visit_reason.sought_care_elsewhere" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="8352^CONTINUE TO RECEIVE MEDICATIONS FROM ANOTHER LOCATION^99DCT">
Sought care elsewhere
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input class="has-other" id="missed_visit_reason.other_non_coded" type="checkbox"
data-concept="1733^REASON FOR MISSED VISIT^99DCT"
value="5622^OTHER NON-CODED^99DCT">
Other
</label>
</div>
<div class="form-group freetext">
<label for="missed_visit_reason.freetext_general">Specify<span class="required">*</span></label>
<input class="form-control" id="missed_visit_reason.freetext_general"
name="missed_visit_reason.freetext_general" type="text" required="required"
data-concept="1915^FREETEXT GENERAL^99DCT">
</div>
</fieldset>
</div>
<div class="section">
<h4>Patient Facility Visit Plans Detailed</h4>
<div class="form-group">
<span>
<strong>Does patient plan to show up to facility?<span class="required">*</span></strong>
</span>
<fieldset name="6140^PLAN TO RETURN TO CLINIC^99DCT">
<div class="form-group">
<label class="font-normal">
<input name="visit_plan" type="radio"
data-concept="6140^PLAN TO RETURN TO CLINIC^99DCT"
value="1065^YES^99DCT">
Yes
</label>
</div>
<div class="form-group">
<label class="font-normal">
<input name="visit_plan" type="radio"
data-concept="6140^PLAN TO RETURN TO CLINIC^99DCT"
value="1066^NO^99DCT">
No
</label>
</div>
</fieldset>
</div>
<div class="form-group hidden">
<label for="visit_plan_date">Date of planned facility visit?<span class="required">*</span></label>
<input class="form-control datepicker checkFutureDate future-date" id="visit_plan_date"
name="visit_plan_date" type="text" required="required" readonly="readonly"
data-concept="7348^RETURN VISIT DATE, DISPENSARY^99DCT">
</div>
<div class="concept-set form-group hidden" data-concept="9087^FACILITY TYPE, DETAILED^99DCT">
<label for="visit_plan_facility">Facility name?<span class="required">*</span></label>
<input class="form-control" id="visit_plan_facility"
name="visit_plan_facility" type="text" required="required"
data-concept="1915^FREETEXT GENERAL^99DCT">
</div>
<div class="form-group">
<label for="planned_follow_up_date">Planned CHW follow up date?<span class="required">*</span></label>
<input class="form-control datepicker checkFutureDate future-date" id="planned_follow_up_date"
name="planned_follow_up_date" type="text" required="required" readonly="readonly"
data-concept="9166^PLANNED FOLLOW-UP DATE^99DCT">
</div>
</div>
<div class="section">
<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 provider name here ...">
<input class="form-control " name="encounter.provider_id_select" type="hidden">
</div>
<div class="form-group hidden">
<select id="select_providers">
<option data-provider = "Ann Githua" value = "3762-2">Ann Githua</option>
<option data-provider = "Faith Bargoiyet" value = "3854-7">Faith Bargoiyet</option>
<option data-provider = "Jackline Chemeli Chebii" value = "3853-9">Jackline Chemeli Chebii</option>
<option data-provider = "Lydia Jepkoech" value = "1830-9">Lydia Jepkoech</option>
<option data-provider = "Peter Onditi" value = "3760-6">Peter Onditi</option>
<option data-provider = "Valentine Jeptoo Kimisoi" value = "3855-4">Valentine Jeptoo Kimisoi</option>
<option data-provider = "Viola Boitt" value = "3766-3">Viola Boitt</option>
<option data-provider = "Philip Kiprop Rutto" value = "3764-8">Philip Kiprop Rutto</option>
<option data-provider = "Carolyne Sambaya Kiptoo" value = "3755-6">Carolyne Sambaya Kiptoo</option>
<option data-provider = "Alice Bor" value = "3756-4">Alice Bor</option>
<option data-provider = "John Kitur" value = "3768-9">John Kitur</option>
<option data-provider = "Isaiah Rono Kemei" value = "3851-3">Isaiah Rono Kemei</option>
<option data-provider = "Musa Mugungei" value = "3851-3">Musa Mugungei</option>
<option data-provider = "Daurine Achieng Agumba" value = "3419-9">Daurine Achieng Agumba</option>
<option data-provider = "Irene Chepkosgei Kurgat" value = "3420-7">Irene Chepkosgei Kurgat</option>
<option data-provider = "Rose Cheruto Toroitich" value = "3421-5">Rose Cheruto Toroitich</option>
<option data-provider = "Mary Kipkurui Kimosop" value = "3422-3">Mary Kipkurui Kimosop</option>
<option data-provider = "Jacqueline Chemom Ndiema" value = "3423-1">Jacqueline Chemom Ndiema</option>
<option data-provider = "Grace Wanjiru Mwangi" value = "3424-9">Grace Wanjiru Mwangi</option>
<option data-provider = "Collette Mabia Palapala" value = "3425-6">Collette Mabia Palapala</option>
<option data-provider = "Dorice Erima Wekesa Female" value = "3426-4">Dorice Erima Wekesa Female</option>
<option data-provider = "Agnes Kagure Boen" value = "120-6">Agnes Kagure Boen</option>
<option data-provider = "Linet Kerubo Onyancha" value = "3427-2">Linet Kerubo Onyancha</option>
<option data-provider = "Delinah Muchai Tanui" value = "1208-8">Delinah Muchai Tanui</option>
<option data-provider = "Hellen Mushimbi Indumbwe" value = "1208-8">Hellen Mushimbi Indumbwe</option>
<option data-provider = "Lydia Cherugut Samoei" value = "1525-5">Lydia Cherugut Samoei</option>
<option data-provider = "Ruth Kalunda Nzili" value = "1529-7">Ruth Kalunda Nzili</option>
<option data-provider = "Lucy Cheruto Birgen" value = "3428-0">Lucy Cheruto Birgen</option>
<option data-provider = "Gratiah Nafuna Khaemba" value = "1409-2">Gratiah Nafuna Khaemba</option>
<option data-provider = "Leonida Chemutai Mengich" value = "1357-3">Leonida Chemutai Mengich</option>
<option data-provider = "Ann Wangoi Maina" value = "1412-6">Ann Wangoi Maina</option>
<option data-provider = "Elkanah Omenge Orango" value = "1474-6">Elkanah Omenge Orango</option>
<option data-provider = "Peter Mukhanadale Istura" value = "1478-7">Peter Mukhanadale Istura</option>
<option data-provider = "Hillary Mabeya" value = "1476-1">Hillary Mabeya</option>
<option data-provider = "Astrid Christoffersen Deb" value = "1237-7">Astrid Christoffersen Deb</option>
<option data-provider = "Philip Kipkirui Tonui" value = "1485-7">Philip Kipkirui Tonui</option>
</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>
</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);
}
$('#save_draft').click(function () {
$(this).prop('disabled', true);
document.saveDraft(this);
$(this).prop('disabled', false);
});
$('#submit_form').click(function () {
$(this).prop('disabled', true);
document.submit();
$(this).prop('disabled', false);
});
var locationName = [
{"val": "7", "label": "Chulaimbo"},
{"val": "3", "label": "Turbo"},
{"val": "17", "label": "Iten"},
{"val": "2", "label": "Mosoriot"},
{"val": "8", "label": "Webuye"},
{"val": "9", "label": "Ampath MTRH"}
];
document.setupAutoCompleteData('encounter\\.location_id');
document.setupAutoCompleteDataForProvider('encounter\\.provider_id_select');
$('#encounter\\.provider_id_select').change(function () {
if ($('#encounter\\.provider_id_select').val() === '') {
$('#encounter\\.provider_id').val('');
$('.show_provider_id_text').show();
}
});
$('#chew_form').validate({});
/* Start - Toggle free text element */
var $hasOther = $('.has-other');
$hasOther.change(function () {
var $freetext = $(this).closest('.section').find('.freetext');
if ($(this).is(':checkbox')) {
if ($(this).is(':checked')) {
$freetext.show();
} else {
$freetext.hide();
}
}
});
$hasOther.trigger('change');
/* End - Toggle free text element */
/* Start - Toggle resume date and facility */
var RETURN_PLAN_CONCEPT = "6140^PLAN TO RETURN TO CLINIC^99DCT";
var $resumeCare = $(':radio[data-concept="' + RETURN_PLAN_CONCEPT + '"]');
$resumeCare.change(function () {
var resumeCareValue = $(this).val();
var FACILITY_TYPE_CONCEPT = "9087^FACILITY TYPE, DETAILED^99DCT";
var RETURN_DISPENSARY_CONCEPT = "7348^RETURN VISIT DATE, DISPENSARY^99DCT";
var $resumeCareDate = $('input[data-concept="' + RETURN_DISPENSARY_CONCEPT + '"]').closest('.form-group');
var $resumeCareFacility = $('[data-concept="' + FACILITY_TYPE_CONCEPT + '"]');
if ($(this).is(':checked')) {
if (resumeCareValue == '1065^YES^99DCT') {
$resumeCareDate.removeClass('hidden');
$resumeCareFacility.removeClass('hidden')
} else if (resumeCareValue == '1066^NO^99DCT') {
$resumeCareDate.addClass('hidden');
$resumeCareFacility.addClass('hidden');
}
}
});
$resumeCare.trigger('change');
/* End - Toggle resume date and facility */
$.fn.customValidationCheck = function () {
var referredBy = $('fieldset[name="6749^REFERRED BY^99DCT"]');
var followUpType = $('fieldset[name="2332^TYPE OF FOLLOW-UP^99DCT"]');
var clinicVisitPlan = $('fieldset[name="6140^PLAN TO RETURN TO CLINIC^99DCT"]');
var followUpCategory = $('fieldset[name="9081^PATIENT ON OUTREACH FOLLOW-UP CATEGORY^99DCT"]');
var missedVisitReason = $('fieldset[name="1733^REASON FOR MISSED VISIT^99DCT"]');
var errors = $.extend({},
validateSelected(referredBy),
validateSelected(followUpType),
validateSelected(clinicVisitPlan),
validateSelected(followUpCategory),
validateSelected(missedVisitReason));
showValidationMessages(errors);
return $.isEmptyObject(errors);
}
document.setupValidationForProvider("$('#encounter\\.provider_id_select').val()","encounter\\.provider_id");
document.setupValidationForLocation("$('#encounter\\.location_id').val()","encounter\\.location_id");
});
</script>
</html>