]> git.donarmstrong.com Git - org-ref.git/blobdiff - pubmed.org
add key-chord dependency
[org-ref.git] / pubmed.org
index 9b616f80afa7fff45f9149e70539eaa07b0eba8e..7494e0f2f39acbf026b0e88e4e8eb4eb4c01b704 100644 (file)
@@ -18,6 +18,7 @@ See http://www.ncbi.nlm.nih.gov/pmc/about/public-access-info/#p3 for details of
 
 For PMID there is one interactive function that inserts a bibtex entry: pubmed-insert-bibtex-from-pmid.
 
+This library is complementary to [[./doi-utils.org]].
 
 * Header
 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
@@ -47,13 +48,26 @@ For PMID there is one interactive function that inserts a bibtex entry: pubmed-i
 ;;
 ;; Lisp code to interact with pubmed databases, links to pubmed
 ;; identifiers. See pubmed.org.
+;;;
+;; This library provides links that go to pubmed resources, e.g.
+;;
+;; pmcid:PMC3498956
+;;
+;; pmid:23162369
+;;
+;; and nihmsid:NIHMS395714
+;;
+;; See http://www.ncbi.nlm.nih.gov/pmc/about/public-access-info/#p3 for details of these identifiers.
+;;
+;; For PMID there is one interactive function that inserts a bibtex
+;; entry: `pubmed-insert-bibtex-from-pmid`.
 #+END_SRC
 
 * PMID (from PubMed) link and functions
 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.
 
 
