@iebh/polyglot 4.7.0 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -232,6 +232,7 @@ var _default = {
232
232
  switch (engine) {
233
233
  case 'PubMed full':
234
234
  case 'PubMed abbreviation':
235
+ case 'Lilacs':
235
236
  //HTA
236
237
  case 'International HTA Database':
237
238
  buffer += 'AND';
@@ -269,6 +270,7 @@ var _default = {
269
270
  switch (engine) {
270
271
  case 'PubMed full':
271
272
  case 'PubMed abbreviation':
273
+ case 'Lilacs':
272
274
  //HTA
273
275
  case 'International HTA Database':
274
276
  buffer += 'AND';
@@ -58,7 +58,8 @@ var _default = {
58
58
  "PubMed abbreviation": 'randomized controlled trial[pt] OR controlled clinical trial[pt] OR randomized[tiab] OR randomised[tiab] OR placebo[tiab] OR "drug therapy"[sh] OR randomly[tiab] OR trial[tiab] OR groups[tiab] NOT (Animals[Mesh] not (Animals[Mesh] and Humans[Mesh]))',
59
59
  "Web of Science": 'TS=(random* or placebo* or allocat* or crossover* or "cross over" or ((singl* or doubl*) NEAR/1 blind*)) OR TI=(trial)',
60
60
  "WoS Advanced": 'TS=(random* or placebo* or allocat* or crossover* or "cross over" or ((singl* or doubl*) NEAR/1 blind*)) OR TI=(trial)',
61
- "Business Source Ultimate": '(MH "Clinical Trials+") OR (MH "Quantitative Studies") OR TI placebo* OR AB placebo* OR (MH "Placebos") OR (MH "Random Assignment") OR TI random* OR AB random* OR TI ((singl* or doubl* or tripl* or trebl*) W1 (blind* or mask*)) OR AB ((singl* or doubl* or tripl* or trebl*) W1 (blind* or mask*)) OR TI clinic* trial* OR AB clinic* trial* OR PT clinical trial'
61
+ "Business Source Ultimate": '(MH "Clinical Trials+") OR (MH "Quantitative Studies") OR TI placebo* OR AB placebo* OR (MH "Placebos") OR (MH "Random Assignment") OR TI random* OR AB random* OR TI ((singl* or doubl* or tripl* or trebl*) W1 (blind* or mask*)) OR AB ((singl* or doubl* or tripl* or trebl*) W1 (blind* or mask*)) OR TI clinic* trial* OR AB clinic* trial* OR PT clinical trial',
62
+ "Lilacs": '(mh:("Randomized Controlled Trials as Topic" OR "Controlled Clinical Trials as Topic" OR "Random Allocation" OR "Double-Blind Method" OR "Single-Blind Method" OR "Placebos" OR "Multicenter Studies as Topic" OR "Cross-Over Studies" OR "Pragmatic Clinical Trials as Topic") OR pt:("Randomized Controlled Trial" OR "Controlled Clinical Trial" OR "Multicenter Studies" OR "Pragmatic Clinical Trial") OR ti:(random* OR aleatori* OR placebo*) OR (ti:("clinical trial" OR "ensayo clinico" OR "ensaio clinico") AND tw:(control* OR random* OR aleatori* OR placebo*)) OR (ti:("cross-Over" OR multicenter OR multicentric*) AND ti:(study OR studies OR estud*)) OR ab:(randomi* OR aleatori* OR placebo*) OR (ab:("clinical trial" OR "ensayo clinico" OR "ensaio clinico") AND tw:(control* OR random* OR aleatori* OR placebo*)) OR (ab:("cross-Over" OR multicenter OR multicentric*) AND ab:(study OR studies OR estud*)) OR (tw:(simple* OR singl* OR duplo* OR doble* OR doubl* OR trebl* OR tripl*) AND tw:(cego OR ciego OR blind OR mask OR dumm*))) AND NOT ((mh:"animals" AND NOT mh:"humans") OR mh:"Retrospective Studies")'
62
63
  }
63
64
  },
64
65
  'sr filter': {
@@ -73,7 +74,8 @@ var _default = {
73
74
  "PubMed abbreviation": 'search*[Title/Abstract] OR meta analysis[Publication Type] OR meta analysis[Title/Abstract] OR meta analysis[MeSH] OR review[Publication Type] OR diagnosis[MeSH Subheading] OR associated[Title/Abstract]',
74
75
  "Web of Science": 'Medline OR Pubmed OR (systematic AND review) OR meta-analysis OR Cochrane',
75
76
  "WoS Advanced": 'Medline OR Pubmed OR (systematic AND review) OR meta-analysis OR Cochrane',
76
- "Business Source Ultimate": 'TI Medline AB Medline OR TI Pubmed AB Pubmed OR (TI systematic AB systematic AND TI review AB review) OR TI meta-analysis OR AB meta-analysis'
77
+ "Business Source Ultimate": 'TI Medline AB Medline OR TI Pubmed AB Pubmed OR (TI systematic AB systematic AND TI review AB review) OR TI meta-analysis OR AB meta-analysis',
78
+ "Lilacs": '(mh:("Systematic Reviews as Topic" OR "Meta-Analysis as Topic") OR pt:("systematic review" OR "meta-analysis") OR ti:("systematic review" OR "revisao sistematica" OR "revision sistematica" OR "systematic literature review" OR "systematic literature review" OR "systematic narrative review" OR "systematic qualitative review" OR "systematic evidence review" OR "systematic quantitative review" OR "systematic meta-review" OR "systematic critical review" OR "systematic mixed studies review" OR "systematic mixed methods" OR "systematic mapping review" OR "systematic cochrane review" OR "scoping review" OR "integrative review" OR "integrative literature review" OR "umbrella review" OR "rapid review" OR "meta-analysis" OR "meta-analise" OR metaanalise OR metanalise OR metaanalisis OR "meta-synthesis" OR "Metassintese") OR ab:("this systematic review" OR "esta revisao sistematica" OR "esta revision sistematica" OR "this meta-analysis" OR "esta meta-analise" OR "esta metaanalise" OR "esta metanalise" OR "esta metaanalisis" OR "this meta-synthesis" OR "esta metassintese") OR ta:"Cochrane Database Syst Rev")'
77
79
  }
78
80
  }
79
81
  }
@@ -347,7 +347,8 @@ var parse = function parse(query, options) {
347
347
  // Mesh term - PubMed syntax
348
348
  leaf.type = 'mesh';
349
349
  leaf.field = match[2] ? 'Mesh search (Not exploded)' : 'Mesh search (exploded)';
350
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
350
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
351
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
351
352
  offset += match[0].length;
352
353
  q = q.substr(match[0].length);
353
354
  cropString = false;
@@ -360,7 +361,8 @@ var parse = function parse(query, options) {
360
361
  newLeaf.heading = match[2];
361
362
  }
362
363
  newLeaf.field = match[4] ? 'MeSH Major Topic search (Not exploded)' : 'MeSH Major Topic search (exploded)';
363
- if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
364
+ // if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
365
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
364
366
  branch.nodes.push(newLeaf);
365
367
  offset += match[0].length;
366
368
  q = q.substr(match[0].length);
@@ -374,7 +376,8 @@ var parse = function parse(query, options) {
374
376
  newLeaf.heading = match[2];
375
377
  }
376
378
  newLeaf.field = match[4] ? 'MeSH Major Topic search (Not exploded)' : 'MeSH Major Topic search (exploded)';
377
- if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
379
+ // if (/^["“”].*["“”]$/.test(newLeaf.content)) newLeaf.content = newLeaf.content.substr(1, newLeaf.content.length - 2); // Remove wrapping '"' characters
380
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
378
381
  branch.nodes.push(newLeaf);
379
382
  offset += match[0].length;
380
383
  q = q.substr(match[0].length);
@@ -383,7 +386,8 @@ var parse = function parse(query, options) {
383
386
  // Mesh subheading search - PubMed syntax
384
387
  leaf.type = 'mesh';
385
388
  leaf.field = 'MeSH subheading search';
386
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
389
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
390
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
387
391
  offset += match[0].length;
388
392
  q = q.substr(match[0].length);
389
393
  cropString = false;
@@ -397,7 +401,8 @@ var parse = function parse(query, options) {
397
401
  }
398
402
  leaf.type = 'mesh';
399
403
  useLeaf.field = 'MeSH subheading search';
400
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
404
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
405
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
401
406
  offset += match[0].length;
402
407
  q = q.substr(match[0].length);
403
408
  cropString = false;
@@ -411,7 +416,8 @@ var parse = function parse(query, options) {
411
416
  }
412
417
  leaf.type = 'mesh';
413
418
  useLeaf.field = match[1] === "xm" ? 'Mesh search (exploded)' : 'Mesh search (Not exploded)';
414
- if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
419
+ // if (/^["“”].*["“”]$/.test(leaf.content)) leaf.content = leaf.content.substr(1, leaf.content.length - 2); // Remove wrapping '"' characters
420
+ if (/^["“”'‘’].*["“”'‘’]$/.test(leaf.content) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content[0]) && ['"', '“', '”', "'", '‘', '’'].includes(leaf.content.slice(-1))) leaf.content = leaf.content.slice(1, -1);
415
421
  offset += match[0].length;
416
422
  q = q.substr(match[0].length);
417
423
  cropString = false;
@@ -527,8 +533,8 @@ var parse = function parse(query, options) {
527
533
  var nextChar = q.substr(0, 1);
528
534
  if ((_lodash["default"].isUndefined(leaf) || _lodash["default"].isArray(leaf)) && nextChar != ' ') {
529
535
  // Leaf pointing to array entity - probably not created fallback leaf to append to
530
- if (/^["“”]$/.test(nextChar) && (match = /^["“”](.*?)["“”]/.exec(q))) {
531
- // First character is a speachmark - slurp until we see the next one
536
+ // if (/^["“”]$/.test(nextChar) && (match = /^["“”](.*?)["“”]/.exec(q))) { // First character is a speachmark - slurp until we see the next one
537
+ if (/^["“”'‘’]$/.test(nextChar) && (match = /^["“”'‘’](.*?)["“”'‘’]/.exec(q))) {
532
538
  leaf = {
533
539
  type: 'phrase',
534
540
  content: match[1],
@@ -159,6 +159,7 @@ var tools = {
159
159
  case 'WoS Advanced':
160
160
  case 'Scopus (basic search)':
161
161
  case 'Scopus (advanced search)':
162
+ case 'Lilacs':
162
163
  //HTA
163
164
  case 'International HTA Database':
164
165
  number = "#" + ref;
@@ -201,6 +202,7 @@ var tools = {
201
202
  '#': settings.highlighting ? tools.createTooltip("*", "As PubMed does not single character wildcards a wildcard is used here", "highlight") : '*'
202
203
  };
203
204
  break;
205
+ case 'Lilacs':
204
206
  case 'Ovid MEDLINE':
205
207
  break;
206
208
  // Nothing needed
@@ -258,6 +260,11 @@ var tools = {
258
260
  '$': '#'
259
261
  };
260
262
  break;
263
+ // case 'Lilacs':
264
+ // replaceObj = {
265
+ // '$': '#'
266
+ // }
267
+ // break;
261
268
  case 'ProQuest Health and Medical':
262
269
  replaceObj = {
263
270
  '$': '?',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iebh/polyglot",
3
- "version": "4.7.0",
3
+ "version": "4.7.2",
4
4
  "description": "IEBH-SRA tool to convert between different medical database search formats",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {