Skip to content

Commit

Permalink
Merge pull request pkp#4357 from jonasraoni/feature-main-10174-includ…
Browse files Browse the repository at this point in the history
…e-orcid-on-pubmed

Feature main 10174 include orcid on pubmed
  • Loading branch information
jonasraoni authored Jul 16, 2024
2 parents 68f4934 + d163378 commit db0b577
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/importexport/pubmed/filter/ArticlePubMedXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ public function generateAuthorNode($doc, $journal, $issue, $submission, $author)
$authorElement->appendChild($doc->createElement('LastName'))->appendChild($doc->createTextNode(ucfirst($author->getLocalizedFamilyName())));
}
$authorElement->appendChild($doc->createElement('Affiliation'))->appendChild($doc->createTextNode($author->getLocalizedAffiliation()));
// We're storing the ORCID with a URL (http://orcid.org/{$ID}), but the XML expects just the ID
$orcidId = explode('/', trim($author->getData('orcid') ?? '', '/'));
$orcidId = array_pop($orcidId);
if ($orcidId) {
$orcidNode = $authorElement->appendChild($doc->createElement('Identifier'));
$orcidNode->setAttribute('Source', 'ORCID');
$orcidNode->appendChild($doc->createTextNode($orcidId));
}

return $authorElement;
}
Expand Down

0 comments on commit db0b577

Please sign in to comment.