-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinputForm(HTML).txt
2076 lines (1969 loc) · 103 KB
/
inputForm(HTML).txt
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<title>Smilepoint - Insurance Verification Form</title>
<meta name="generator" content="BCL easyConverter SDK 5.0.08">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?!= include('Stylesheet'); ?>
<script>
//Load some fixed dropdowns
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("Frequency Types", "H", 4, "frequency");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("Office List", "A", 3, "basicInfo1");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("Service codes", "A", 3, "ada");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown2).getDropdown("Waiting Period", "A", 3, "waitingPeriod");
//Success handler function of above asynchrous calls to load dropdown values in "Datalists"
function dropdown(dropdown) {
var datalist = document.getElementById(dropdown[0]);
var len = dropdown.length;
var options = "";
for (i = 1; i < len; i++) {
options = options + "<option value='" + dropdown[i] + "'>" + dropdown[i] + "</option>";
}
datalist.innerHTML = options;
}
//Success handler function of above asynchrous calls to load dropdown values in "Select"
function dropdown2(dropdown) {
var datalist = document.getElementsByClassName(dropdown[0]);
var len = dropdown.length;
var options = "";
for (i = 1; i < len; i++) {
options = options + "<option value='" + dropdown[i] + "'>" + dropdown[i] + "</option>";
}
for (n in datalist) {
datalist[n].innerHTML = options;
}
}
//Success handler function of asynchrous call in function getDrop(element) to set Tax ID
function setValue1(value) {
if(value == "Not Found"){
document.getElementById("errors").innerHTML += "No TaxId Found";
}
var element = document.getElementById(value[0]);
element.value = value[1];
}
//Error handler functions for all asynchronous calls
function failed(e) {
document.getElementById("loading").innerHTML = "";
document.getElementById("errors").innerHTML += "Asynchronous call function error : "+e+"----";
}
// function which is called when any reset button is clicked to clear all data
function inputReset(id) {
var table = document.getElementById(id);
var inputs = table.getElementsByTagName("input");
var selects = table.getElementsByTagName("select");
for (n in inputs) {
if (inputs[n].type == "radio") {
inputs[n].checked = false;
}
else {
inputs[n].value = "";
}
}
for (n in selects) {
selects[n].selectedIndex = 0;
}
}
// function to validate SSN value in XXX-XX-XXXX format
function validate() {
var ssn = document.getElementById("basicInfo13");
var value = ssn.value + "";
var array = "";
for (var i = 0; i <= value.length; i++) {
array = array + value.charAt(i);
if (i == 2 || i == 4) {
array = array + "-";
}
}
ssn.value = array;
}
//function to evaluate which radio button to be selected
function evaluateRadio(id, value) {
var element = document.getElementsByClassName(id);
for (n in element) {
if (element[n].value == value) {
element[n].checked = true;
}
}
}
//function to evaluate which the value of date or option selected in select element
function evaluate(id, value) {
var element = document.getElementById(id);
if (element.type == "date") {
element.value = value;
}
else {
var options = element.options;
for (n in options) {
if (options[n].value == value) {
element.selectedIndex = n;
}
}
}
}
//Function called when "Fill By Employer" Button Is clicked by user to
function fill() {
var sheet;
var selectedForm = <?= selectedForm ?>;
var basicInfo1 = document.getElementById("basicInfo1");
var officeName = basicInfo1.options[basicInfo1.selectedIndex].value;
var empName = document.getElementById("basicInfo10").value;
if(selectedForm == "medicaidForm" || selectedForm == "medicaid"){
sheet = "Medicaid";
} else{
sheet = officeName;
}
document.getElementById("loading").innerHTML = '<p class="buttonload" style="text-align: left;font-size:30px;color:black"><i class="fa fa-spinner fa-spin"></i>Loading</p>';
google.script.run.withFailureHandler(failed).withSuccessHandler(setByEmp).getValuesByEmpName(sheet, empName);
}
//Success Handler function for the asynchronous call made in fill() function to set the values by employer
function setByEmp(values) {
if (values == "Not Found") {
document.getElementById("loading").innerHTML = "";
document.getElementById("errors").innerHTML += "No Values Found in Method : setByEmp----";
} else if(values[117] === "Fill By Employee"){
document.getElementById("basicInfo20").value = values[111]; //Insurance Address
document.getElementById("basicInfo18").value = values[112]; //PayerID
document.getElementById("basicInfo7").value = values[113]; //Contact number
document.getElementById("basicInfo3").value = values[114]; //Insurance Name
document.getElementById("basicInfo14").value = values[115]; //Group#
evaluateRadio("policy17",values[116]); // CRA
}
//Commented lines are not text values they are either date , select or radio button values
document.getElementById("policy1").value = values[0];
document.getElementById("policy2").value = values[1];
//document.getElementById("policy3").value = values[2];
document.getElementById("policy4").value = values[3];
document.getElementById("policy5").value = values[4];
//document.getElementById("policy6").value = values[5];
document.getElementById("policy7").value = values[6];
document.getElementById("policy8").value = values[7];
document.getElementById("policy9").value = values[8];
document.getElementById("policy10").value = values[9];
document.getElementById("policy11").value = values[10];
/*document.getElementById("policy12").value = values[11];
document.getElementById("policy13").value = values[12];
document.getElementById("policy14").value = values[13];
document.getElementById("policy15").value = values[14];*/
document.getElementById("policy16").value = values[15];
document.getElementById("percentages1").value = values[16];
//document.getElementById("percentages2").value = values[17];
document.getElementById("percentages3").value = values[18];
//document.getElementById("percentages4").value = values[19];
document.getElementById("percentages5").value = values[20];
//document.getElementById("percentages6").value = values[21];
document.getElementById("percentages7").value = values[22];
//document.getElementById("percentages8").value = values[23];
document.getElementById("percentages9").value = values[24];
document.getElementById("percentages10").value = values[25];
document.getElementById("percentages11").value = values[26];
/*document.getElementById("percentages11").value = values[27];
document.getElementById("percentages11").value = values[28];
document.getElementById("percentages11").value = values[29];*/
document.getElementById("prosthetics4").value = values[30];
/*document.getElementById("waitingPeriod1").value = values[31];
document.getElementById("waitingPeriod2").value = values[32];*/
document.getElementById("ssc1").value = values[33];
document.getElementById("ssc2").value = values[34];
document.getElementById("exams1").value = values[35];
document.getElementById("exams2").value = values[36];
document.getElementById("exams3").value = values[37];
document.getElementById("exams4").value = values[38];
document.getElementById("xrays1").value = values[39];
document.getElementById("xrays2").value = values[40];
document.getElementById("xrays3").value = values[41];
document.getElementById("xrays4").value = values[42];
//document.getElementById("xrays5").value = values[43];
document.getElementById("fluroide1").value = values[44];
document.getElementById("fluroide2").value = values[45];
document.getElementById("fluroide3").value = values[46];
document.getElementById("fluroide4").value = values[47];
document.getElementById("sealantsD").value = values[48];
document.getElementById("sealants1").value = values[49];
document.getElementById("sealants2").value = values[50];
document.getElementById("sealants3").value = values[51];
document.getElementById("sealants4").value = values[52];
document.getElementById("sealants5").value = values[53];
document.getElementById("prophy1").value = values[54];
document.getElementById("prophy2").value = values[55];
document.getElementById("rollage").value = values[56];
document.getElementById("perio1").value = values[57];
document.getElementById("perio2").value = values[58];
//document.getElementById("perio3").value = values[59];
document.getElementById("perio4").value = values[60];
document.getElementById("perioMnt1").value = values[61];
document.getElementById("perioMnt2").value = values[62];
document.getElementById("perioMnt3").value = values[63];
document.getElementById("perioMnt4").value = values[64];
document.getElementById("perioMnt5").value = values[65];
document.getElementById("perioMnt6").value = values[66];
document.getElementById("perioMnt7").value = values[67];
document.getElementById("sedations1").value = values[68];
document.getElementById("sedations2").value = values[69];
document.getElementById("sedations3").value = values[70];
document.getElementById("extractions1").value = values[71];
document.getElementById("extractions2").value = values[72];
document.getElementById("oral1").value = values[73];
document.getElementById("oral2").value = values[74];
//document.getElementById("oral3").value = values[75];
document.getElementById("oral4").value = values[76];
//document.getElementById("oral5").value = values[77];
document.getElementById("oral6").value = values[78];
document.getElementById("dentures1").value = values[79];
document.getElementById("dentures2").value = values[80];
document.getElementById("dentures3").value = values[81];
document.getElementById("dentures4").value = values[82];
//document.getElementById("dentures5").value = values[83];
document.getElementById("dentures6").value = values[84];
document.getElementById("implants1").value = values[85];
document.getElementById("implants2").value = values[86];
document.getElementById("implants3").value = values[87];
document.getElementById("implants4").value = values[88];
document.getElementById("posterior1").value = values[89];
document.getElementById("posterior2").value = values[90];
//document.getElementById("posterior3").value = values[91];
document.getElementById("posterior4").value = values[92];
document.getElementById("posterior5").value = values[93];
//document.getElementById("posterior6").value = values[94];
document.getElementById("posterior7").value = values[95];
document.getElementById("posterior8").value = values[96];
document.getElementById("posterior9").value = values[97];
document.getElementById("posterior10").value = values[98];
document.getElementById("posterior11").value = values[99];
//document.getElementById("posterior12").value = values[100];
document.getElementById("ortho1").value = values[101];
document.getElementById("ortho2").value = values[102];
document.getElementById("ortho3").value = values[103];
//document.getElementById("ortho4").value = values[104];
//document.getElementById("fillings").value = values[105];
document.getElementById("comments").value = values[106];
document.getElementById("benefits").value = values[107];
document.getElementById("date").value = values[108];
document.getElementById("basicInfo21").value = values[109];
document.getElementById("percentages12").value = values[110];
// Radio Arrays
var radioVariables = ["policy12", "policy13", "policy14", "policy15", "percentages2", "percentages4", "percentages6"
, "percentages8", "prosthetics1", "prosthetics2", "prosthetics3", "xrays5", "perio3", "fillings", "oral3", "oral5", "dentures5"
, "posterior3", "posterior6", "posterior12", "ortho4"];
var radioValues = [values[11], values[12], values[13], values[14], values[17], values[19], values[21],
values[23], values[27], values[28], values[29], values[43], values[59], values[105], values[75], values[77], values[83],
values[91], values[94], values[100], values[104]];
//Radio Call
for (n in radioVariables) {
evaluateRadio(radioVariables[n], radioValues[n]);
}
//Select(Dropdown) Arrays
var selectVariables = ["policy3", "policy6", "waitingPeriod1", "waitingPeriod2"];
var selectValues = [values[2], values[5], values[31], values[32]];
//Select(Dropdown) Call
for (n in selectVariables) {
evaluate(selectVariables[n], selectValues[n]);
}
//Date Arrays
var dateVariables = ["policy2", "policy5"];
var dateValues = [values[1], values[4]];
//Date Call
for (n in dateVariables) {
evaluate(dateVariables[n], dateValues[n]);
}
document.getElementById("loading").innerHTML = "";
}
//function called when page loads to determine weather it is a blank ppo, blank medicaid, recall by patient , recall by policy holder, recall by employer name Form or A pending IV request is started
function load() {
var officeName = <?= officeNameAll ?>;
var patientName = <?= patientName ?>;
var patientDob = <?= patientDob ?>;
var policyHolder = <?= policyHolder ?>;
var policyDob = <?= policyDob ?>;
var empName = <?= empName ?>;
var sName = <?= sName ?>;
var sPolicyHolderName = <?= sPolicyHolderName ?>;
var sInsName = <?= sInsName ?>;
var sAppointmentDate = <?= sAppointmentDate ?>;
var sIvType = <?= sIvType ?>;
var sReqDate = <?= sReqDate ?>;
var sAssignedTo = <?= sAssignedTo ?>;
var selectedForm = <?= selectedForm ?>;
//Recall by Patient
if (patientName != "empty") {
document.getElementById("loading").innerHTML = '<p class="buttonload" style="text-align: left;font-size:30px;color:black"><i class="fa fa-spinner fa-spin"></i>Loading</p>';
google.script.run.withFailureHandler(failed).withSuccessHandler(setData).getValuesByPatient(officeName, patientName, patientDob);
}
//Recall by Policy Holder
else if (policyHolder != "empty") {
document.getElementById("loading").innerHTML = '<p class="buttonload" style="text-align: left;font-size:30px;color:black"><i class="fa fa-spinner fa-spin"></i>Loading</p>';
google.script.run.withFailureHandler(failed).withSuccessHandler(setData).getValuesByPolicy(officeName, policyHolder, policyDob);
}
//Recall by Employer
else if (empName != "empty") {
document.getElementById("loading").innerHTML = '<p class="buttonload" style="text-align: left;font-size:30px;color:black"><i class="fa fa-spinner fa-spin"></i>Loading</p>';
google.script.run.withFailureHandler(failed).withSuccessHandler(setData).getValuesByEmployer(officeName, empName);
}
//A pending IV request is started
else if (sName != "empty") {
document.getElementById("loading").innerHTML = '<p class="buttonload" style="text-align: left;font-size:30px;color:black"><i class="fa fa-spinner fa-spin"></i>Loading</p>';
google.script.run.withFailureHandler(failed).withSuccessHandler(setStartIV).getByStartIV(sName, sPolicyHolderName, sInsName, sAppointmentDate, sIvType, sReqDate, sAssignedTo);
}
//For Blank Medicaid form
if(selectedForm == "medicaidForm" || selectedForm == "medicaid"){
var sheet = "Medicaid Drop Downs";
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown(sheet, "A", 2, "fee");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown(sheet, "B", 2, "emp");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown(sheet, "C", 2, "insNames");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown(sheet, "D", 2, "coverage");
}
sDate();
}
//Success hander function called when asynchronous call in "A pending IV request is started" block of load() function is completed to set found values
function setStartIV(values) {
if (values == "Not Found") {
document.getElementById("loading").innerHTML = "";
document.getElementById("errors").innerHTML += "No Values Found in Method : setStartIV ";
}
document.getElementById("basicInfo1").value = values[0];
getDrop(document.getElementById("basicInfo1")); // Calling function to get list of Insurances and Employer Name according to office when office is selected
document.getElementById("basicInfo2").value = values[1];
document.getElementById("basicInfo3").value = values[2];
document.getElementById("basicInfo5").value = values[3];
document.getElementById("basicInfo6").value = values[4];
document.getElementById("basicInfo7").value = values[5];
document.getElementById("basicInfo9").value = values[6];
evaluateRadio("basicInfo11", values[7]); //document.getElementById("basicInfo11").value = values[10];
document.getElementById("basicInfo14").value = values[8];
document.getElementById("basicInfo16").value = values[9];
document.getElementById("basicInfo17").value = values[10];
document.getElementById("basicInfo18").value = values[11];
document.getElementById("basicInfo19").value = values[12];
document.getElementById("benefits").value = values[13];
document.getElementById("basicInfo21").value = values[14];
document.getElementById("loading").innerHTML = "";
}
//Success handler function when any asynchronous call is made by load() function in recall blocks
function setData(values) {
if (values == "Not Found") {
document.getElementById("loading").innerHTML = "";
document.getElementById("errors").innerHTML += "No Values Found in Method : setData ";
}
document.getElementById("basicInfo1").value = values[0];
getDrop(document.getElementById("basicInfo1")); // Calling function to get list of Insurances and Employer Name according to office when office is selected
document.getElementById("basicInfo2").value = values[1];
document.getElementById("basicInfo3").value = values[2];
document.getElementById("basicInfo4").value = values[3];
document.getElementById("basicInfo5").value = values[4];
document.getElementById("basicInfo6").value = values[5];
document.getElementById("basicInfo7").value = values[6];
document.getElementById("basicInfo8").value = values[7];
document.getElementById("basicInfo9").value = values[8];
document.getElementById("basicInfo10").value = values[9];
evaluateRadio("basicInfo11", values[10]); //document.getElementById("basicInfo11").value = values[10];
document.getElementById("basicInfo12").value = values[11];
document.getElementById("basicInfo13").value = values[12];
document.getElementById("basicInfo14").value = values[13];
document.getElementById("basicInfo15").value = values[14];
document.getElementById("basicInfo16").value = values[15];
document.getElementById("basicInfo17").value = values[16];
document.getElementById("basicInfo18").value = values[17];
document.getElementById("basicInfo19").value = values[18];
document.getElementById("basicInfo20").value = values[19];
//Dertmining from which index values are to be passed
var array = [];
var count = 20;
for (i = 0; i <= 109; i++) {
array[i] = values[count];
count++;
}
setByEmp(array);
//Now Setting History
count = 130;
for (var i=0;i<=179;i++) {
array[i] = values[count];
count++;
}
historyFetched(array);
evaluateRadio("policy17",values[310]);//document.getElementById("policy117").value = values[312];
document.getElementById("percentages12").value = values[311];
document.getElementById("loading").innerHTML = "";
}
//Function that is called when fetch button is clicked by user
function getHistory() {
document.getElementById("loadHistory").innerHTML = '<p class="buttonload" style="text-align: left;font-size:15px;color:black"><i class="fa fa-spinner fa-spin"></i>Loading</p>';
var officeName = document.getElementById("basicInfo1").options[document.getElementById("basicInfo1").selectedIndex].value;
var selected = document.getElementsByName("historySelect")[0].options[
document.getElementsByName("historySelect")[0].selectedIndex].value;
google.script.run.withFailureHandler(failed).withSuccessHandler(historyFetched).getHistory(selected,officeName);
}
//Success handler function for asynchronous call made in getHistory() function to set dynamic values fetched for history
function historyFetched(values) {
document.getElementById("loadHistory").innerHTML = '<button onclick="getHistory()" type="button" style="float: right;">Fetch History</button>';
if (values === "empty") {
return alert("Selected Wrong Plan Type");
}
var table = document.getElementById("history");
var count = 0;
var row = 0;
var txt = "<th>ADA Code</th><th>Tooth No.</th><th>DOS</th>"
+ "<th>ADA Code</th><th>Tooth No.</th><th>DOS</th>"
+ "<th>ADA Code</th><th>Tooth No.</th><th>DOS</th>"
+ "<tr>";
for (n in values) {
switch (count) {
case 0:
txt = txt + "<td><input list='ada' class='history' name='history' style='width:100%;margin-right: 0%' value='" + values[n] + "'></td>";
row++;
count++;
break;
case 1:
txt = txt + "<td><input type='text' class='history' name='history' style='width:100%;margin-right: 0%' value='" + values[n] + "'></td>";
row++;
count++;
break;
case 2:
txt = txt + "<td><input type='date' class='history' name='history' style='width:100%;margin-right: 0%' value='" + values[n] + "'></td>";
row++;
count = 0;
break;
}
if (row % 9 == 0) {
txt = txt + "</tr><tr>";
}
}
txt = txt + "</tr>";
table.innerHTML = txt;
}
//Function to get dropdown values depending on which form and and office is selected in the form.
//This function will work on for PPO forms else will set value of taxID and return null
//This function will be called once when page load() function is executed and onchange event of office field
function getDrop(element) {
var selectedForm = <?= selectedForm ?>; // Determining PPO form or Medicaid Form
var options = element.options;
var officeName = options[element.selectedIndex].value;
var frame = document.getElementById("frame");
var col;
google.script.run.withFailureHandler(failed).withSuccessHandler(setValue1).searchValue("Tax ID",officeName, "B", 2, "basicInfo4");
switch (officeName) {
case "Jasper":
col = "A";
frame.src = "https://docs.google.com/spreadsheets/d/1s-livS4wwNymvofKaUFnO6lLNLXwCQFdaRNUtG8MPtM/edit#gid=1162760822";
break;
case "Crosby":
col = "B";
frame.src = "https://docs.google.com/spreadsheets/d/1ui0CwDiIBuZ7qV3IHhcTl1Y7dKbTzNbGG45yJzZ8EEM/edit#gid=1162760822";
break;
case "Rockdale":
col = "C";
frame.src = "https://docs.google.com/spreadsheets/d/1l6--wG7yqXgee92MUo3puzFKbp908R9J2lzMLd7OfSI/edit#gid=1162760822";
break;
case "Beaumont":
col = "D";
frame.src = "https://docs.google.com/spreadsheets/d/1Q4HOGJxOjUdb-nWr82NjZA_OzJRJYfEsJtB2eRAG-_A/edit#gid=1162760822";
break;
case "Liberty":
col = "E";
frame.src = "https://docs.google.com/spreadsheets/d/1iJ-hKrGB2OdvYiUH4wSR6BWRtawrP-qpnWJrj-SiQTc/edit#gid=1162760822";
break;
case "Lavaca":
col = "F";
frame.src = "https://docs.google.com/spreadsheets/d/1eP_kwnhUHfOV3vHrfdR5s3vyRadL1Vo-GVIXkRACmjI/edit#gid=1162760822";
break;
case "Riverwalk":
col = "G";
frame.src = "https://docs.google.com/spreadsheets/d/1POttOqe4UAiaWouBeHpkICrnrea1se5dENWDHmWSbBI/edit#gid=1162760822";
break;
case "Sinton":
col = "H";
frame.src = "https://docs.google.com/spreadsheets/d/1DnA0hqJdjpIhCvMtEei1rkXdRdMTJmZgMPZRx1izvaQ/edit#gid=1162760822";
break;
case "Splendora":
col = "I";
frame.src = "https://docs.google.com/spreadsheets/d/17qpRbiQjWCbs6iITnPmYKIY78WQJHkKnkOid7N-PRF4/edit#gid=1162760822";
break;
case "Victoria":
col = "J";
frame.src = "https://docs.google.com/spreadsheets/d/1jm94juWQYS5xE06_3UHhCTBMmbRv_sK_Gb7Vlt-E5wQ/edit#gid=1162760822";
break;
case "Lytle":
col = "K";
frame.src = "https://docs.google.com/spreadsheets/d/1XSl4ySEC8M9nxHeu87rbhH_j45Adhyw9i3-LTvRJUH4/edit#gid=1162760822";
break;
case "Calallen":
col = "L";
frame.src = "https://docs.google.com/spreadsheets/d/13RwSVHnpOgtumeBk0dn2dMZguw2NiIR3zipkuTUsl20/edit#gid=1162760822";
break;
case "Westgreen":
col = "M";
frame.src = "https://docs.google.com/spreadsheets/d/1JPBopiWqHc2mLzR8rJCWYk4eyCXRGf7vAGRGlxptYZw/edit#gid=1162760822";
break;
}
if(selectedForm == "medicaidForm" || selectedForm == "medicaid"){ return null; }
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("Employer Master", col, 2, "emp");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("Insurance Master", col, 2, "insNames");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("FS Master", col, 2, "fee");
google.script.run.withFailureHandler(failed).withSuccessHandler(dropdown).getDropdown("Coverage Book ", col, 2, "coverage")
}
function setCRA(id,val){
var elements = document.getElementsByClassName(id);
val = val.toLowerCase();
if(val==="children medicaid" || val==="adult medicaid" || val==="chip"){
elements[0].checked = true;
}
else{
elements[1].checked = true;
}
}
function add(){
var t = document.getElementById("history");
var r = t.getElementsByTagName("TR").length;
var txt,rows;
if(r < 20){
rows = t.insertRow(r);
rows.innerHTML = '<td class="tr5 td37">'
+' <input list="ada" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td38">'
+' <input type="text" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td39">'
+' <input type="date" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td39">'
+' <input list="ada" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td40">'
+' <input type="text" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td41">'
+' <input type="date" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td40">'
+' <input list="ada" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td42">'
+' <input type="text" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>'
+'<td class="tr5 td42">'
+' <input type="date" class="history" name="history" style="width:100%;margin-right: 0%">'
+'</td>';
} else{
alert("Maximum Row reached : "+r);
}
}
function sDate(){
var d = new Date();
var year = d.getFullYear();
var month = d.getMonth()+1;
var day = d.getDay();
var date;
if(month < 10){
month= "0"+month;
}
if(day < 31){
day = "0"+day;
}
date = year+"-"+month+"-"+day;
document.getElementById("date").value = date;
}
/*
The function making an asynchronous call to fetchFS(officeName, policy18, policy19) in file "getter.gs"
Functionality:
1. Compares the given codes to the sheet.
2. Function requires both policy parameters.
*/
function fetchFS(){
var officeName = document.getElementById("basicInfo1").options[document.getElementById("basicInfo1").selectedIndex].value;
var a= document.getElementById('policy18').value;
var b= document.getElementById('policy19').value;
if(a!="" && b!=""){
google.script.run.withFailureHandler(failed).withSuccessHandler(displayFs).fetchFS(officeName, a, b);
}
else{
document.getElementById("policy20").value="Enter both Code 1 & Code 2";
}
}
function displayFs(strng){
document.getElementById("policy20").value=strng;
}
</script>
</head>
<body onload="load()">
<form action="https://script.google.com/macros/s/AKfycbznTLyuOBFuJLLpZraUYAF_BXb_lJzRz5liyP4O4oairgPl_GDL/exec" method="POST"
target="_top" onsubmit="return confirm('Are you sure you want to submit the form')">
<input type="hidden" name="form" value="record">
<datalist id="frequency">
</datalist>
<datalist id="insNames">
</datalist>
<datalist id="fee">
</datalist>
<datalist id="coverage">
</datalist>
<datalist id="ada">
</datalist>
<datalist id="emp">
</datalist>
<div id="page_1">
<p class="p1 ft1" style="text-align: center">Smilepoint - Insurance Verification Form</p>
<table class="t0" id="basic">
<tbody>
<tr>
<td class="tr1 td0">
<p class="ft2">Office Name:
<select onchange="getDrop(this)" id="basicInfo1" name="basicInfo1" style="width: 54%;float: right">
</select>
<!--______________-->
</p>
</td>
<td class="tr1 td3">
<p class="ft2">Patient Name:
<input id="basicInfo2" type="text" name="basicInfo2">
<!--__________________-->
</p>
</td>
<td class="tr1 td0">
<p class="ft2">Insurance Name:
<input id="basicInfo3" list="insNames" name="basicInfo3">
<!--___________-->
</p>
</td>
<td class="tr1 td2">
<p class="ft2">Tax ID:
<input id="basicInfo4" type="text" name="basicInfo4">
<!--______________-->
</p>
</td>
</tr>
<tr>
<td class="tr2 td0">
<p class="ft2">Policy Holder:
<input id="basicInfo5" type="text" name="basicInfo5">
<!--______________-->
</p>
</td>
<td class="tr2 td3">
<p class="ft2">Patient DOB:
<input id="basicInfo6" type="date" name="basicInfo6">
<!--______________-->
</p>
</td>
<td class="tr2 td0">
<p class="ft2">Insurance Contact:
<input id="basicInfo7" type="text" name="basicInfo7">
<!--______________-->
</p>
</td>
<td class="tr2 td2">
<p class="ft2">CSR Name:
<input id="basicInfo8" type="text" name="basicInfo8">
<!--______________-->
</p>
</td>
</tr>
<tr>
<td class="tr3 td0">
<p class="ft2">Policy Holder DOB:
<input id="basicInfo9" type="date" name="basicInfo9">
<!--______________-->
</p>
</td>
<td class="tr3 td3">
<p class="ft2">Employer Name:
<input id="basicInfo10" list="emp" name="basicInfo10" required >
<!--______________-->
</p>
</td>
<td class="tr3 td0">
<p class="ft2">Continued/Recall/NP:
<span style="float: right">
<input class="basicInfo11" type="radio" name="basicInfo11" value="Continuing Treatment" style="float: none">Cont.
Tx
<input class="basicInfo11" type="radio" name="basicInfo11" value="New Patient" style="float: none">NP
<input class="basicInfo11" type="radio" name="basicInfo11" value="Recall" style="float: none">RC</span>
<!--______________-->
</p>
</td>
<td class="tr3 td2">
<p class="ft2">REF #:
<input id="basicInfo12" type="text" name="basicInfo12">
<!--______________-->
</p>
</td>
</tr>
<tr>
<td class="tr2 td0">
<p class="ft2">Member SSN:
<input id="basicInfo13" type="text" name="basicInfo13" onchange="validate()" maxlength="9">
<!--______________-->
</p>
</td>
<td class="tr2 td3">
<p class="ft2">Group #:
<input id="basicInfo14" type="text" name="basicInfo14">
<!--______________-->
</p>
</td>
<td class="tr2 td4">
<p class="ft2">COB Status:
<input id="basicInfo15" type="text" name="basicInfo15">
<!--______________-->
</p>
</td>
<td class="tr2 td4">
<p class="ft2">Patient ID:
<input id="basicInfo21" type="number" min=1 name="basicInfo21" required >
<!--Added Later-->
<!--______________-->
</p>
</td>
</tr>
<tr>
<td class="tr3 td0">
<p class="ft2">Member ID:
<input id="basicInfo16" type="text" name="basicInfo16">
<!--______________-->
</p>
</td>
<td class="tr3 td3">
<p class="ft2">Appointment:
<input id="basicInfo17" type="date" name="basicInfo17">
<!--______________-->
</p>
</td>
<td class="tr3 td0">
<p class="ft2">Payer ID:
<input id="basicInfo18" type="text" name="basicInfo18">
<!--______________-->
</p>
</td>
<td class="tr3 td2">
<p class="ft2">Provider Last Name:
<input id="basicInfo19" type="text" name="basicInfo19" required >
<!--______________-->
</p>
</td>
</tr>
<tr>
<td colspan="4" class="tr2 td1">
<p class="ft2">Insurance Address:
<input id="basicInfo20" type="text" name="basicInfo20" style="width: 88.2%;">
<!--______________-->
</p>
</td>
</tr>
<tr>
<td class="tr2 td1" colspan=2> </td>
<td class="tr2 td1" id="loading">
</td>
<td class="tr2 td1">
<button onclick="fill()" type="button" style="float: left;">Fill By Employer Name</button>
<button onclick="inputReset('basic')" type="button" style="float: right;">Reset Basic Info</button>
</td>
</tr>
</tbody>
</table>
<p id="errors" style="color:red;font-weight:200;"></p>
<p class="p3 ft1">Policy/Plan Information</p>
<table cellpadding="5" cellspacing="2" class="t1" id="policy">
<tbody>
<tr>
<td colspan=2>
<p class="p2 ft4"><b>Plan Type :</b>
<datalist id ="plan">
<option value="PPO">
<option value="Children Medicaid">
<option value="Adult Medicaid">
<option value="CHIP">
</datalist>
<input id="policy1" list="plan" name="policy1" style="width:50%;" onchange="setCRA('policy17',this.value)" value="PPO">
</p>
</td>
<td>
<p class="p0 ft5">
D0120:
<input id="policy18" type="text" name="policy18" style="width: 45%">
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">
D2391:
<input id="policy19" type="text" name="policy19" style="width: 45%">
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">
Find FS:
<input id="policy20" type="text" name="policy20" style="width: 80%">
<!--______-->
</p>
</td>
<button onclick="fetchFS()" type="button" style="float:right; transform:translateY(15px);">Fetch FS</button>
</tr>
<tr>
<td>
<p class="p2 ft4"><b>CRA Req.:</b>
<input class="policy17" type="radio" name="policy17" value="Yes" style="float:none;width:10%;">Yes
<input class="policy17" type="radio" name="policy17" value="No" style="float:none;width:10%;" checked>No
</p>
</td>
<td>
<p class="p0 ft4">
Termed Date:
<input id="policy2" type="date" name="policy2" style="width: 56%">
<!--______-->
</p>
</td>
<td>
<p class="p0 ft4">
Network:
<select id="policy3" name="policy3" style="width: 55%">
<option value="IN">IN</option>
<option value="OUT">OUT</option>
<option value="NO">NO</option>
</select>
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">Fee Schedule:
<input id="policy4" list="fee" name="policy4" style="width:50%" required >
<!--______-->
</p>
</td>
<td>
<p class="p4 ft5">Effective Date:
<input id="policy5" type="date" name="policy5" style="width:60%" required >
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">Cal.Yr/Fiscal Yr/Plan Yr. :
<select id="policy6" name="policy6" style="width:25%">
<option value="CY">CY</option>
<option value="FY">FY</option>
<option value="PY">PY</option>
</select>
<!--______-->
</p>
</td>
</tr>
<tr>
<td>
<p class="p0 ft4">Annual Max:
<input id="policy7" type="number" step=0.01 name="policy7" style="width: 52%">
</p>
</td>
<td>
<p class="p0 ft4">Ann. Max Rem:
<input id="policy8" type="number" step=0.01 name="policy8" style="width: 28%" required >
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">Ind. Ded:
<input id="policy9" type="number" step=0.01 name="policy9" style="width: 55%" required >
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">Ind. Ded Rem:
<input id="policy10" type="number" step=0.01 name="policy10" style="width: 50%" required >
<!--______-->
</p>
</td>
<td>
<p class="p2 ft4">Dependents Covered to age:
<input id="policy11" type="text" name="policy11" style="width:25%">
<!--______-->
</p>
</td>
<td>
<p class="p0 ft4">Pre-D Mandatory:
<br>
<input class="policy12" type="radio" name="policy12" value="Yes" style="width: 10%"> Yes
<input class="policy12" type="radio" name="policy12" value="No" style="width: 10%"> No
<!--______-->
</p>
</td>
</tr>
<tr>
<td>
<p class="p2 ft4">Non-Duplicate clause?
<input class="policy13" type="radio" name="policy13" value="Yes" style="width: 25%"> Yes
<input class="policy13" type="radio" name="policy13" value="No" style="width: 25%"> No
<!--______-->
</p>
</td>
<td colspan="2">
<p class="p0 ft4">Full Time Student Status Required?
<input class="policy14" type="radio" name="policy14" value="Yes" style="width: 10%"> Yes
<input class="policy14" type="radio" name="policy14" value="No" style="width: 10%"> No
<!--______-->
</p>
</td>
<td colspan="2">
<p class="p0 ft5">Assignment of Benefits Accepted?
<input class="policy15" type="radio" name="policy15" value="Yes" style="width: 10%"> Yes
<input class="policy15" type="radio" name="policy15" value="No" style="width: 10%"> No
<!--______-->
</p>
</td>
<td>
<p class="p0 ft5">
Coverage Book: