forked from muzima/muzima-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPHCTv3_6.htm
1652 lines (1490 loc) · 71.6 KB
/
PHCTv3_6.htm
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/muzima.css" rel="stylesheet">
<link href="css/ui-lightness/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/jquery-autocomplete-min.js"></script>
<script src="js/muzima.js"></script>
<title>PHCT Household survey</title>
</head>
<body class="col-md-8 col-md-offset-2">
<div id="pre_populate_data"></div>
<form id="phct-household-survey-form" name="phct-household-survey-form">
<h2 class="text-center">PHCT Household survey</h2>
<div class="form-group injected-field" id="age-birth-date-estimate">
<label for="ampath.site">Age birth date estimate</label>
<input class="form-control" id="ampath.site" name="ampath.site" type="text">
</div>
<div class="section">
<h3>Household Information</h3>
<div class="form-group">
<input class="form-control" id="patient-uuid"
name="patient-uuid" type="hidden" readonly="readonly">
</div>
<div class="form-group">
<input class="form-control" id="survey-starttime"
name="survey-starttime" type="hidden" readonly="readonly">
</div>
<div class="form-group">
<input class="form-control" id="device-id"
name="device-id" type="hidden" readonly="readonly">
</div>
<div class="form-group">
<input class="form-control" id="subscriber-id"
name="subscriber-id" type="hidden" readonly="readonly">
</div>
<div class="form-group">
<input class="form-control" id="gps-coords"
name="gps-coords" type="hidden" readonly="readonly">
</div>
<div class="form-group">
<label for="provider-id">Provider ID:</label>
<input class="form-control" id="provider-id" name="provider-id" type="text">
</div>
<div class="form-group">
<label for="ampath-site">Ampath site/Satellite Clinic:</label>
<input class="form-control" id="ampath-site" name="ampath-site" type="text">
</div>
<div class="form-group">
<label for="household-id">Household ID:</label>
<input class="form-control" id="household-id" name="household-id" type="text">
</div>
<div class="form-group">
<label for="household-village">Enter household village</label>
<input class="form-control" id="household-village" name="household-village" type="text">
</div>
</div>
<div class="section">
<h3>Household Definition</h3>
<div class="form-group">
<label for="allowed-in">Allowed in?</label>
<select class="form-control" id="allowed-in" name="allowed-in">
<option>Accepted</option>
<option>Declined</option>
<option>Not home</option>
<option>Requested for later date</option>
</select>
</div>
<section id="not-allowed-in" class="logic.section">
<div class="form-group">
<label for="schedule-return-date">Schedule return date</label>
<input class="form-control" id="schedule-return-date" name="schedule-return-date" type="text">
</div>
</section>
<section id="allowed-in" class="logic.section">
<div class="form-group">
<label for="no-of-household-members-less-than-equal-13-yrs">Number of house hold members >= 13 years</label>
<input class="form-control" id="no-of-household-members-less-than-equal-13-yrs"
name="no-of-household-members-less-than-equal-13-yrs" type="text">
</div>
<div class="form-group">
<label for="no-of-household-members-less-than-13-yrs">Number of house hold members < 13 years</label>
<input class="form-control" id="no-of-household-members-less-than-13-yrs"
name="no-of-household-members-less-than-13-yrs" type="text">
</div>
<div class="form-group">
<label for="total-number-of-house-hold-members">Total number of house hold members</label>
<input class="form-control" id="total-number-of-house-hold-members"
name="total-number-of-house-hold-members" type="text">
</div>
</section>
</div>
<div class="section">
<h3>Household Members Definition</h3>
<div class="form-group">
<label for="total-number-of-house-hold-members-greater-equal-13-yrs">Number of members >= 13 eligible for testing</label>
<input class="form-control" id="total-number-of-house-hold-members-greater-equal-13-yrs"
name="total-number-of-house-hold-members-greater-equal-13-yrs" type="text">
</div>
<div class="form-group">
<label for="total-number-of-house-hold-members-less-than-13-yrs">Number of members < 13 years eligible for testing</label>
<input class="form-control" id="total-number-of-house-hold-members-less-than-13-yrs"
name="total-number-of-house-hold-members-less-than-13-yrs" type="text">
</div>
<div class="form-group">
<label for="total-number-of-house-hold-members">Total number of house hold members eligible for testing</label>
<input class="form-control" id="total-number-of-house-hold-members"
name="total-number-of-house-hold-members" type="text">
</div>
</div>
<div class="section">
<h3>Social Economic Questions</h3>
<div class="form-group">
<label for="total-land-owned">Total land owned</label>
<input class="form-control" id="total-land-owned" name="total-land-owned" type="text">
</div>
<div class="form-group">
<label for="no-of-cows-owned">Number of cows owned</label>
<input class="form-control" id="no-of-cows-owned" name="no-of-cows-owned" type="text">
</div>
<div class="form-group">
<label for="no-of-sheep-owned">Number of sheep owned</label>
<input class="form-control" id="no-of-sheep-owned" name="no-of-sheep-owned" type="text">
</div>
<div class="form-group">
<label for="children-between-3-20-yrs">Children between 3-20 years on household</label>
<input class="form-control" id="children-between-3-20-yrs" name="children-between-3-20-yrs" type="text">
</div>
<div class="form-group">
<label for="number-attending-school-technical-institution">Number attending school or educational institution</label>
<input class="form-control" id="number-attending-school-technical-institution"
name="number-attending-school-technical-institution" type="text">
</div>
</div>
<div class="section">
<h3>Household Member Definition</h3>
<div class="form-group">
<label for="number-bednets">Number of bed nets</label>
<input class="form-control" id="number-bednets" name="number-bednets" type="text">
</div>
<div class="form-group">
<label for="number-of-nets-provided">Number of nets provided</label>
<select class="form-control" id="number-of-nets-provided" name="number-of-nets-provided">
<option>Zero</option>
<option>One</option>
</select>
</div>
<section id="voucher-id-net-provided" class="logic.section">
<div class="form-group">
<label for="voucher-id-net-provided">Voucher ID of net provided</label>
<input class="form-control" id="voucher-id-net-provided" name="voucher-id-net-provided" type="text">
</div>
</section>
</div>
<div class="section">
<h3>Basic Information</h3>
<div class="form-group">
<label for="confirm-universal-id">Confirm Universal ID</label>
<input class="form-control" id="confirm-universal-id" name="confirm-universal-id" type="text">
</div>
<div class="form-group">
<label for="first-name">First Name</label>
<input class="form-control" id="first-name" name="first-name" type="text">
</div>
<div class="form-group">
<label for="middle-name">Middle Name</label>
<input class="form-control" id="middle-name" name="middle" type="text">
</div>
<div class="form-group">
<label for="gender">Gender</label>
<select class="form-control" id="gender" name="gender">
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="form-group">
<label for="age-entry-mode">Age Entry Mode</label>
<select class="form-control" id="age-entry-mode">
<option>Enter full date</option>
<option>Enter age in years and months</option>
</select>
</div>
<section id="enter.full.date" class="logic.section">
<div class="form-group">
<label for="birthdate">Enter birthdate</label>
<input class="form-control" id="birthdate" name="birthdate" type="text">
</div>
</section>
<section id="enter-date-months-years" class="logic.section">
<div class="form-group">
<label for="enter-date-months-years">Enter number of years</label>
<input class="form-control" id="enter-date-months-years" name="enter-date-months-years" type="text">
</div>
<div class="form-group">
<label for="enter-number-of-months">Enter number of months</label>
<input class="form-control" id="enter-number-of-months" name="enter-number-of-months" type="text">
</div>
</section>
<div class="form-group">
<label for="phonenumber">Phonenumber</label>
<input class="form-control" id="phonenumber" name="phonenumber" type="text">
</div>
<div class="form-group">
<label for="reenter-phonenumber">Reenter phonenumber</label>
<input class="form-control" id="reenter-phonenumber" name="reenter-phonenumber" type="text">
</div>
</div>
<div class="section">
<h3>AMRS ID Scan</h3>
<div class="form-group">
<label for="HCT-AMRS-barcode">Scan HCT AMRS Barcode</label>
<input class="form-control" id="HCT-AMRS-barcode" name="HCT-AMRS-barcode" type="text">
</div>
<div class="form-group">
<label for="HCT-AMRS-id">Enter HCT AMRS ID</label>
<input class="form-control" id="HCT-AMRS-id" name="HCT-AMRS-id" type="text">
</div>
</div>
<div class="section">
<h3>House Status</h3>
<div class="form-group">
<label for="house-status">House status</label>
<select class="form-control" id="house-status">
<option>Household resident</option>
<option>Visitor from catchment area</option>
<option>Visitor from elsewhere</option>
</select>
</div>
<div class="form-group">
<label for="relationship-to-household-head">Relationship to household head</label>
<select class="form-control" name="relationship-to-household-head" id="relationship-to-household-head">
<option>Self (Household head)</option>
<option>Spouse</option>
<option>Son/Daughter</option>
<option>Son/Daughter-in-law</option>
<option>Parent</option>
<option>Parent-in-law</option>
<option>Grandchild</option>
<option>GransParent</option>
<option>Brother/Sister</option>
<option>Uncle/Aunt</option>
<option>Co-wife</option>
<option>Cousin</option>
<option>Niece/Nephew</option>
<option>Stepchild</option>
<option>Foster child</option>
<option>Friend</option>
<option>House help</option>
<option>Employee</option>
<option>Tenant/Renter</option>
<option>Other</option>
<option>Don't know</option>
</select>
</div>
<div class="form-group">
<label for="education-level">Education level</label>
<select class="form-control" id="education-level" name="education-level">
<option>None</option>
<option>Adult Education</option>
<option>Primary School</option>
<option>Secondary School</option>
<option>College</option>
<option>University</option>
</select>
</div>
</div>
<div class="section">
<h3>Health Questions</h3>
<div class="form-group">
<label for="number-of-times-gone-to-health-facility-health-problem">Number of times gone to a health facility due to a health problem in the last 4 weeeks</label>
<input class="form-control" id="number-of-times-gone-to-health-facility-health-problem"
name="number-of-times-gone-to-health-facility-health-problem" type="text">
</div>
<div class="form-group">
<label for="amount-of-money-used-last-4-weeks">Amount of money used on medical care with your sillness in the last 4 weeeks</label>
<input class="form-control" id="amount-of-money-used-last-4-weeks" name="amount-of-money-used-last-4-weeks" type="text">
</div>
<div class="form-group">
<label for="mother-died">Mother died?</label>
<select class="form-control" id="mother-died" name="mother-died">
<option>Yes</option>
<option>No</option>
</select>
</div>
<section id="mother-hiv-positive-section" class="logic.section">
<div class="form-group">
<label for="mother-hiv-positive">Mother HIV+?</label>
<select class="form-control" id="mother-hiv-positive">
<option>Yes</option>
<option>No</option>
</select>
</div>
</section>
<div class="form-group">
<label for="age.entry.mode">Father died?</label>
<select class="form-control" id="age.entry.mode">
<option>Yes</option>
<option>No</option>
</select>
</div>
<section id="father.hiv.positive" class="logic.section">
<div class="form-group">
<label for="age.entry.mode">Father HIV+?</label>
<select class="form-control" id="age.entry.mode">
<option>Yes</option>
<option>No</option>
</select>
</div>
</section>
<div class="form-group">
<span>Alert: User needs testing...</span>
</div>
<div class="form-group">
<label for="age.entry.mode">Previously tested for HIV?</label>
<select class="form-control" id="age.entry.mode">
<option>Yes</option>
<option>No</option>
</select>
</div>
<section id="previously.tested.hiv" class="logic.section">
<div class="form-group">
<label for="age.entry.mode">How many times have you been tested for HIV?</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text">
</div>
<div class="form-group">
<label for="age.entry.mode">When were you last tested?</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text">
</div>
<div class="form-group">
<label for="age.entry.mode">Point of HIV Testing?</label>
<select class="form-control" id="age.entry.mode">
<option>pMTCT</option>
<option>VCT</option>
<option>HCT</option>
<option>pHCT</option>
<option>TB Clinic</option>
<option>DTC/PITC</option>
<option>Inpatient</option>
<option>MCH</option>
<option>OPD</option>
<option>Other</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Previous HIV Results</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text">
</div>
<div class="form-group">
<label for="age.entry.mode">When were you last tested?</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text">
</div>
<div class="form-group">
<label for="age.entry.mode">Did you disclose your HIV status to anyone?</label>
<select class="form-control" id="age.entry.mode">
<option>Yes</option>
<option>No</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Whom did you disclose to?</label>
<select class="form-control" id="age.entry.mode">
<option>Spouse/Partner</option>
<option>Relative</option>
<option>Friend</option>
<option>Other</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">What was the reason for not disclosing?</label>
<select class="form-control" id="age.entry.mode">
<option>Stigma</option>
<option>Religion</option>
<option>Cultural Practices</option>
<option>Other</option>
</select>
</div>
</section>
<section id="not.previously.tested.hiv" class="logic.section">
<div class="form-group">
<label for="age.entry.mode">Did the client receive HIV counselling on this visit?</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text">
</div>
<div class="form-group">
<label for="age.entry.mode">Accepted testing?</label>
<select class="form-control" id="age.entry.mode">
<option>Yes</option>
<option>No</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Test 1 Result?</label>
<select class="form-control" id="age.entry.mode">
<option>Determine</option>
<option>Reactive</option>
<option>Non-reactive</option>
<option>Indeterminate</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Test 2 Result?</label>
<select class="form-control" id="age.entry.mode">
<option>Determine</option>
<option>Reactive</option>
<option>Non-reactive</option>
<option>Indeterminate</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Test 3 Result?</label>
<select class="form-control" id="age.entry.mode">
<option>Determine</option>
<option>Reactive</option>
<option>Non-reactive</option>
<option>Indeterminate</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">QA/QC Long Elisa Results</label>
<select class="form-control" id="age.entry.mode">
<option>Determine</option>
<option>Reactive</option>
<option>Non-reactive</option>
<option>Indeterminate</option>
</select>
</div>
<div class="form-group">
<span>Display test results</span>
</div>
</section>
</div>
<div class="section">
<h3>Tuberculosis screening</h3>
<div class="form-group">
<label for="age.entry.mode">Tuberculosis screening</label>
<select class="form-control" id="age.entry.mode">
<option>Cough > 2 weeks</option>
<option>Bloody cough for past week</option>
<option>Fever > 3 weeks</option>
<option>Weight loss in past 1 year</option>
<option>TB in household</option>
<option>If child, failure to strive</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Spot 1 Sputum Collected</label>
<select class="form-control" id="age.entry.mode">
<option>Yes</option>
<option>No</option>
<option>Unable to produce sputum</option>
<option>Under 5 years , no years needed</option>
</select>
</div>
<div class="form-group">
<label for="age.entry.mode">Select referral. What are the HCT follow up orders?</label>
<select class="form-control" id="age.entry.mode">
<option>Repeat HIV Testing in 5-6 months</option>
<option>Referred to HIV Clinic, HIV Positive</option>
<option>Health Center referral, Indeterminate HIV Test</option>
<option>Health Center referral, Child less than 18 months</option>
<option>ANC Referral</option>
<option>Health Center referral, Other ailments</option>
<option>VMMC</option>
<option>Referred for TB</option>
<option>STI referral</option>
<option>None</option>
</select>
</div>
<section id="hct.follow.up.orders" class="logic.section">
<div class="form-group">
<label for="age.entry.mode">Follow up date</label>
<input class="form-control" id="patient.family_name" name="patient.family_name" type="text">
</div>
<div class="form-group">
<label for="age.entry.mode">Preferred clinic</label>
<select class="form-control" id="age.entry.mode">
<option>Chulaimbo AMPATH clinic</option>
<option>Sunga Dispensary</option>
<option>Chulaimbo Sub District Hospital</option>
<option>Riat Dispensary</option>
<option>Siriba Dispensary</option>
<option>Gombewa Dispensary</option>
<option>Other</option>
</select>
</div>
</section>
<div class="form-group">
<span>Client looks very sick</span>
</div>
</div>
<div class="form-group text-center">
<input class="btn btn-primary" id="save_draft" type="button" value="Save as draft"/>
<input class="btn btn-primary" id="submit_form" type="submit" value="Submit as complete"/>
</div>
</form>
</body>
<script type="text/javascript">
$(document).ready(function () {
$('#phct_household_survey_form').hide() ;
var IDInputFieldEntered = false ;
var formerIDEntered = '' ;
$('#save_draft').click(function () {
document.saveDraft();
});
$('.need_validation').blur(function () {
alertMessageSection = $(this).parent().find('.alert_message') ;
if(!IDInputFieldEntered) {
formerIDEntered = $(this).val() ;
clearTextField($(this)) ;
displayMessage('please re-enter the id field', alertMessageSection) ;
IDInputFieldEntered = true ;
} else {
IDEntered = $(this).val() ;
if (!validateAMRSIDInputField(IDEntered, formerIDEntered)) {
displayMessage('Initially entered ID and current ID do not match. Please enter again'
, alertMessageSection) ;
clearTextField($(this)) ;
} else {
displayMessage('comparison ok', alertMessageSection);
}
IDInputFieldEntered = false ;
formerIDEntered = IDEntered ;
}
}) ;
var clearTextField = function(inputTextField) {
$(inputTextField).val('') ;
}
var displayMessage = function (message, alertMessageSection) {
if(message && message.length > 0) {
$(alertMessageSection).text(message) ;
}
} ;
var validateAMRSIDInputField = function (initialField, currentField) {
if ((initialField && initialField.length > 0) &&
(currentField && currentField.length > 0)) {
return initialField == currentField ;
}
return false ;
} ;
$('#type_of_id_used').change(function() {
var selectedIDType = $(this).find(':selected').val() ;
loadSelectedIDInputType(selectedIDType) ;
});
var loadSelectedIDInputType = function(selectedIDType) {
hideAllIDTypesFields() ;
displaySelectedIDInputField('#' + selectedIDType) ;
};
var hideAllIDTypesFields = function () {
$('.id_group').hide() ;
} ;
var displaySelectedIDInputField = function(selectedIDInputType) {
$(selectedIDInputType).show() ;
} ;
hideAllIDTypesFields() ;
$('#dispensary_form').validate({
rules: {
pulse: {
number: true,
range: [0, 230]
},
temperature_c: {
number: true,
range: [25, 43]
},
weight_kg: {
number: true,
range: [0, 250]
},
height_cm: {
number: true,
range: [10, 228]
},
glycosylated_hemoglobin: {
number: true,
range: [0, 20]
},
'obs.tmp_drugs': {
checkNoneSelectedAlone: true
},
'1069^REVIEW OF SYSTEMS, GENERAL^99DCT': {
checkNoneSelectedAlone: true
},
'obs.drugs_dispensed': {
checkNoneSelectedAlone: true
},
'6327^PATIENT EDUCATION RECEIVED THIS VISIT^99DCT': {
checkNoneSelectedAlone: true
},
'1272^REFERRALS ORDERED^99DCT': {
checkNoneSelectedAlone: true
}
},
submitHandler: function (form) {
document.submit();
}
});
/* Start - Checking that the diastolic blood pressure is less than the systolic blood pressure */
$.validator.addMethod("lessThankSystolic", function (value, element) {
var systolicBloodPressure = parseInt($(element).closest('.section').find('.systolicBloodPressure').val());
return (parseInt(value) <= systolicBloodPressure);
}, "DBP cannot be more than Systolic Blood Pressure."
);
// attach 'lessThankSystolic' class to perform validation.
jQuery.validator.addClassRules({
lessThankSystolic: { lessThankSystolic: true }
});
/* End - lessThankSystolic*/
/* Start - Based on Selected medication prescribed show dispensed fields */
var selectCorrespondingDrugsDispensed = function (selectedElement) {
var drugsArray = {"#obs\\.drugs_dispensed\\.Metformin": "#metformin_dispense",
"#obs\\.drugs_dispensed\\.Glibenclamide": "#glibenclamide_dispense",
"#obs\\.drugs_dispensed\\.Enalapril": "#enalapril_dispense",
"#obs\\.drugs_dispensed\\.HCTZ": "#hctz_dispense",
"#obs\\.drugs_dispensed\\.Losartan": "#losartan_dispense",
"#obs\\.drugs_dispensed\\.Nifedipine": "#nifedipine_dispense",
"#obs\\.drugs_dispensed\\.Other": "#other_medication"
};
$.each(drugsArray, function (k, v) {
if ($(k).is(':checked')) {
$(v).show();
} else {
$(v).hide();
}
})
};
var $obs_drugs_dispensed = $('input[name="obs.drugs_dispensed"]');
$obs_drugs_dispensed.change(function () {
selectCorrespondingDrugsDispensed();
});
$obs_drugs_dispensed.trigger('change');
/* End - Based on Selected medication prescribed show dispensed fields */
/* Start - Based on Current medication prescribed show dosage fields */
var selectCorrespondingCurrentMedication = function (selectedElement) {
var drugsArray = {"#obs\\.tmp_drugs\\.Metformin": "#medication_metformin",
"#obs\\.tmp_drugs\\.Glibenclamide": "#medication_glibenclamide",
"#obs\\.tmp_drugs\\.Enalapril": "#medication_enalapril",
"#obs\\.tmp_drugs\\.HCTZ": "#medication_hctz",
"#obs\\.tmp_drugs\\.Losartan": "#medication_losartan",
"#obs\\.tmp_drugs\\.Nifedipine": "#medication_nifedipine",
"#obs\\.tmp_drugs\\.Other": "#medication_other"
};
$.each(drugsArray, function (k, v) {
$(k).change(function () {
if ($(k).is(':checked')) {
$(v).show();
} else {
$(v).hide();
}
});
$(k).trigger('change');
})
};
selectCorrespondingCurrentMedication();
/* End - Based on Current medication prescribed show dosage fields */
/* When a provider is selected from the provider list, hide the provider id text field */
$('#encounter\\.provider_id_select').change(function () {
var $show_provider_id_text = $('.show_provider_id_text');
var selected_value = $('#encounter\\.provider_id_select').val();
if (selected_value != '') {
$show_provider_id_text.find('input').val(selected_value);
}
else {
$show_provider_id_text.find('input').val('');
}
});
/* Start - If some medication dose was missed, ask for reason */
var displayReasonForMissingMedicationWhenNeeded = function (selectedElement) {
var drugsArray = {"#obs\\.medication_metformin\\.number_of_pills_taken": ".metformin_missed_medication_reason",
"#obs\\.medication_glibenclamide\\.number_of_pills_taken": ".glibenclamide_missed_medication_reason",
"#obs\\.medication_enalapril\\.number_of_pills_taken": ".enalapril_missed_medication_reason",
"#obs\\.medication_hctz\\.number_of_pills_taken": ".hctz_missed_medication_reason",
"#obs\\.medication_losartan\\.number_of_pills_taken": ".losartan_missed_medication_reason",
"#obs\\.medication_nifedipine\\.number_of_pills_taken": ".nifedipine_missed_medication_reason"
};
$.each(drugsArray, function (pillsTaken, missedReason) {
$(pillsTaken).change(function () {
var selected_value = $(pillsTaken).val();
var $reason = $(missedReason);
if (selected_value != '' && selected_value != '1163^ALL^99DCT') {
$reason.show();
}
else {
$reason.hide();
}
});
$(pillsTaken).trigger('change');
})
};
displayReasonForMissingMedicationWhenNeeded();
/* End - Start - If some medication dose was missed, ask for reason */
/* Start - Asks for the dosage of other medication in ml only if it is not provided in mg */
$(document.body).on('change', '.otherMedicationNumberOfMilligram', function () {
$other_medication_number_of_milliliter_group = $(this).closest('.section').children('.other_medication_number_of_milliliter_group');
if ($(this).val() != '') {
$other_medication_number_of_milliliter_group.hide();
$other_medication_number_of_milliliter_group.find('input').val('');
} else {
$other_medication_number_of_milliliter_group.show();
}
});
$('#other_medication_number_of_milligram').trigger('change');
/* End - Asks for the dosage of other medication in ml only if it is not provided in mg */
/* Start - Ask for menstrual & urine pregnancy info only if the client is a woman*/
var $patientSex = $('#patient\\.sex');
$patientSex.change(function () {
var $menstrualPeriod = $('.menstrualPeriod');
var $urinePregnancyTestQualitative = $('.urinePregnancyTestQualitative');
if ($patientSex.val() != 'F') {
$menstrualPeriod.hide();
$menstrualPeriod.find('select').val('');
$urinePregnancyTestQualitative.hide();
$urinePregnancyTestQualitative.find('select').val('');
} else {
$menstrualPeriod.show();
$urinePregnancyTestQualitative.show();
}
});
$patientSex.trigger('change');
/* End - Ask for menstrual & urine pregnancy info only if the client is a woman*/
/* Start - Checks that a field is a decimal */
$.validator.addClassRules({
systolicBloodPressure: {
number: true,
range: [50, 300]
},
diastolicBloodPressure: {
number: true,
range: [20, 150]
},
glucose: {
number: true,
range: [0, 150]
},
numberOfTablets: {
number: true,
range: [0, 180]
},
numberOfMilligrams: {
number: true,
range: [0.0, 1000.0]
}
});
/* End - Checks that a field is a decimal */
/* Start - Compute the BMI if the weight & height are provided */
var $weight = $('#weight_kg');
var $height = $('#height_cm');
var $bodyMassIndex = $('.bodyMassIndex');
var displayBMI = function () {
if (($weight.val() != '') && ($height.val() != '')) {
$bodyMassIndex.find('input').val(computeBMI());
$bodyMassIndex.show();
} else {
$bodyMassIndex.hide();
}
};
var computeBMI = function () {
var weight = parseInt($weight.val());
var height = parseInt($height.val()) / 100;
return weight / (height * height);
};
$weight.change(displayBMI());
$weight.trigger('change');
$height.change(displayBMI);
$height.trigger('change');
/* End - Compute the BMI if the weight & height are provided */
/* Start - Based on Current medication, and medication prescribed, show or hide "dosage changed" fields */
var showOrHideDosageChanged = function (drugCurrent, drugDispensed, dosageChanged) {
if ($(drugCurrent).is(':checked') && $(drugDispensed).is(':checked')) {
$(dosageChanged).show();
} else {
$(dosageChanged).find("select").val('');
$(dosageChanged).find("select").trigger('change');
$(dosageChanged).hide();
}
}
var selectCorrespondingDosageChanged = function (selectedElement) {
var drugsArray = {
"Metformin": "#metformin_dosage_changed",
"Glibenclamide": "#glibenclamide_dosage_changed",
"Enalapril": "#enalapril_dosage_changed",
"HCTZ": "#hctz_dosage_changed",
"Losartan": "#losartan_dosage_changed",
"Nifedipine": "#nifedipine_dosage_changed"
};
$.each(drugsArray, function (k, v) {
var drugCurrent = "#obs\\.tmp_drugs\\." + k;
var drugDispensed = "#obs\\.drugs_dispensed\\." + k;
var dosageChanged = v;
$(drugCurrent).change(function () {
showOrHideDosageChanged(drugCurrent, drugDispensed, dosageChanged)
});
$(drugDispensed).change(function () {
showOrHideDosageChanged(drugCurrent, drugDispensed, dosageChanged)
});
$(drugCurrent).trigger('change');
})
};
selectCorrespondingDosageChanged();
/* End - Based on Current medication, and medication prescribed, show or hide "dosage changed" fields */
/* Start - Based on "Did you change the xx dosage" show or hide "prescribed dosage" fields */
var showOrHidePrescribedDosage = function (selectedElement) {
var drugsArray = ["metformin", "glibenclamide", "enalapril", "enalapril", "hctz", "losartan", "nifedipine"];
$.each(drugsArray, function (index, v) {
var changeDosageSelect = "#obs\\.other_medication_order_" + v;
var prescribedDosage = "#" + v + "_prescribed_dosage";
var currentDosage = "#" + v + "_number_of_milligram";
$(changeDosageSelect).change(function () {
if ($(changeDosageSelect).val() == "1066^NO^99DCT") {
$(prescribedDosage).find('input').val($(currentDosage).val());
$(prescribedDosage).hide();
} else {
$(prescribedDosage).show();
}
});
$(currentDosage).change(function () {
if ($(changeDosageSelect).val() == "1066^NO^99DCT") {
$(prescribedDosage).find('input').val($(currentDosage).val());
}
})
$(changeDosageSelect).trigger('change');
})
};
showOrHidePrescribedDosage();
/* End - Based on Selected medication prescribed show dispensed fields */
/* Start - Define variables for conditional displays */
var $systolicBloodPressure = $('#obs\\.systolic_blood_pressure');
var $diastolicBloodPressure = $('#obs\\.diastolic_blood_pressure');
var $currentVisitType = $('#obs\\.current_visit_type');
var $metforminCurrentMilligram = $('#metformin_number_of_milligram');
var $urinePregnancyTest = $('#obs\\.urine_pregnancy_test_qualitative');
var $serumGlucoseFasting = $('#obs\\.serum_glucose_fasting');
var $glycosylatedHemoglobin = $('#glycosylated_hemoglobin');
var $metforminFrequencyPerDay = $('#obs\\.medication_metformin\\.medication_frequency_per_day');
var getCurrentMedicationValues = function () {
return $('input[name="obs.tmp_drugs"]:checked').map(function () {
return this.value;
}).get();
};
var getReviewOfSystemsGeneralValues = function () {
return $('input[name="1069^REVIEW OF SYSTEMS, GENERAL^99DCT"]:checked').map(function () {
return this.value;
}).get();
};
var checkReviewOfSystemsGeneralForDisplay = function () {
var reviewOfSystemsGeneral = getReviewOfSystemsGeneralValues();
return reviewOfSystemsGeneral.indexOf("590^EDEMA, LEGS^99DCT") < 0 && reviewOfSystemsGeneral.indexOf("5963^SHORTNESS OF BREATH WITH EXERTION^99DCT") < 0 &&
reviewOfSystemsGeneral.indexOf("6021^OLIGURIA^99DCT") < 0 && reviewOfSystemsGeneral.indexOf("6005^FOCAL WEAKNESS^99DCT") < 0;
};
/* End - Define variables for conditional displays */
/* Start - Conditional display of HTN reminders */
var displayHTNReminder1 = function () {
var $htn_reminder_1 = $('#htn_reminder_1');
var selectedVisitType = $currentVisitType.val();
var systolicBloodValue = parseFloat($systolicBloodPressure.val());
var diastolicBloodValue = parseFloat($diastolicBloodPressure.val());
var currentMedication = getCurrentMedicationValues();
if ((selectedVisitType == '7034^FIRST DISPENSARY VISIT AFTER HCT^99DCT' || selectedVisitType == '7035^SECOND DISPENSARY VISIT AFTER HCT ^99DCT') &&
(systolicBloodValue >= 100 && systolicBloodValue <= 140) && (diastolicBloodValue >= 50 && diastolicBloodValue <= 90) &&
currentMedication.indexOf("enalapril") < 0 && currentMedication.indexOf("hctz") < 0 && currentMedication.indexOf("losartan") < 0
&& currentMedication.indexOf("nifedipine") < 0 && checkReviewOfSystemsGeneralForDisplay()
) {
$htn_reminder_1.show();
} else {
$htn_reminder_1.hide();
}
};
displayHTNReminder1();
var $urinePregnancyTestQualitative = $('#obs\\.urine_pregnancy_test_qualitative');
var $birthdate = $('#patient\\.birthdate');
var conditionToDisplayHTNReminder2 = function () {
var selectedVisitType = $currentVisitType.val();
var systolicBloodValue = parseFloat($systolicBloodPressure.val());
var diastolicBloodValue = parseFloat($diastolicBloodPressure.val());
var urinePregnancyTestQualitativeValue = $urinePregnancyTestQualitative.val();
var reviewOfSystemsGeneral = getReviewOfSystemsGeneralValues();
return ((selectedVisitType == '7034^FIRST DISPENSARY VISIT AFTER HCT^99DCT') &&
((systolicBloodValue >= 140 && systolicBloodValue <= 180) || (diastolicBloodValue >= 90 && diastolicBloodValue <= 110)) &&
urinePregnancyTestQualitativeValue != '703^POSITIVE^99DCT' &&
checkReviewOfSystemsGeneralForDisplay());
};
var displayHTNReminder2 = function () {
var $htn_reminder_2 = $('#htn_reminder_2');
var birthdate = $birthdate.val();