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