-#+BEGIN_SRC emacs-lisp :tangle pubmed.el
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
 (org-add-link-type
  "pmid"
  ;; clicking
@@ -61,12 +75,15 @@ A PMID is a number that identifies an entry in the Pubmed database.  The PMID is
  ;; formatting
 (lambda (keyword desc format)
    (cond
-    ((eq format 'html) (format "")); no output for html
+    ((eq format 'html)
+     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s\">pmid:%s</a>" keyword keyword)); no output for html
     ((eq format 'latex)
      ;; write out the latex command
      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s}" keyword)))))
 #+END_SRC
 
+
+
 ** Get MEDLINE metadata
 We can get bibliographic metadata from a pmid. Here we get the MEDLINE text. The website wraps the data in <pre></pre> tags.
 
@@ -87,7 +104,7 @@ We can get bibliographic metadata from a pmid. Here we get the MEDLINE text. The
 : pubmed-get-medline
 
 Here is sample output:
-#+BEGIN_SRC emacs-lisp
+#+BEGIN_SRC emacs-lisp :tangle no
 (pubmed-get-medline "23162369")
 #+END_SRC
 
@@ -102,7 +119,7 @@ IS  - 1040-726X (Linking)
 VI  - 24
 IP  - 4
 DP  - 2012 Dec
-TI  - Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core 
+TI  - Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core
       Methods.
 PG  - 569-608
 AB  - Approaches to classroom instruction have evolved considerably over the past 50
@@ -114,7 +131,7 @@ AB  - Approaches to classroom instruction have evolved considerably over the pas
       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 
+      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,
@@ -182,56 +199,16 @@ We can parse this into a data structure
 #+RESULTS:
 : pubmed-parse-medline
 
-#+BEGIN_SRC emacs-lisp :results code
+#+BEGIN_SRC emacs-lisp  :tangle no
 (pubmed-parse-medline "23162369")
 #+END_SRC
 
-#+RESULTS:
-#+BEGIN_SRC emacs-lisp
-(("PMID" . "23162369")
- ("OWN" . "NLM")
- ("STAT" . "Publisher")
- ("DA" . "20121119")
- ("IS" . "1040-726X (Print)")
- ("IS" . "1040-726X (Linking)")
- ("VI" . "24")
- ("IP" . "4")
- ("DP" . "2012 Dec")
- ("TI" . "Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core \n      Methods.")
- ("PG" . "569-608")
- ("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.")
- ("FAU" . "Slavich, George M")
- ("AU" . "Slavich GM")
- ("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.")
- ("FAU" . "Zimbardo, Philip G")
- ("AU" . "Zimbardo PG")
- ("LA" . "ENG")
- ("GR" . "R01 AG026364/AG/NIA NIH HHS/United States")
- ("GR" . "T32 MH019925/MH/NIMH NIH HHS/United States")
- ("PT" . "JOURNAL ARTICLE")
- ("DEP" . "20120724")
- ("TA" . "Educ Psychol Rev")
- ("JT" . "Educational psychology review")
- ("JID" . "9885342")
- ("PMC" . "PMC3498956")
- ("MID" . "NIHMS395714")
- ("EDAT" . "2012/11/20 06:00")
- ("MHDA" . "2012/11/20 06:00")
- ("CRDT" . "2012/11/20 06:00")
- ("PHST" . "2012/07/24 [epublish]")
- ("AID" . "10.1007/s10648-012-9199-6 [doi]")
- ("PST" . "ppublish")
- ("SO" . "\nSO  - "))
-#+END_SRC
+
 
 ** PMID to bibtex entry
 The point of parsing the MEDLINE text is so we can make bibtex entries. We only support Journal articles for now.
 
-Issues:
-1. The year is not quite right, it has the month in it.
-2. I do not use all the fields.
-
-#+BEGIN_SRC emacs-lisp
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el
 (defun pubmed-pmid-to-bibtex (pmid)
   "Convert a PMID to a bibtex entry."
   (let* ((data (pubmed-parse-medline pmid))
@@ -278,7 +255,7 @@ Issues:
 #+begin_example
 @article{,
  author = {Slavich, George M and Zimbardo, Philip G},
- title = {Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core 
+ title = {Transformational Teaching: Theoretical Underpinnings, Basic Principles, and Core
       Methods.},
  abstract = {Approaches to classroom instruction have evolved considerably over the past 50
       years. This progress has been spurred by the development of several learning
@@ -289,7 +266,7 @@ Issues:
       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 
+      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,
@@ -312,7 +289,7 @@ Issues:
 
 And we probably want to be able to insert a bibtex entry
 
-#+BEGIN_SRC emacs-lisp
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el
 (defun pubmed-insert-bibtex-from-pmid (pmid)
  "Insert a bibtex entry at point derived from PMID.
 You must clean the entry after insertion."
@@ -388,8 +365,8 @@ We can also get xml of the MEDLINE data. The web page here also wraps the xml in
     (goto-char (point-min))
     (while (search-forward "&gt;" nil t)
       (replace-match ">"))
-    (goto-char (point-min))   
-                          
+    (goto-char (point-min))
+
     (let ((p1 (search-forward "<pre>"))
          (p2 (search-forward "</pre>")))
       (buffer-substring (+ 1 p1) (- p2 6)))))
@@ -525,7 +502,7 @@ A PMCID starts with PMC and is followed by numbers. The PMCID is a unique refere
 
 Here we define a new link. Clicking on it simply opens a webpage to the article.
 
-#+BEGIN_SRC emacs-lisp :tangle pubmed.el
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
 (org-add-link-type
  "pmcid"
  ;; clicking
@@ -534,15 +511,15 @@ Here we define a new link. Clicking on it simply opens a webpage to the article.
 (lambda (keyword desc format)
    (cond
     ((eq format 'html)
-     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/%s\">" keyword))
+     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/%s\">pmcid:%s</a>" keyword keyword))
     ((eq format 'latex)
      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/%s}" keyword)))))
 #+END_SRC
 
-* NIHMSID 
+* NIHMSID
 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.
 
-#+BEGIN_SRC emacs-lisp :tangle pubmed.el
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
 (org-add-link-type
  "nihmsid"
  ;; clicking
@@ -550,15 +527,14 @@ The NIHMSID is a preliminary article identifier that applies only to manuscripts
  ;; formatting
 (lambda (keyword desc format)
    (cond
-    ((eq format 'html) (format "")); no output for html
+    ((eq format 'html)
+     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s\">nihmsid:%s</a>" keyword keyword))
     ((eq format 'latex)
      ;; write out the latex command
-     (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s}" keyword)))))
+     (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s}" keyword)))))
 #+END_SRC
 
-#+RESULTS:
-| lambda | (link-string)         | (browse-url (format http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s link-string))                                                               |
-| lambda | (keyword desc format) | (cond ((eq format (quote html)) (format )) ((eq format (quote latex)) (format \url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s} keyword))) |
+
 
 
 * End of code
@@ -570,6 +546,3 @@ The NIHMSID is a preliminary article identifier that applies only to manuscripts
 This code will tangle the elisp code out to pubmed.el and load it.
 
 [[elisp:(org-babel-load-file "pubmed.org")]]
-
-
-