Unverified Commit 36183a2a authored by Ivo Fokkema's avatar Ivo Fokkema Committed by GitHub

Merge pull request #383 from LOVDnl/fix/257

Allow for publisher and journal-specific queries using the DOI reference search.
parents d1bad479 7708c6b8
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD) * LEIDEN OPEN VARIATION DATABASE (LOVD)
* *
* Created : 2015-03-11 * Created : 2015-03-11
* Modified : 2018-01-26 * Modified : 2019-07-30
* For LOVD : 3.0-21 * For LOVD : 3.0-22
* *
* Copyright : 2004-2018 Leiden University Medical Center; http://www.LUMC.nl/ * Copyright : 2004-2019 Leiden University Medical Center; http://www.LUMC.nl/
* Programmers : Daan Asscheman <D.Asscheman@LUMC.nl> * Programmers : Daan Asscheman <D.Asscheman@LUMC.nl>
* Ivo F.A.C. Fokkema <I.F.A.C.Fokkema@LUMC.nl> * Ivo F.A.C. Fokkema <I.F.A.C.Fokkema@LUMC.nl>
* M. Kroon <m.kroon@lumc.nl> * M. Kroon <m.kroon@lumc.nl>
...@@ -74,8 +74,18 @@ if (PATH_COUNT >= 2 && (substr($aPathElements[1], 0, 4) == 'DOI:' || substr($aPa ...@@ -74,8 +74,18 @@ if (PATH_COUNT >= 2 && (substr($aPathElements[1], 0, 4) == 'DOI:' || substr($aPa
// View specific DOI or PMID. // View specific DOI or PMID.
if (substr($aPathElements[1], 0, 4) == 'DOI:') { if (substr($aPathElements[1], 0, 4) == 'DOI:') {
$sSearchPattern = '%{DOI:%' . substr($aPathElements[1], 4) . '}%'; // By default, an DOI search is assumed to be the full DOI. But, if we don't find a dot in the suffix,
$sAjaxSearchPattern = '{DOI: ' . ':' . substr($aPathElements[1], 4) . '}'; // then we assume we're looking for all publications of this journal.
// Check: 10.1002/humu.21438 (paper) vs 10.1002/humu (journal).
if (empty($_PE[2]) || strpos($_PE[2], '.') === false) {
// No full suffix given, just a publisher or a journal search. Match on part of the DOI.
$sSearchPattern = '%{DOI:%' . substr($aPathElements[1], 4) . '%';
$sAjaxSearchPattern = '{DOI: ' . ':' . substr($aPathElements[1], 4);
} else {
// Assuming we're searching for a full DOI (a paper) here.
$sSearchPattern = '%{DOI:%' . substr($aPathElements[1], 4) . '}%';
$sAjaxSearchPattern = '{DOI: ' . ':' . substr($aPathElements[1], 4) . '}';
}
$sType = 'DOI'; $sType = 'DOI';
} elseif (substr($aPathElements[1], 0, 5) == 'PMID:') { } elseif (substr($aPathElements[1], 0, 5) == 'PMID:') {
$sSearchPattern = '%{PMID:%' . substr($aPathElements[1], 5) . '}%'; $sSearchPattern = '%{PMID:%' . substr($aPathElements[1], 5) . '}%';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment