-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
3021 lines (2688 loc) · 137 KB
/
index.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
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>
<html>
<head>
<title>Medline Transpose</title>
<!--Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-100696199-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<link rel="stylesheet" href="w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
<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">
<style>
body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif}
.w3-navbar,h1,button {font-family: sans-serif}
.fa-anchor,.fa-coffee {font-size:200px}
</style>
<body>
<!-- Navbar -->
<div class="w3-top">
<ul class="w3-navbar w3-blue-grey w3-card-2 w3-left-align w3-large">
<li class="w3-hide-medium w3-hide-large w3-blue-grey w3-opennav w3-right">
<a class="w3-padding-large w3-hover-white w3-large w3-blue-grey" href="javascript:void(0);" onClick="mySmallNav()" title="Toggle Navigation Menu"><i class="fa fa-bars"></i></a>
</li>
<li class="w3-hide-small"><a href="index.html" class="w3-padding-large w3-white">Home</a></li>
<li class="w3-hide-small"><a href="about.html" class="w3-padding-large w3-hover-white">About</a></li>
<li class="w3-hide-small"><a href="documentation.html" class="w3-padding-large w3-hover-white">Documentation</a></li>
</ul>
<!-- Navbar on small screens -->
<div id="small-nav" class="w3-hide w3-hide-large w3-hide-medium">
<ul class="w3-navbar w3-left-align w3-large w3-blue-grey">
<li><a class="w3-padding-large" href="index.html">Home</a></li>
<li><a class="w3-padding-large" href="about.html">About</a></li>
<li><a class="w3-padding-large" href="documentation.html">Documentation</a></li>
</ul>
</div>
</div>
<!-- Header -->
<header class="w3-container w3-blue-grey w3-center w3-padding-64">
<h1 class="w3-margin w3-jumbo">Medline Transpose</h1>
<p class="w3-xlarge">Translate a search query between Ovid MEDLINE and PubMed syntax</p>
</header>
<!-- Beta testing link -->
<div class="w3-container w3-yellow w3-topbar w3-bottombar w3-border-amber">
<span onclick="this.parentElement.style.display='none'" class="w3-closebtn">×</span>
<p><b>MEDLINE Transpose is still being tested, so there may be mistakes or errors. Please help us improve it <a href="https://goo.gl/forms/QmwV2TGarYrocVay2." target="_blank">by taking a short survey.</b></a></p>
</div>
</div>
<!-- Body -->
<div class="w3-row-padding w3-theme-l4 w3-container">
<div class="w3-content">
<!-- Search Input -->
<div class="w3-container">
<b><p class="w3-xlarge">Enter your search strategy</p></b>
<!-- accordion -->
<div class="w3-accordion">
<button onClick="myAccordion('Ovid-Acc')" class="w3-btn w3-round-large w3-theme">
Ovid Example
</button>
<div id="Ovid-Acc" class="w3-accordion-content w3-container">
<p><b>Try pasting the following into the box below, then select "Ovid to PubMed":</b></p>
<p>anxiety, separation/th or exp "attention deficit and disruptive behavior disorders"/<br>
separation anxiety.ti,ab<br>
(ADD or ADHD).ti,ab<br>
Cognitive Therapy/ <br>
exp Mind-Body Therapies/<br>
or/1-3<br>
or/4-5<br>
6 and 7</p>
</div>
<div class="w3-padding-4">
</div>
<button onClick="myAccordion('PubMed-Acc')" class="w3-btn w3-round-large w3-theme">
PubMed Example
</button>
<div id="PubMed-Acc" class="w3-accordion-content w3-container">
<p><b>Try pasting the following into the box below, then select "PubMed to Ovid":</b></p>
<p>"Brain Concussion"[Mesh] OR "Brain Injuries"[Mesh:NoExp] <br>
"Depression"[Mesh] OR "Depressive Disorder"[Mesh] OR depress*[tiab]<br>
#1 and #2<br>
#3 and jsubsetaim[text]</p>
</div>
<div class="w3-padding-8">
</div>
</div>
<textarea class="w3-input w3-large w3-border w3-round-large" id="userEntry" value="Exercise Therapy/" required name="userInput" rows="7"></textarea>
<div class="w3-layout-cell w3-layout-middle">
<input id="ovid" class="w3-radio" type="radio" name="database" value="OTP">
<label class="w3-validate">Ovid to PubMed</label>
<br>
<input id="pubmed" class="w3-radio" type="radio" name="database" value="PTO">
<label class="w3-validate">PubMed to Ovid</label>
<br><br>
</div>
<div class="w3-layout-cell w3-layout-middle">
<input id="accuracy" class="w3-radio" type="radio" name="preference" value="accuracy">
<label class="w3-validate">Accuracy</label>
<br>
<input id="efficiency" class="w3-radio" type="radio" name="preference" value="efficiency">
<label class="w3-validate">Efficiency</label>
<br><br>
</div>
<div class="w3-container w3-layout-cell w3-layout-middle">
<button class="w3-btn w3-padding-large w3-round-large w3-theme" id="submit" onClick="myFunction()">Submit</button></p>
</div>
<div class="w3-padding-8">
</div>
</div>
</div>
</div>
<!-- Search results -->
<div class="w3-container w3-theme-l2 w3-padding-8">
<!-- anchor link to results -->
<a name = "results"></a>
<div class="w3-content">
<!-- Search Results -->
<b><p class="w3-xlarge">Results</p></b>
<!-- results -->
<div class="w3-large">
<p id="output2"></p>
<p id="output3"></p>
<!-- warnings -->
<p id="output4"></p>
<!-- testing -->
<p id="output5">For best results, please use Firefox, Chrome, or Safari.</p>
<br><br>
</div>
</div>
</div>
<!-- Footer -->
<footer class="w3-row-padding w3-container w3-padding-32 w3-center">
<div class="w3-xlarge w3-padding-32">
<h1 class="w3-margin w3-xlarge w3-opacity">This project was made possible by</h1>
<div class="w3-layout-container">
<div class="w3-container w3-layout-cell">
<img src="CLAHRC-logo-1.jpg" alt="Plymouth University Peninsula Schools of Medicine & Dentistry" class="w3-image">
</div>
<div class="w3-container w3-layout-cell">
<img src="CLAHRC-logo-2.jpg" alt="NIHR CLAHRC South West Peninsula" class="w3-image">
</div>
<div class="w3-container w3-layout-cell">
<img src="CPSBC-logo_colour_RGB.png" alt="College of Physicians and Surgeons of British Columbia" class="w3-image">
</div>
</div>
</div>
<p>Powered by <a href="http://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p>
</footer>
<script>
//**************************************************************Functions start***********************************
function mySmallNav() {
var x = document.getElementById("small-nav");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
function myAccordion(id) {
var x = document.getElementById(id);
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
function myFunction() {
var rb1 = document.getElementById("ovid");
var rb2 = document.getElementById("pubmed");
var mfInputline = document.getElementById("userEntry").value;
var warnOTP = "Are you sure that you meant Ovid to PubMed? I see PubMed syntax in your entry.";
var warnPTO = "Are you sure that you meant PubMed to Ovid? I see Ovid syntax in your entry";
var warnNoChoice = "Please make a selection: Ovid to PubMed or PubMed to Ovid";
warnOTP = warnOTP.fontcolor("maroon");
warnPTO = warnPTO.fontcolor("maroon");
warnNoChoice = warnNoChoice.fontcolor("maroon");
var prefRB1 = document.getElementById("accuracy");
var prefRB2 = document.getElementById("efficiency");
var userPref = 0;
if (prefRB1.checked){
userPref = 0;
}
else if (prefRB2.checked){
userPref = 1;
}
if (rb1.checked && rb2.checked == false){
if (mfInputline.search(/\[/i) >= 0 && mfInputline.search(/\]/i) >= 0){
document.getElementById("output5").innerHTML = warnOTP;
}
else{
document.getElementById("output5").innerHTML = "";
}
transposeOTP(mfInputline, userPref);
}
else if (rb1.checked == false && rb2.checked){
if (mfInputline.search(/exp/i) >= 0 && mfInputline.search(/\//i) >= 0){
document.getElementById("output5").innerHTML = warnPTO;
}
else if (mfInputline.search(/[.]\w\w[.]/) >= 0 && mfInputline.search(/[.]\d\d[.]/) < 0){
document.getElementById("output5").innerHTML = warnPTO;
}
else{
document.getElementById("output5").innerHTML = "";
}
transposePTO(mfInputline, userPref);
}
else if (rb1.checked == false && rb2.checked == false){
document.getElementById("output5").innerHTML = warnNoChoice;
}
// anchor link to results section
window.location.hash = '';
window.location.hash = 'results';
}
function transposeOTP(inputline, uPref){
//read in the user input (Ovid search strategy)
//var inputline = document.getElementById("userEntry").value;
//document.getElementById("output0").innerHTML = inputline;
var outputline = "blank";
// warnings array
var warningArray = [];
var warningIndex = 0;
var wi = 0;
var wiPlus = 1;
var numCloseParens = 0;
var totalCloseParens = 0;
var numOpenParens = 0;
var totalOpenParens = 0;
var range = [];
var operator = "";
var start = null;
var end = null;
var rangeString = "";
var p = null;
// testing array
var testingArray = [null, null];
var testingIndex = 0;
//make an array to receive the output of other functions and split it into output and warnings
var outputReceiver = [null, null];
// convert adj to AND
if (inputline.search(/adj\d?/i) >= 0 ) {
inputline = inputline.replace(/adj\d?/ig,"AND");
warningArray.push("PubMed does not support the use of adjacency. Converted ADJ to AND."); // warning message
warningIndex++;
}
else {
// do nothing
}
//look for MeSH terms containing boolean operators
if (inputline.search(/"[\w\s]* and [\w\s]*"[ \/\.]+/ig) >= 0){
inputline = inputline.replace(/("[\w\s]*) and ([\w\s]*"[ \/\.]+)/ig, "$1 GRRRAND $2");
}
if (inputline.search(/"[\w\s]* or [\w\s]*"[ \/\.]+/i) >= 0){
inputline = inputline.replace(/("[\w\s]*) or ([\w\s]*"[ \/\.]+)/ig, "$1 ARRGHOR $2");
}
if (inputline.search(/"[\w\s]* not [\w\s]*"[ \/\.]+/i) >= 0){
inputline = inputline.replace(/("[\w\s]*) not ([\w\s]*"[ \/\.]+)/ig, "$1 SERENOTY $2");
}
// split user input based on line breaks
var lineBreakArray = inputline.split(/[\n\r]/);
var lineBreakCounter = lineBreakArray.length - 1;
var lineBreakLength = lineBreakArray.length;
for (s = lineBreakCounter; s >= 0; s--) {
// placeholer
//look for limits containing boolean operators
if (lineBreakArray[s].search(/limit [\d]+ to/i) >= 0){
lineBreakArray[s] = lineBreakArray[s].replace(/ and /ig, " GRRRAND ");
lineBreakArray[s] = lineBreakArray[s].replace(/ or /ig, " ARRGHOR ");
lineBreakArray[s] = lineBreakArray[s].replace(/ not /ig, " SERENOTY ");
}
// look for or/1-3 syntax construction
if (lineBreakArray[s].search(/(or|and|not)\/([\d]+)-([\d]+)/i) >= 0){
operator = lineBreakArray[s].replace(/(or|and|not)\/([\d]+)-([\d]+)/,"$1");
start = parseInt(lineBreakArray[s].replace(/(or|and|not)\/([\d]+)-([\d]+)/,"$2"));
end = parseInt(lineBreakArray[s].replace(/(or|and|not)\/([\d]+)-([\d]+)/,"$3"));
// expand range into individual numbers
for (var p = start; p <= end; p++) {
range.push(p);
}
// join range with boolean operator
var rangeString = range.join(".number " + operator + " "); // temporary field code
rangeString = rangeString + ".number"; // temporary field code
lineBreakArray[s] = rangeString;
}
range = []; // clear range array
//split user input by any OR operators and put the pieces into an array
var orArray = lineBreakArray[s].split(/ OR /i);
var orLengthCounter = orArray.length - 1; // for nested parenthasis
var orLength = orArray.length;
var mostRecentTag = "";
// or loop
for (i = orLengthCounter; i >= 0; i--){
//split the string by any AND operators and put the pieces into an array
var andArray = orArray[i].split(/ AND /i);
var andLengthCounter = andArray.length - 1; // for nested parenthasis
var andLength = andArray.length;
// and loop
for (j = andLengthCounter; j >= 0; j--){
//split the string by any NOT operators and put the pieces into an array
var notArray = andArray[j].split(/ NOT /i);
var notLengthCounter = notArray.length - 1; // for nested parenthasis
var notLength = notArray.length;
// not loop
for (k = notLengthCounter; k >= 0; k--){
// is it a limit?
if (notArray[k].search(/limit [\d]+ to/i) >= 0) {
outputReceiver = formatLimitOTP(notArray[k]);
notArray[k] = outputReceiver[0];
// testingArray[testingIndex] = notArray[k]
warningArray[warningIndex] = outputReceiver[1];
} // end limits
// is it a MeSH term?
else if (notArray[k].search(/\//) >= 0){
outputReceiver = formatMesh(notArray[k]);
notArray[k] = outputReceiver[0];
warningArray[warningIndex] = outputReceiver[1];
} // end mesh
// is it a keyword?
else {
// if a regular keyword
if (notArray[k].search(/\./) >= 0) { //
var mostRecentTagArray = notArray[k].match(/\.[ a-zA-Z,\/.]+$/);
mostRecentTag = mostRecentTagArray[0]; // mostRecentTag = keyword field code
}
// if no field codes
if (mostRecentTag == "") {
// if a number
if (notArray[k].search(/^[\(\s]*[\d]+[\s\)]*/) >= 0) { // search for numbers
notArray[k] = notArray[k] + ".number";
}
// otherwise give it an all fields tag
else {
warningArray.push("For any terms without field codes, the All Fields [all] code has been applied.");
warningIndex++;
notArray[k] = addQuotes(notArray[k]);
notArray[k] = notArray[k] + ".af";
}
}
// ensure parenthasis aren't screwed up
if (notArray[k].search(/[)]/) > 0) {
numCloseParens = notArray[k].match(/[)]/g).length;
}
if (numCloseParens != null){
totalCloseParens = totalCloseParens + numCloseParens;
}
if (notArray[k].search(/[(]/) > 0) {
numOpenParens = notArray[k].match(/[(]/g).length;
}
if (numOpenParens != null){
totalOpenParens = totalOpenParens + numOpenParens;
}
if (totalOpenParens >= totalCloseParens) {
notArray[k] = notArray[k] + mostRecentTag;
mostRecentTag = "";
totalOpenParens = 0;
totalCloseParens = 0;
}
else{
if (notArray[k].search(/\.[a-zA-Z, ]+/) >= 0) {
// do nothing
}
else {
notArray[k] = notArray[k] + mostRecentTag;
}
}
// all keyword processing
outputReceiver = formatKeyword(notArray[k], uPref);
notArray[k] = outputReceiver[0];
warningArray[warningIndex] = outputReceiver[1];
} // end keywords
warningIndex++;
testingIndex++;
} // notLengthCounter
andArray[j] = notArray.join(" NOT ");
} // andLengthCounter
orArray[i] = andArray.join(" AND ");
} // orLengthCounter
lineBreakArray[s] = orArray.join(" OR ");
// deal with blank lines
if (lineBreakArray[s].search(/^[" ]*\[all\]/i) >= 0) {
lineBreakArray[s] = "";
}
} // lineBreakCounter
outputline = lineBreakArray.join("<br />");
// split values in warningArray based on |, put into one total array
var m = null;
var n = null;
var warningArrayClean = [];
for (m = 0; m < warningArray.length; m++) {
if (warningArray[m].search("|") >= 0) { // if contains |
var arr = warningArray[m].split("|");
for (n = 0; n < arr.length; n++) {
// push all split values into warningArrayClean
warningArrayClean.push(arr[n]);
}
}
else { // add value to warningArrayClean
warningArrayClean.push(warningArray[m]);
}
}
// remove duplicates from warningArrayClean
var uniqWarningArray = [...new Set(warningArrayClean)];
// warning array into a string for output
var warningString = uniqWarningArray.join("<p>");
if (outputline.search(/GRRRAND/i) >= 0){
outputline = outputline.replace(/GRRRAND/ig, " AND ");
}
if (outputline.search(/ARRGHOR/i) >= 0){
outputline = outputline.replace(/ARRGHOR/ig, " OR ");
}
if (outputline.search(/SERENOTY/i) >= 0){
outputline = outputline.replace(/SERENOTY/ig, " NOT ");
}
document.getElementById("output3").innerHTML = outputline;
document.getElementById("output4").innerHTML = warningString;
// document.getElementById("output5").innerHTML = testingArray;
} // this corresponds to the function declaration
// ****************************************** MESH ******************************************
function formatMesh (fmString) {
// make a variable to hold any warnings
var fmWarningArray = [null, null];
// make an array to hold the outputs (string and warnings)
var fmOutputArray = [null, null];
var tempArray = [];
var subHeadingArray2 = [];
var c;
var i;
var j;
var k;
var l;
var z;
// subheadings
var subHeadingList = ["Abnormalities", "Administration and Dosage", "Adverse Effects", "Agonists", "Analogs and Derivatives", "Analysis", "Anatomy and Histology", "Antagonists and Inhibitors", "Biosynthesis", "Blood Supply", "Blood", "Cerebrospinal Fluid", "Chemical Synthesis", "Chemically Induced", "Chemistry", "Classification", "Complications", "Congenital", "Contraindications", "Cytology", "Deficiency", "Diagnosis", "Diagnostic Use", "Diet Therapy", "Diagnostic Imaging", "Drug Effects", "Drug Therapy", "Economics", "Education", "Embryology", "Enzymology", "Epidemiology", "Ethics", "Ethnology", "Etiology", "Genetics", "Growth and Development", "History", "Immunology", "Injuries", "Innervation", "Instrumentation", "Isolation and Purification", "Legislation and Jurisprudence", "Manpower", "Metabolism", "Methods", "Microbiology", "Mortality", "Nursing", "Organization and Administration", "Parasitology", "Pathogenicity", "Pathology", "Pharmacokinetics", "Pharmacology", "Physiology", "Physiopathology", "Poisoning", "Prevention and Control", "Psychology", "Radiation Effects", "Radiotherapy", "Rehabilitation", "Secondary", "Secretion", "Standards", "Statistics and Numerical Data", "Supply and Distribution", "Surgery", "Therapeutic Use", "Therapy", "Toxicity", "Transmission", "Transplantation", "Trends", "Ultrastructure", "Urine", "Utilization", "Veterinary", "Virology"];
var subHeadingCode = ["AB", "AD", "AE", "AG", "AA", "AN", "AH", "AI", "BI", "BS", "BL", "CF", "CS", "CI", "CH", "CL", "CO", "CN", "CT", "CY", "DF", "DI","DU", "DH", "DG", "DE", "DT", "EC", "ED", "EM", "EN", "EP", "ES", "EH", "ET", "GE", "GD", "HI", "IM", "IN", "IR", "IS", "IP", "LJ", "MA", "ME", "MT", "MI", "MO", "NU", "OG", "PS", "PY", "PA", "PK", "PD", "PH", "PP", "PO", "PC", "PX", "RE", "RT", "RH", "SC", "SE", "ST", "SN", "SD", "SU", "TU", "TH", "TO", "TM", "TR", "TD", "UL", "UR", "UT", "VE", "VI"];
var subHeadingExplode = ["AN", "AH", "CY", "EM", "CH", "DI", "ET", "CO", "MI", "OG", "PD", "AE", "PH", "ME", "SN", "EP", "TU", "TH", "SU"];
// publication types
var pubType = ["addresses", "autobiography", "bibliography", "biography", "case reports", "classical article", "clinical conference", "clinical study", "clinical trial", "clinical trial, phase i", "clinical trial, phase ii", "clinical trial, phase iii", "clinical trial, phase iv", "collected works", "comparative study", "congresses", "consensus development conference", "consensus development conference, nih", "controlled clinical trial", "dataset", "dictionary", "directory", "duplicate publication", "editorial", "english abstract", "evaluation studies", "festschrift", "government publications", "guideline", "historical article", "interactive tutorial", "interview", "introductory journal article", "journal article", "lectures", "legal cases", "legislation", "letter", "meta-analysis", "meta analysis", "multicenter study", "news", "newspaper article", "observational study", "overall", "patient education handout", "periodical index", "personal narratives", "portraits", "practice guideline", "pragmatic clinical trial", "publication components", "publication formats", "publication type category", "randomized controlled trial", "research support, american recovery and reinvestment act", "research support, n.i.h., extramural", "research support, n.i.h., intramural", "research support, non-u.s. gov't research support, u.s. gov't, non-p.h.s.", "research support, u.s. gov't, p.h.s.", "review", "scientific integrity review", "study characteristics", "support of research", "technical report", "twin study", "validation studies", "video-audio media", "webcasts"];
// floating or exploded subheadings --> these are now handled in keyword processing. to delete.
if (fmString.search(/\.fs/i) >= 0|fmString.search(/\.xs/i) >= 0) {
fmString = fmString.toUpperCase();
fmSubheadingArray = fmString.split(".");
for (c=0; c < subHeadingCode.length; c++) {
if (fmSubheadingArray[0] == subHeadingCode[c]) {
fmSubheadingArray[0] = fmSubheadingArray[0].replace(fmSubheadingArray[0],subHeadingList[c]);
}
}
if (fmSubheadingArray[1] == "FS") {
fmSubheadingArray[1] = "[sh:noexp]";
}
else if (fmSubheadingArray[1] == "XS") {
fmSubheadingArray[1] = "[sh]";
}
fmSubheadingArray[0] = addQuotes(fmSubheadingArray[0]);
fmString = fmSubheadingArray[0] + fmSubheadingArray[1];
fmString = fmString.toLowerCase();
} // end .fs and .xs processing
// regular Mesh processing
else {
// containers to hold parts of the input string
var fmBeg = new RegExp(/^[\n\r (]*/); // matches anything before mesh
fmBeg = fmBeg.exec(fmString);
var fmMesh = new RegExp(/[\w, "()-]+(?=\/)/); // match the mesh term, incl "" and exp and *
fmMesh = fmMesh.exec(fmString);
var fmSubHead = new RegExp(/[\/][.,a-zA-Z ]*/); // matches subheadings and slash
fmSubHead = fmSubHead.exec(fmString);
var fmEnd = new RegExp(/[ )\r\n]*$/); // matches end parenthesis
fmEnd = fmEnd.exec(fmString);
var fmMeshType = ""; // to hold type of mesh
// publication type processing
for (i = 0; i < pubType.length; i++) {
if (fmString.search(/as topic|Health Planning Guidelines/gi) >= 0) {
// do nothing
}
else if (fmMesh[0].toLowerCase().search(pubType[i]) >= 0) {
if (fmString.search(/exp /i) >= 0) {
fmMeshType = "[pt]";
}
else {
fmMeshType = "[pt:noexp]";
}
}
}
// mesh type processing
if (fmMeshType.search(/pt/i) >= 0){
// do nothing
}
else if (fmString.search(/\*/) >= 0 && fmString.search(/exp /i) >= 0){
fmMeshType = "[majr]";
}
else if (fmString.search(/\*/) >= 0){
fmMeshType = "[majr:noexp]";
}
else if (fmString.search(/exp /i) >= 0){
fmMeshType = "[mesh]";
}
else {
fmMeshType = "[mesh:noexp]";
}
// format subheadings
if (fmSubHead[0].search(/[a-zA-Z]/) >= 0) { // if contains subheadings
fmSubHead[0] = fmSubHead[0].replace(/[\s]*/g,""); // remove any white space
fmSubHead[0] = fmSubHead[0].toUpperCase(); // uppercase to match subheading code array above
fmSubHead[0] = fmSubHead[0].replace(/[\/]/,""); // remove slash
var subHeadingArray = fmSubHead[0].split(","); // array of subheading codes from user input
// go through each subheading in array
for (k=0; k < subHeadingArray.length; k++) {
subHeadingArray[k] = subHeadingArray[k].replace(/\s/g,''); // remove any spaces
// search for diagnostic use -- no longer used
if (subHeadingArray[k].search("DU") >= 0) { // mesh contains subheading Diagnostic Use
fmWarningArray.push("The subheading <b>Diagnostic Use</b> is no longer used. Remove it from your search or replace it with another subheading.");
}
// radiography subheading
if (subHeadingArray[k].search("RA") >= 0) {
subHeadingArray[k] = "DG";
fmWarningArray.push("The subheading <b>Radiography</b> has been absorbed by Diagnostic Imaging. Term has been changed in search strategy. For more information, please see <a href='https://www.nlm.nih.gov/mesh/2017/download/2017QualifierChanges.pdf' target='_blank'>this page</a>.");
}
// radionuclide subheading
if (subHeadingArray[k].search("RI") >= 0) {
subHeadingArray[k] = "DG";
fmWarningArray.push("The subheading <b>radionuclide</b> has been absorbed by Diagnostic Imaging. Term has been changed in search strategy. For more information, please see <a href='https://www.nlm.nih.gov/mesh/2017/download/2017QualifierChanges.pdf' target='_blank'>this page</a>.");
}
// ultrasonography subheading
if (subHeadingArray[k].search("US") >= 0) {
subHeadingArray[k] = "DG";
fmWarningArray.push("The subheading <b>ultrasonographye</b> has been absorbed by Diagnostic Imaging. Term has been changed in search strategy. For more information, please see <a href='https://www.nlm.nih.gov/mesh/2017/download/2017QualifierChanges.pdf' target='_blank'>this page</a>.");
}
// contraindications subheading
if (subHeadingArray[k].search("CT") >= 0) {
fmWarningArray.push("The subheading <b>Contraindications</b> is no longer used. Instead please use the MeSH \"contraindications\". For more information, please see <a href='https://www.nlm.nih.gov/pubs/techbull/nd17/nd17_medline_data_changes_2018.html#subhead_changes' target='_blank'>this page</a>.");
}
// manpower subheading
if (subHeadingArray[k].search("MA") >= 0) {
fmWarningArray.push("The subheading <b>Manpower</b> is no longer used. Instead please use the MeSH \"Workforce\" or \"Health Workforce\". For more information, please see <a href='https://www.nlm.nih.gov/pubs/techbull/nd18/nd18_medline_data_changes_2019.html#subhead_changes' target='_blank'>this page</a>.");
}
// utilization subheading
if (subHeadingArray[k].search("UT") >= 0) {
fmWarningArray.push("The subheading <b>Utilization</b> is no longer used. Instead please use the MeSH \"Drug Utilization\" or \"Equipment and Supplies Utilization\" or \"Procedures and Techniques Utilization\" or \"Facilities and Services Utilization\". For more information, please see <a href='https://www.nlm.nih.gov/pubs/techbull/nd18/nd18_medline_data_changes_2019.html#subhead_changes' target='_blank'>this page</a>.");
}
// if a match with exploded subheadings list
for (l = 0; l < subHeadingExplode.length; l++) {
if (subHeadingArray[k] == subHeadingExplode[l]) {
if (fmMeshType.search("noexp") >= 0) { // mesh contains noexp
// do nothing
}
else {
switch (subHeadingArray[k]) {
case "AN":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>BL, CF, IP, and UR.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "CY":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheading <b>UL.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "EM":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheading <b>AB.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "AH":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>AG, AA, AI, and CS.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "DI":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheading <b>DG.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "CO":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheading <b>SC.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "MI":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheading <b>VI.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "ET":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>CI, CO, SC, CN, EM, GE, IM, MI, VI, PS, and TM.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "OG":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>EC, LJ, MA, ST, SD, TD, and UT.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "AE":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>PO and TO.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "PD":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>AD, AE, PO, TO, AG, AI, CT, and PK.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "ME":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>BI, BL, CF, DF, EN, PK, and UR.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "PH":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>GE GD, IM, ME, BI, BL, CF, DF, EN, PK, UR, PP, and SE.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "EP":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>EH and MO.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "SN":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>EP, EH, MO, SD, and UT.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "TU":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>AD, AE, CT, and PO.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "SU":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheading <b>TR.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
case "TH":
fmWarningArray.push("The subheading <b>" + subHeadingArray[k] + "</b> is automatically exploded in PubMed. In PubMed, this search will return more results because it will also search for the MeSH term <b>" + fmMesh.toString().replace('exp ','').replace("GRRRAND","and").replace("ARRGHOR","or").replace("SERENOTY","not") + "</b> with the subheadings <b>DH, DT, NU, PC, RT, RH, SU, and TR.</b> For more information see <a href='https://www.nlm.nih.gov/mesh/subhierarchy.html' target='_blank'>this page</a>.");
break;
}
}
}
} // end subHeadingExplode for loop
subHeadingArray2 = subHeadingArray.concat(tempArray);
} // end subHeadingList for loop
// go through each subheading in array (second time)
for (k=0; k < subHeadingArray2.length; k++) {
// convert user input subheading abbreviations into full phrases
for (j = 0; j < subHeadingList.length; j++) {
if (subHeadingArray2[k] == subHeadingCode[j]) {
subHeadingArray2[k] = subHeadingArray2[k].replace(subHeadingArray2[k],subHeadingList[j]);
}
else {
// do nothing
}
} // end subHeadingList for loop
// format each subheading back into full mesh string
subHeadingArray2[k] = fmMesh[0] + "/" + subHeadingArray2[k] + fmMeshType;
subHeadingArray2[k] = addQuotes(subHeadingArray2[k]); // add quotes
} // end subHeadingArray for loop
// separate each string by OR
fmString = subHeadingArray2.join(" OR ");
fmString = fmBeg[0] + fmString + fmEnd[0]; // add any beginning parenthasis to string
// add additional parenthesis if there are multiple subheadings
if (fmString.search("OR") > 0) {
fmString = "(" + fmString + ")";
}
} // end subheading processing
else { // if no subheading
fmString = fmBeg[0] + fmMesh[0] + fmMeshType + fmEnd[0]; // put all components back together
fmString = addQuotes(fmString); // add quotes
} // end no subheading processing
} // end regular mesh processing
fmString = fmString.replace(/\*/g,""); // remove focus
fmString = fmString.replace(/exp /ig,""); // remove explode
// warning array into single string
var fmWarning = fmWarningArray.join("|");
fmOutputArray[0] = fmString;
fmOutputArray[1] = fmWarning;
return fmOutputArray;
} // function end
// ****************************************** KEYWORDS ******************************************
function formatKeyword(kwString, uPref) {
kwTemp = kwString;
//make an array to hold any warnings
var kwWarningArray = [];
//make an array to hold the outputs (string and warnings)
var kwOutputArray = [];
// to hold array of field codes
var kwFieldArray = [];
// for floating/exploded subheadings
var subHeadingList = ["Abnormalities", "Administration and Dosage", "Adverse Effects", "Agonists", "Analogs and Derivatives", "Analysis", "Anatomy and Histology", "Antagonists and Inhibitors", "Biosynthesis", "Blood Supply", "Blood", "Cerebrospinal Fluid", "Chemical Synthesis", "Chemically Induced", "Chemistry", "Classification", "Complications", "Congenital", "Contraindications", "Cytology", "Deficiency", "Diagnosis", "Diagnostic Use", "Diet Therapy", "Diagnostic Imaging", "Drug Effects", "Drug Therapy", "Economics", "Education", "Embryology", "Enzymology", "Epidemiology", "Ethics", "Ethnology", "Etiology", "Genetics", "Growth and Development", "History", "Immunology", "Injuries", "Innervation", "Instrumentation", "Isolation and Purification", "Legislation and Jurisprudence", "Manpower", "Metabolism", "Methods", "Microbiology", "Mortality", "Nursing", "Organization and Administration", "Parasitology", "Pathogenicity", "Pathology", "Pharmacokinetics", "Pharmacology", "Physiology", "Physiopathology", "Poisoning", "Prevention and Control", "Psychology", "Radiation Effects", "Radiotherapy", "Rehabilitation", "Secondary", "Secretion", "Standards", "Statistics and Numerical Data", "Supply and Distribution", "Surgery", "Therapeutic Use", "Therapy", "Toxicity", "Transmission", "Transplantation", "Trends", "Ultrastructure", "Urine", "Utilization", "Veterinary", "Virology"];
var subHeadingCode = ["AB", "AD", "AE", "AG", "AA", "AN", "AH", "AI", "BI", "BS", "BL", "CF", "CS", "CI", "CH", "CL", "CO", "CN", "CT", "CY", "DF", "DI","DU", "DH", "DG", "DE", "DT", "EC", "ED", "EM", "EN", "EP", "ES", "EH", "ET", "GE", "GD", "HI", "IM", "IN", "IR", "IS", "IP", "LJ", "MA", "ME", "MT", "MI", "MO", "NU", "OG", "PS", "PY", "PA", "PK", "PD", "PH", "PP", "PO", "PC", "PX", "RE", "RT", "RH", "SC", "SE", "ST", "SN", "SD", "SU", "TU", "TH", "TO", "TM", "TR", "TD", "UL", "UR", "UT", "VE", "VI"];
// variable to hold any beginning parenthesis
var kwBeg = new RegExp(/^[\n\r (]*/);
kwBeg = kwBeg.exec(kwString);
// variable to hold any end parenthesis
var kwEnd = new RegExp(/[ )\r\n]*$/);
kwEnd = kwEnd.exec(kwString);
// variable to hold any nested parenthesis
var kwNestedEnd = new RegExp(/[) ]*(?=\.)/);
kwNestedEnd = kwNestedEnd.exec(kwString);
var kwNested = false;
if (kwString.search(/\)\s*\./) >= 0) { // if nested parenthesis
kwNested = true;
}
else {
kwNested = false;
}
kwString = kwString.replace(/[()]*/g,""); // remove any parenthesis (stored in kwEnd,kwBeg)
var kwArray = kwString.split("."); // split into kw and field codes
kwArray[1] = kwArray[1].replace(/\s/g,""); // remove any spaces from field codes
if (kwArray[1].search(/ti,ab,kw/i) >= 0) { // ti,ab,kw --> tiabkw
kwArray[1] = kwArray[1].replace(/ti,ab,kw/,"tiabkw");
}
if (kwArray[1].search(/ti,ab/i) >= 0) { // ti,ab --> tiab
kwArray[1] = kwArray[1].replace(/ti,ab/,"tiab");
}
if (kwArray[1].search(/[a-zA-Z]/) >= 0) { // if there are any field codes
kwFieldArray = kwArray[1].split(","); // field codes into array
}
var b;
// loop through field codes applied to kw
for (b = 0; b < kwFieldArray.length; b++) {
// convert field codes
if (kwFieldArray[b].search(/tiabkw/i) >= 0){ // title and abstract
kwFieldArray[b] = kwFieldArray[b].replace(/tiabkw/i,"[tiab]");
kwWarningArray.push("In PubMed, [tiab] searches for title, collection title, abstract, other abstract, and author-supplied keywords. Therefore, the 'kw' field tag has been removed as it is redundant.");
}
else if (kwFieldArray[b].search(/tiab/i) >= 0){ // title and abstract
kwFieldArray[b] = kwFieldArray[b].replace(/tiab/i,"[tiab]");
kwWarningArray.push("In Ovid, the .ti,ab command searches both title and abstract. However, in PubMed, [tiab] searches for title, collection title, abstract, other abstract, and author-supplied keywords. Therefore, this pubmed search may return more results than the original ovid one.");
}
else if (kwFieldArray[b].search(/tw/i) >= 0){ // text word
kwFieldArray[b] = kwFieldArray[b].replace(/tw/i,"[tiab]");
kwWarningArray.push("In Ovid, the .tw or .ti,ab command searches both title and abstract. However, in PubMed, [tiab] searches for title, collection title, abstract, other abstract, and author-supplied keywords. Therefore, this pubmed search may return more results than the original ovid one. Please note also that while both Ovid MEDLINE and PubMed have a textword (tw) search, they search different fields in each database.");
}
else if (kwFieldArray[b].search(/mp/i) >= 0){ // multipurpose
if (uPref == 0){
kwFieldArray[b] = kwFieldArray[b].replace(/mp/i,"[tiab]");
kwWarningArray.push("The multipurpose (mp) field tag searches the following fields in ovid: abstract (ab), keyword heading word (kf), name of substance word (nm), original title (ot), protocol supplementary concept word (px), rare disease supplementary concept word (rx), subject heading word (hw), synonyms (sy), title (ti), unique identifier (ui). Many of these field codes cannot be searched in PubMed. Search has been translated as [tiab] OR [nm] OR [mh] OR [tt] OR [pmid]. For an inexact, but simpler translation to [tw], choose the Efficiency option.");
kwFieldArray.push("nm","mh","ot","ui");
}
else{
kwFieldArray[b] = kwFieldArray[b].replace(/mp/i,"[tw]");
kwWarningArray.push("The multipurpose (mp) field tag searches the following fields in ovid: abstract (ab), keyword heading word (kf), name of substance word (nm), original title (ot), protocol supplementary concept word (px), rare disease supplementary concept word (rx), subject heading word (hw), synonyms (sy), title (ti), unique identifier (ui). For simplicity, this search has been translated as [tw]. For a more exact translation, choose the Accuracy option.");
}
}
// field codes are listed alphabetically after this point
else if (kwFieldArray[b].search(/ab/i) >= 0){ // abstract
kwFieldArray[b] = kwFieldArray[b].replace(/ab/i,"[tiab]");
kwWarningArray.push("PubMed does not support abstract-only searches. <b>.ab</b> has been replaced with <b>[tiab]</b>, which may retrieve more results.");
}
// .ai —> [auid]
else if (kwFieldArray[b].search(/ai/i) >= 0){ // Author Name ID
kwFieldArray[b] = kwFieldArray[b].replace(/ai/i,"[auid]");
}
else if (kwFieldArray[b].search(/af/i) >= 0){ // all fields
kwFieldArray[b] = kwFieldArray[b].replace(/af/i,"[all]");
}
else if (kwFieldArray[b].search(/ax/i) >= 0){ // Author Last Name
kwFieldArray[b] = kwFieldArray[b].replace(/ax/i,"[au]");
}
else if (kwFieldArray[b].search(/ci/i) >= 0){ // Conflict of Interest
kwFieldArray[b] = kwFieldArray[b].replace(/ci/i,"[coi]");
}
else if (kwFieldArray[b].search(/cp/i) >= 0){ // country of publication
kwFieldArray[b] = kwFieldArray[b].replace(/cp/i,"[pl]");
}
else if (kwFieldArray[b].search(/dz/i) >= 0 && kwArray[0].search(/docz/i) >= 0){ // docz.dz
kwFieldArray[b] = kwFieldArray[b].replace(/dz/i,"[sb]");
kwArray[0] = "all";
}
else if (kwFieldArray[b].search(/pt/i) >= 0){ // publication type
if (uPref == 0){
kwFieldArray[b] = kwFieldArray[b].replace(/pt/i,"[pt:noexp]");
kwWarningArray.push("The publication type (pt) field tag does not automatically explode in Ovid, and so this translation duplicates that in PubMed. For an inexact, but simpler translation to [pt], choose the Efficiency option.");
}
else {
kwFieldArray[b] = kwFieldArray[b].replace(/pt/i,"[pt]");
kwWarningArray.push("The publication type (pt) field tag does not automatically explode in Ovid, and automatically explodes in PubMed. To search this term without exploding in PubMed, choose the Accuracy option.");
}
}
else if (kwFieldArray[b].search(/da/i) >= 0){ // Date, Mesh
kwFieldArray[b] = kwFieldArray[b].replace(/da/i,"[mhda]");
}
else if (kwFieldArray[b].search(/do/i) >= 0){ // DOI/Location ID/Publisher Item Identifier
kwFieldArray[b] = kwFieldArray[b].replace(/do/i,"[lid]");
}
else if (kwFieldArray[b].search(/di/i) >= 0){ // DOI/Location ID/Publisher Item Identifier
kwFieldArray[b] = kwFieldArray[b].replace(/di/i,"[lid]");
}
else if (kwFieldArray[b].search(/dt/i) >= 0){ // Date, Create
kwFieldArray[b] = kwFieldArray[b].replace(/dt/i,"[crdt]");
}
else if (kwFieldArray[b].search(/ed/i) >= 0){ // Date, Completion/Entry
kwFieldArray[b] = kwFieldArray[b].replace(/ed/i,"[dcom]");
}
else if (kwFieldArray[b].search(/ee/i) >= 0){ // Editor
kwFieldArray[b] = kwFieldArray[b].replace(/ee/i,"[ed]");
}
else if (kwFieldArray[b].search(/ep/i) >= 0){ // Date of Publication, Electronic
kwFieldArray[b] = kwFieldArray[b].replace(/ep/i,"[dep]");
}
else if (kwFieldArray[b].search(/es/i) >= 0){ // ISSN Electronic
kwFieldArray[b] = kwFieldArray[b].replace(/es/i,"[ta]");
}
else if (kwFieldArray[b].search(/ez/i) >= 0){ // Date, Entrez
kwFieldArray[b] = kwFieldArray[b].replace(/ez/i,"[edat]");
}
else if (kwFieldArray[b].search(/fa/i) >= 0){ // full author name
kwFieldArray[b] = kwFieldArray[b].replace(/fa/i,"[fau]");
}
else if (kwFieldArray[b].search(/fs/i) >=0){ // floating subheading
kwFieldArray[b] = kwFieldArray[b].replace(/fs/i,"[sh:noexp]");
}
else if (kwFieldArray[b].search(/xs/i) >=0){ // exploded subheading
kwFieldArray[b] = kwFieldArray[b].replace(/xs/i,"[sh]");
}
else if (kwFieldArray[b].search(/gr|gc|gi|no|go/i) >= 0){ // Grant Information
kwFieldArray[b] = kwFieldArray[b].replace(/gr|gc|gi|no|go/i,"[gr]");
}
else if (kwFieldArray[b].search(/hw/i) >= 0){ // heading word (no translation)
kwFieldArray[b] = kwFieldArray[b].replace(/hw/i,"[mh]");
kwWarningArray.push("PubMed does not support heading word (.hw) searches. The closest equivalent is mesh heading [mh], which may retrieve fewer results.");
}
else if (kwFieldArray[b].search(/ib/i) >= 0){ // ISBN
kwFieldArray[b] = kwFieldArray[b].replace(/ib/i,"[is]");
}
else if (kwFieldArray[b].search(/id/i) >= 0){ // Article Identifier
kwFieldArray[b] = kwFieldArray[b].replace(/id/i,"[aid]");
}
else if (kwFieldArray[b].search(/il/i) >= 0){ // ISSN Linking
kwFieldArray[b] = kwFieldArray[b].replace(/il/i,"[ta]");
}
else if (kwFieldArray[b].search(/in/i) >= 0){ // institution
kwFieldArray[b] = kwFieldArray[b].replace(/in/i,"[ad]");
}
else if (kwFieldArray[b].search(/io/i) >= 0){ // Journal ISO/Title Abbreviation
kwFieldArray[b] = kwFieldArray[b].replace(/io/i,"[ta]");
}
else if (kwFieldArray[b].search(/is/i) >= 0){ // ISSN Print
kwFieldArray[b] = kwFieldArray[b].replace(/is/i,"[ta]");
}
else if (kwFieldArray[b].search(/ja/i) >= 0){ // journal title abbreviated
kwFieldArray[b] = kwFieldArray[b].replace(/ja/i,"[ta]");
}
else if (kwFieldArray[b].search(/jc/i) >= 0){ // NLM Journal Code
kwFieldArray[b] = kwFieldArray[b].replace(/jc/i,"[jid]");
}
else if (kwFieldArray[b].search(/jn/i) >= 0){ // journal title
kwFieldArray[b] = kwFieldArray[b].replace(/jn/i,"[journal]");
}
// lancet.jw —> warning message that there is no equivalent. Change to [journal].
else if (kwFieldArray[b].search(/jw/i) >= 0){ // journal word
kwFieldArray[b] = kwFieldArray[b].replace(/jw/i,"[journal]");
kwWarningArray.push("PubMed does not support journal word (.jw) searches. The closest equivalent is [journal], which may retrieve fewer results.");
}
else if (kwFieldArray[b].search(/kf/i) >= 0){ // keyword heading word (no translation)
kwFieldArray[b] = kwFieldArray[b].replace(/kf/i,"[ot]");
kwWarningArray.push("PubMed does not support keyword heading word (.kf) searches. The closest equivalent is other term [ot], which may retrieve fewer results.");
}
else if (kwFieldArray[b].search(/kw/i) >= 0){ // keyword (other term)
kwFieldArray[b] = kwFieldArray[b].replace(/kw/i,"[ot]");
}
else if (kwFieldArray[b].search(/lg/i) >= 0){ // language
kwFieldArray[b] = kwFieldArray[b].replace(/lg/i,"[la]");
}
else if (kwFieldArray[b].search(/nj/i) >= 0){ // NLM Journal Name
kwFieldArray[b] = kwFieldArray[b].replace(/nj/i,"[journal]");
}
else if (kwFieldArray[b].search(/nm/i) >= 0){ // name of substance word
kwFieldArray[b] = kwFieldArray[b].replace(/nm/i,"[nm]");
}
else if (kwFieldArray[b].search(/nw/i) >= 0){ // NLM Journal Word<
kwFieldArray[b] = kwFieldArray[b].replace(/nw/i,"[journal]");
kwWarningArray.push("PubMed does not support NLM journal word (.nw) searches. The closest equivalent is [journal], which may retrieve fewer results.");
}
// .oa —> warning that there is no equivalent. "This is one of the many fields searched by the [tiab] and [tw] searches in PubMed, but it cannot be searched separately.” Change to [tiab].
else if (kwFieldArray[b].search(/oa/i) >= 0){ // original title (transliterated title)
kwFieldArray[b] = kwFieldArray[b].replace(/oa/i,"[tiab]");
kwWarningArray.push("PubMed does not support Other Abstract (.oa) field tag searching. This is one of the many fields searched by the [tiab] and [tw] searches in PubMed, but it cannot be searched separately. Field has been changed to [tiab]");
}
else if (kwFieldArray[b].search(/ot/i) >= 0){ // original title (transliterated title)
kwFieldArray[b] = kwFieldArray[b].replace(/ot/i,"[tt]");
}
else if (kwFieldArray[b].search(/pa/i) >= 0){ // first author name
kwFieldArray[b] = kwFieldArray[b].replace(/pa/i,"[1au]");
}
else if (kwFieldArray[b].search(/pb/i) >= 0){ // Publisher
kwFieldArray[b] = kwFieldArray[b].replace(/pb/i,"[pubn]");
}
else if (kwFieldArray[b].search(/pn/i) >= 0){ // peronal name as subject
kwFieldArray[b] = kwFieldArray[b].replace(/pn/i,"[ps]");
}
else if (kwFieldArray[b].search(/ps/i) >= 0){ // Protocol Supplementary Concept
kwFieldArray[b] = kwFieldArray[b].replace(/ps/i,"[supplementary concept]");
}
else if (kwFieldArray[b].search(/px/i) >= 0){ // Protocol Supplementary Concept Word
kwFieldArray[b] = kwFieldArray[b].replace(/px/i,"[supplementary concept]");
kwWarningArray.push("PubMed only supports .px searches that are one word long (no phrases).");
}