]> git.donarmstrong.com Git - org-ref.git/blob - pubmed.org
change copy key to K
[org-ref.git] / pubmed.org
1 #+TITLE: Links and functions for Pubmed and NIH databases
2 #+AUTHOR: John Kitchin
3 #+DATE: January 5, 2015
4
5 * Introduction
6
7 This document is an experiment at creating a literate program to provide functions for interacting with pubmed databases.
8
9 This library provides links that go to pubmed resources, e.g.
10
11 pmcid:PMC3498956
12
13 pmid:23162369
14
15 and nihmsid:NIHMS395714
16
17 See http://www.ncbi.nlm.nih.gov/pmc/about/public-access-info/#p3 for details of these identifiers.
18
19 For PMID there is one interactive function that inserts a bibtex entry: pubmed-insert-bibtex-from-pmid.
20
21 This library is complementary to [[./doi-utils.org]].
22
23 * Header
24 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
25 ;;; pubmed.el --- Links and functions to interact with pubmed databases.
26
27 ;; Copyright(C) 2015 John Kitchin
28
29 ;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
30 ;; This file is not currently part of GNU Emacs.
31
32 ;; This program is free software; you can redistribute it and/or
33 ;; modify it under the terms of the GNU General Public License as
34 ;; published by the Free Software Foundation; either version 2, or (at
35 ;; your option) any later version.
36
37 ;; This program is distributed in the hope that it will be useful, but
38 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
39 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
40 ;; General Public License for more details.
41
42 ;; You should have received a copy of the GNU General Public License
43 ;; along with this program ; see the file COPYING.  If not, write to
44 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
45 ;; Boston, MA 02111-1307, USA.
46
47 ;;; Commentary:
48 ;;
49 ;; Lisp code to interact with pubmed databases, links to pubmed
50 ;; identifiers. See pubmed.org.
51 ;;;
52 ;; This library provides links that go to pubmed resources, e.g.
53 ;;
54 ;; pmcid:PMC3498956
55 ;;
56 ;; pmid:23162369
57 ;;
58 ;; and nihmsid:NIHMS395714
59 ;;
60 ;; See http://www.ncbi.nlm.nih.gov/pmc/about/public-access-info/#p3 for details of these identifiers.
61 ;;
62 ;; For PMID there is one interactive function that inserts a bibtex
63 ;; entry: `pubmed-insert-bibtex-from-pmid`.
64 #+END_SRC
65
66 * PMID (from PubMed) link and functions
67 A PMID is a number that identifies an entry in the Pubmed database.  The PMID is a unique reference number for PubMed citations. The PMID is a distinctly different number from the PMCID and is used only for PubMed records.
68
69
70 #+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
71 (org-add-link-type
72  "pmid"
73  ;; clicking
74  (lambda (link-string) (browse-url (format "http://www.ncbi.nlm.nih.gov/pubmed/%s" link-string)))
75  ;; formatting
76 (lambda (keyword desc format)
77    (cond
78     ((eq format 'html)
79      (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s\">pmid:%s</a>" keyword keyword)); no output for html
80     ((eq format 'latex)
81      ;; write out the latex command
82      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s}" keyword)))))
83 #+END_SRC
84
85
86
87 ** Get MEDLINE metadata
88 We can get bibliographic metadata from a pmid. Here we get the MEDLINE text. The website wraps the data in <pre></pre> tags.
89
90
91 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
92 (defun pubmed-get-medline (pmid)
93   "Get MEDLINE text for PMID as a string."
94   (with-current-buffer
95     (url-retrieve-synchronously
96      (format "http://www.ncbi.nlm.nih.gov/pubmed/%s/?report=medline&format=text" pmid))
97     (goto-char (point-min))
98     (let ((p1 (search-forward "<pre>"))
99           (p2 (search-forward "</pre>")))
100       (buffer-substring (+ 1 p1) (- p2 6)))))
101 #+END_SRC
102
103 #+RESULTS:
104 : pubmed-get-medline
105
106 Here is sample output:
107 #+BEGIN_SRC emacs-lisp
108 (pubmed-get-medline "23162369")
109 #+END_SRC
110
111 #+RESULTS:
112 #+begin_example
113 PMID- 23162369
114 OWN - NLM
115 STAT- Publisher
116 DA  - 20121119
117 IS  - 1040-726X (Print)
118 IS  - 1040-726X (Linking)
119 VI  - 24
120 IP  - 4
121 DP  - 2012 Dec
122 TI  - Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core 
123       Methods.
124 PG  - 569-608
125 AB  - Approaches to classroom instruction have evolved considerably over the past 50
126       years. This progress has been spurred by the development of several learning
127       principles and methods of instruction, including active learning,
128       student-centered learning, collaborative learning, experiential learning, and
129       problem-based learning. In the present paper, we suggest that these seemingly
130       different strategies share important underlying characteristics and can be viewed
131       as complimentary components of a broader approach to classroom instruction called
132       transformational teaching. Transformational teaching involves creating dynamic
133       relationships between teachers, students, and a shared body of knowledge to
134       promote student learning and personal growth. From this perspective, instructors 
135       are intellectual coaches who create teams of students who collaborate with each
136       other and with their teacher to master bodies of information. Teachers assume the
137       traditional role of facilitating students' acquisition of key course concepts,
138       but do so while enhancing students' personal development and attitudes toward
139       learning. They accomplish these goals by establishing a shared vision for a
140       course, providing modeling and mastery experiences, challenging and encouraging
141       students, personalizing attention and feedback, creating experiential lessons
142       that transcend the boundaries of the classroom, and promoting ample opportunities
143       for preflection and reflection. We propose that these methods are synergistically
144       related and, when used together, maximize students' potential for intellectual
145       and personal growth.
146 FAU - Slavich, George M
147 AU  - Slavich GM
148 AD  - Cousins Center for Psychoneuroimmunology and Department of Psychiatry and
149       Biobehavioral Sciences, University of California, Los Angeles, UCLA Medical Plaza
150       300, Room 3156, Los Angeles, CA 90095-7076, USA.
151 FAU - Zimbardo, Philip G
152 AU  - Zimbardo PG
153 LA  - ENG
154 GR  - R01 AG026364/AG/NIA NIH HHS/United States
155 GR  - T32 MH019925/MH/NIMH NIH HHS/United States
156 PT  - JOURNAL ARTICLE
157 DEP - 20120724
158 TA  - Educ Psychol Rev
159 JT  - Educational psychology review
160 JID - 9885342
161 PMC - PMC3498956
162 MID - NIHMS395714
163 EDAT- 2012/11/20 06:00
164 MHDA- 2012/11/20 06:00
165 CRDT- 2012/11/20 06:00
166 PHST- 2012/07/24 [epublish]
167 AID - 10.1007/s10648-012-9199-6 [doi]
168 PST - ppublish
169 SO  - Educ Psychol Rev. 2012 Dec;24(4):569-608. Epub 2012 Jul 24.
170 #+end_example
171
172 ** Parse the PMID MEDLINE data
173 We can parse this into a data structure
174
175 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
176 (defun pubmed-parse-medline (pmid)
177   "Parse the medline text for PMID and return a list of cons cells."
178   (let ((data '())
179         (p1)
180         (p2)
181         (tag)
182         (value))
183     (with-temp-buffer (insert (pubmed-get-medline pmid))
184                       (goto-char (point-min))
185                       (while (re-search-forward "\\(^[A-Z]\\{2,4\\}\\)\\s-*- " nil t)
186                         (setq tag (match-string 1))
187                         ;; point is at end of the search
188                         (setq p1 (point))
189                         ;; now go to next tag
190                         (re-search-forward "\\(^[A-Z]\\{2,4\\}\\)\\s-*- " nil t)
191                         (setq p2 (- (match-beginning 1) 1))
192                         (setq value (buffer-substring p1 p2))
193                         (setq data (append data (list (cons tag value))))
194                         ;; now go back to last tag to get the next one
195                         (goto-char p1)))
196     data))
197 #+END_SRC
198
199 #+RESULTS:
200 : pubmed-parse-medline
201
202 #+BEGIN_SRC emacs-lisp :results code
203 (pubmed-parse-medline "23162369")
204 #+END_SRC
205
206 #+RESULTS:
207 #+BEGIN_SRC emacs-lisp
208 (("PMID" . "23162369")
209  ("OWN" . "NLM")
210  ("STAT" . "Publisher")
211  ("DA" . "20121119")
212  ("IS" . "1040-726X (Print)")
213  ("IS" . "1040-726X (Linking)")
214  ("VI" . "24")
215  ("IP" . "4")
216  ("DP" . "2012 Dec")
217  ("TI" . "Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core \n      Methods.")
218  ("PG" . "569-608")
219  ("AB" . "Approaches to classroom instruction have evolved considerably over the past 50\n      years. This progress has been spurred by the development of several learning\n      principles and methods of instruction, including active learning,\n      student-centered learning, collaborative learning, experiential learning, and\n      problem-based learning. In the present paper, we suggest that these seemingly\n      different strategies share important underlying characteristics and can be viewed\n      as complimentary components of a broader approach to classroom instruction called\n      transformational teaching. Transformational teaching involves creating dynamic\n      relationships between teachers, students, and a shared body of knowledge to\n      promote student learning and personal growth. From this perspective, instructors \n      are intellectual coaches who create teams of students who collaborate with each\n      other and with their teacher to master bodies of information. Teachers assume the\n      traditional role of facilitating students' acquisition of key course concepts,\n      but do so while enhancing students' personal development and attitudes toward\n      learning. They accomplish these goals by establishing a shared vision for a\n      course, providing modeling and mastery experiences, challenging and encouraging\n      students, personalizing attention and feedback, creating experiential lessons\n      that transcend the boundaries of the classroom, and promoting ample opportunities\n      for preflection and reflection. We propose that these methods are synergistically\n      related and, when used together, maximize students' potential for intellectual\n      and personal growth.")
220  ("FAU" . "Slavich, George M")
221  ("AU" . "Slavich GM")
222  ("AD" . "Cousins Center for Psychoneuroimmunology and Department of Psychiatry and\n      Biobehavioral Sciences, University of California, Los Angeles, UCLA Medical Plaza\n      300, Room 3156, Los Angeles, CA 90095-7076, USA.")
223  ("FAU" . "Zimbardo, Philip G")
224  ("AU" . "Zimbardo PG")
225  ("LA" . "ENG")
226  ("GR" . "R01 AG026364/AG/NIA NIH HHS/United States")
227  ("GR" . "T32 MH019925/MH/NIMH NIH HHS/United States")
228  ("PT" . "JOURNAL ARTICLE")
229  ("DEP" . "20120724")
230  ("TA" . "Educ Psychol Rev")
231  ("JT" . "Educational psychology review")
232  ("JID" . "9885342")
233  ("PMC" . "PMC3498956")
234  ("MID" . "NIHMS395714")
235  ("EDAT" . "2012/11/20 06:00")
236  ("MHDA" . "2012/11/20 06:00")
237  ("CRDT" . "2012/11/20 06:00")
238  ("PHST" . "2012/07/24 [epublish]")
239  ("AID" . "10.1007/s10648-012-9199-6 [doi]")
240  ("PST" . "ppublish")
241  ("SO" . "\nSO  - "))
242 #+END_SRC
243
244 ** PMID to bibtex entry
245 The point of parsing the MEDLINE text is so we can make bibtex entries. We only support Journal articles for now.
246
247 #+BEGIN_SRC emacs-lisp
248 (defun pubmed-pmid-to-bibtex (pmid)
249   "Convert a PMID to a bibtex entry."
250   (let* ((data (pubmed-parse-medline pmid))
251          (type (cdr (assoc "PT" data)))
252          (title (cdr (assoc "TI" data)))
253          (authors (mapconcat 'cdr
254                              (-filter (lambda (x)
255                                         (string= (car x) "FAU"))
256                                       data)
257                              " and "))
258          (abstract (cdr (assoc "AB" data)))
259          (volume (cdr (assoc "VI" data)))
260          (issue (cdr (assoc "IP" data)))
261          (journal (cdr (assoc "JT" data)))
262          (year (cdr (assoc "DP" data)))
263          (pages (cdr (assoc "PG" data)))
264          (aid (cdr (assoc "AID" data))))
265
266     (cond
267      ((string= type "JOURNAL ARTICLE")
268       (concat "@article{,
269  author = {" authors "},
270  title = {" title "},
271  abstract = {" abstract "},
272  journal = {" journal "},
273  volume = {" volume "},
274  number = {" issue "},
275  year = {" (car (split-string year)) "},
276  pages = {" pages "},
277  doi = {" (replace-regexp-in-string " \\[doi\\]" "" aid) "},
278 }"))
279     (t
280      (message "No conversion for type: %s" type)))))
281 #+END_SRC
282
283 #+RESULTS:
284 : pubmed-pmid-to-bibtex
285
286 #+BEGIN_SRC emacs-lisp :tangle no
287 (pubmed-pmid-to-bibtex "23162369")
288 #+END_SRC
289
290 #+RESULTS:
291 #+begin_example
292 @article{,
293  author = {Slavich, George M and Zimbardo, Philip G},
294  title = {Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core 
295       Methods.},
296  abstract = {Approaches to classroom instruction have evolved considerably over the past 50
297       years. This progress has been spurred by the development of several learning
298       principles and methods of instruction, including active learning,
299       student-centered learning, collaborative learning, experiential learning, and
300       problem-based learning. In the present paper, we suggest that these seemingly
301       different strategies share important underlying characteristics and can be viewed
302       as complimentary components of a broader approach to classroom instruction called
303       transformational teaching. Transformational teaching involves creating dynamic
304       relationships between teachers, students, and a shared body of knowledge to
305       promote student learning and personal growth. From this perspective, instructors 
306       are intellectual coaches who create teams of students who collaborate with each
307       other and with their teacher to master bodies of information. Teachers assume the
308       traditional role of facilitating students' acquisition of key course concepts,
309       but do so while enhancing students' personal development and attitudes toward
310       learning. They accomplish these goals by establishing a shared vision for a
311       course, providing modeling and mastery experiences, challenging and encouraging
312       students, personalizing attention and feedback, creating experiential lessons
313       that transcend the boundaries of the classroom, and promoting ample opportunities
314       for preflection and reflection. We propose that these methods are synergistically
315       related and, when used together, maximize students' potential for intellectual
316       and personal growth.},
317  journal = {Educational psychology review},
318  volume = {24},
319  number = {4},
320  year = {2012},
321  pages = {569-608},
322  doi = {10.1007/s10648-012-9199-6},
323 }
324 #+end_example
325
326 And we probably want to be able to insert a bibtex entry
327
328 #+BEGIN_SRC emacs-lisp
329 (defun pubmed-insert-bibtex-from-pmid (pmid)
330  "Insert a bibtex entry at point derived from PMID.
331 You must clean the entry after insertion."
332  (interactive "sPMID: ")
333  (insert (pubmed-pmid-to-bibtex pmid)))
334 #+END_SRC
335
336 #+RESULTS:
337 : pubmed-insert-bibtex-from-pmid
338
339 Here is an example of a cleaned entry:
340 #+BEGIN_SRC bibtex :tangle no
341 @article{slavich-2012-trans-teach,
342   author =       {Slavich, George M and Zimbardo, Philip G},
343   title =        {Transformational Teaching: Theoretical
344                   Underpinnings, Basic Principles, and Core Methods.},
345   journal =      {Educational psychology review},
346   volume =       24,
347   number =       4,
348   pages =        {569-608},
349   year =         2012,
350   doi =          {10.1007/s10648-012-9199-6},
351   abstract =     {Approaches to classroom instruction have evolved
352                   considerably over the past 50 years. This progress
353                   has been spurred by the development of several
354                   learning principles and methods of instruction,
355                   including active learning, student-centered
356                   learning, collaborative learning, experiential
357                   learning, and problem-based learning. In the present
358                   paper, we suggest that these seemingly different
359                   strategies share important underlying
360                   characteristics and can be viewed as complimentary
361                   components of a broader approach to classroom
362                   instruction called transformational
363                   teaching. Transformational teaching involves
364                   creating dynamic relationships between teachers,
365                   students, and a shared body of knowledge to promote
366                   student learning and personal growth. From this
367                   perspective, instructors are intellectual coaches
368                   who create teams of students who collaborate with
369                   each other and with their teacher to master bodies
370                   of information. Teachers assume the traditional role
371                   of facilitating students' acquisition of key course
372                   concepts, but do so while enhancing students'
373                   personal development and attitudes toward
374                   learning. They accomplish these goals by
375                   establishing a shared vision for a course, providing
376                   modeling and mastery experiences, challenging and
377                   encouraging students, personalizing attention and
378                   feedback, creating experiential lessons that
379                   transcend the boundaries of the classroom, and
380                   promoting ample opportunities for preflection and
381                   reflection. We propose that these methods are
382                   synergistically related and, when used together,
383                   maximize students' potential for intellectual and
384                   personal growth.},
385 }
386 #+END_SRC
387
388 ** PMID to xml
389 We can also get xml of the MEDLINE data. The web page here also wraps the xml in a <pre> block and escapes the <> with &lt; and &gt;, which we have to undo. I have not used this code for anything, so I am not sure how good the xml code is.
390
391 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
392 (defun pubmed-get-medline-xml (pmid)
393   "Get MEDLINE xml for PMID as a string."
394   (interactive)
395   (with-current-buffer
396     (url-retrieve-synchronously
397      (format "http://www.ncbi.nlm.nih.gov/pubmed/%s/?report=xml&format=text" pmid))
398     (goto-char (point-min))
399     (while (search-forward "&lt;" nil t)
400       (replace-match "<"))
401     (goto-char (point-min))
402     (while (search-forward "&gt;" nil t)
403       (replace-match ">"))
404     (goto-char (point-min))   
405                            
406     (let ((p1 (search-forward "<pre>"))
407           (p2 (search-forward "</pre>")))
408       (buffer-substring (+ 1 p1) (- p2 6)))))
409 #+END_SRC
410
411 #+RESULTS:
412 : pubmed-get-medline-xml
413
414 #+BEGIN_SRC emacs-lisp :tangle no
415 (pubmed-get-medline-xml "23162369")
416 #+END_SRC
417
418 #+RESULTS:
419 #+begin_example
420 <PubmedArticle>
421     <MedlineCitation Status="Publisher" Owner="NLM">
422         <PMID Version="1">23162369</PMID>
423         <DateCreated>
424             <Year>2012</Year>
425             <Month>11</Month>
426             <Day>19</Day>
427         </DateCreated>
428         <Article PubModel="Print-Electronic">
429             <Journal>
430                 <ISSN IssnType="Print">1040-726X</ISSN>
431                 <JournalIssue CitedMedium="Print">
432                     <Volume>24</Volume>
433                     <Issue>4</Issue>
434                     <PubDate>
435                         <Year>2012</Year>
436                         <Month>Dec</Month>
437                     </PubDate>
438                 </JournalIssue>
439                 <Title>Educational psychology review</Title>
440                 <ISOAbbreviation>Educ Psychol Rev</ISOAbbreviation>
441             </Journal>
442             <ArticleTitle>Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core Methods.</ArticleTitle>
443             <Pagination>
444                 <MedlinePgn>569-608</MedlinePgn>
445             </Pagination>
446             <Abstract>
447                 <AbstractText>Approaches to classroom instruction have evolved considerably over the past 50 years. This progress has been spurred by the development of several learning principles and methods of instruction, including active learning, student-centered learning, collaborative learning, experiential learning, and problem-based learning. In the present paper, we suggest that these seemingly different strategies share important underlying characteristics and can be viewed as complimentary components of a broader approach to classroom instruction called transformational teaching. Transformational teaching involves creating dynamic relationships between teachers, students, and a shared body of knowledge to promote student learning and personal growth. From this perspective, instructors are intellectual coaches who create teams of students who collaborate with each other and with their teacher to master bodies of information. Teachers assume the traditional role of facilitating students' acquisition of key course concepts, but do so while enhancing students' personal development and attitudes toward learning. They accomplish these goals by establishing a shared vision for a course, providing modeling and mastery experiences, challenging and encouraging students, personalizing attention and feedback, creating experiential lessons that transcend the boundaries of the classroom, and promoting ample opportunities for preflection and reflection. We propose that these methods are synergistically related and, when used together, maximize students' potential for intellectual and personal growth.</AbstractText>
448             </Abstract>
449             <AuthorList>
450                 <Author>
451                     <LastName>Slavich</LastName>
452                     <ForeName>George M</ForeName>
453                     <Initials>GM</Initials>
454                     <AffiliationInfo>
455                         <Affiliation>Cousins Center for Psychoneuroimmunology and Department of Psychiatry and Biobehavioral Sciences, University of California, Los Angeles, UCLA Medical Plaza 300, Room 3156, Los Angeles, CA 90095-7076, USA.</Affiliation>
456                     </AffiliationInfo>
457                 </Author>
458                 <Author>
459                     <LastName>Zimbardo</LastName>
460                     <ForeName>Philip G</ForeName>
461                     <Initials>PG</Initials>
462                 </Author>
463             </AuthorList>
464             <Language>ENG</Language>
465             <GrantList>
466                 <Grant>
467                     <GrantID>R01 AG026364</GrantID>
468                     <Acronym>AG</Acronym>
469                     <Agency>NIA NIH HHS</Agency>
470                     <Country>United States</Country>
471                 </Grant>
472                 <Grant>
473                     <GrantID>T32 MH019925</GrantID>
474                     <Acronym>MH</Acronym>
475                     <Agency>NIMH NIH HHS</Agency>
476                     <Country>United States</Country>
477                 </Grant>
478             </GrantList>
479             <PublicationTypeList>
480                 <PublicationType UI="">JOURNAL ARTICLE</PublicationType>
481             </PublicationTypeList>
482             <ArticleDate DateType="Electronic">
483                 <Year>2012</Year>
484                 <Month>7</Month>
485                 <Day>24</Day>
486             </ArticleDate>
487         </Article>
488         <MedlineJournalInfo>
489             <MedlineTA>Educ Psychol Rev</MedlineTA>
490             <NlmUniqueID>9885342</NlmUniqueID>
491             <ISSNLinking>1040-726X</ISSNLinking>
492         </MedlineJournalInfo>
493     </MedlineCitation>
494     <PubmedData>
495         <History>
496             <PubMedPubDate PubStatus="epublish">
497                 <Year>2012</Year>
498                 <Month>7</Month>
499                 <Day>24</Day>
500             </PubMedPubDate>
501             <PubMedPubDate PubStatus="entrez">
502                 <Year>2012</Year>
503                 <Month>11</Month>
504                 <Day>20</Day>
505                 <Hour>6</Hour>
506                 <Minute>0</Minute>
507             </PubMedPubDate>
508             <PubMedPubDate PubStatus="pubmed">
509                 <Year>2012</Year>
510                 <Month>11</Month>
511                 <Day>20</Day>
512                 <Hour>6</Hour>
513                 <Minute>0</Minute>
514             </PubMedPubDate>
515             <PubMedPubDate PubStatus="medline">
516                 <Year>2012</Year>
517                 <Month>11</Month>
518                 <Day>20</Day>
519                 <Hour>6</Hour>
520                 <Minute>0</Minute>
521             </PubMedPubDate>
522         </History>
523         <PublicationStatus>ppublish</PublicationStatus>
524         <ArticleIdList>
525             <ArticleId IdType="doi">10.1007/s10648-012-9199-6</ArticleId>
526             <ArticleId IdType="pubmed">23162369</ArticleId>
527             <ArticleId IdType="pmc">PMC3498956</ArticleId>
528             <ArticleId IdType="mid">NIHMS395714</ArticleId>
529         </ArticleIdList>
530         <?nihms?>
531     </PubmedData>
532 </PubmedArticle>
533
534 #+end_example
535
536 * Pubmed Central (PMC) link
537 A PMCID starts with PMC and is followed by numbers. The PMCID is a unique reference number or identifier that is assigned to every article that is accepted into PMC. The PMCID is also used by recipients of NIH funding to demonstrate compliance with the NIH Public Access policy. The PMCID can be found in both PMC and PubMed.
538
539 Here we define a new link. Clicking on it simply opens a webpage to the article.
540
541 #+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
542 (org-add-link-type
543  "pmcid"
544  ;; clicking
545  (lambda (link-string) (browse-url (format "http://www.ncbi.nlm.nih.gov/pmc/articles/%s" link-string)))
546  ;; formatting
547 (lambda (keyword desc format)
548    (cond
549     ((eq format 'html)
550      (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/%s\">pmcid:%s</a>" keyword keyword))
551     ((eq format 'latex)
552      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/%s}" keyword)))))
553 #+END_SRC
554
555 * NIHMSID 
556 The NIHMSID is a preliminary article identifier that applies only to manuscripts deposited through the NIHMS system. The NIHMSID is only valid for compliance reporting for 90 days after the publication date of an article. Once the Web version of the NIHMS submission is approved for inclusion in PMC and the corresponding citation is in PubMed, the article will also be assigned a PMCID.
557
558 #+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
559 (org-add-link-type
560  "nihmsid"
561  ;; clicking
562  (lambda (link-string) (browse-url (format "http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s" link-string)))
563  ;; formatting
564 (lambda (keyword desc format)
565    (cond
566     ((eq format 'html)
567      (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s\">nihmsid:%s</a>" keyword keyword))
568     ((eq format 'latex)
569      ;; write out the latex command
570      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s}" keyword)))))
571 #+END_SRC
572
573
574
575
576 * End of code
577 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
578 (provide 'pubmed)
579 #+END_SRC
580
581 * Build                                                            :noexport:
582 This code will tangle the elisp code out to pubmed.el and load it.
583
584 [[elisp:(org-babel-load-file "pubmed.org")]]
585
586
587