Skip to content

Commit 1986f9f

Browse files
committed
Merge pull request #33 from grrrats/master
Feature 809: import Pubmed Central ID
2 parents d0b4faf + 1a11c01 commit 1986f9f

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[master]
2+
- Feature #809: import pubmed central id (pmc) field from medline
23
- Fix undoing Cleanup/Convert to Biblatex
34
- Adapted pattern to parse DBLP entries
45
- Partial fix for bug 913: fixed export for .ods and .sxc (by yaragg)

src/main/java/net/sf/jabref/imports/MedlineHandler.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2003-2011 JabRef contributors.
1+
/* Copyright (C) 2003-2014 JabRef contributors.
22
This program is free software; you can redistribute it and/or modify
33
it under the terms of the GNU General Public License as published by
44
the Free Software Foundation; either version 2 of the License, or
@@ -38,14 +38,14 @@ public class MedlineHandler extends DefaultHandler
3838
inMedlineID = false, inURL=false,
3939
inIssue = false, inPubDate = false,
4040
inUrl=false, inForename=false, inAbstractText=false, inMedlineDate=false,
41-
inPubMedID=false, inDescriptorName=false,inDoi=false,inPii=false,
41+
inPubMedID=false, inDescriptorName=false,inDoi=false,inPii=false,inPmc=false,
4242
inAffiliation=false, inMeshHeader=false, inQualifierName=false,
4343
inLanguage=false, inPst=false;
4444
String title="", journal="", keywords ="",author="",
4545
lastName="",suffix="",year="",forename="", abstractText="", affiliation="";
4646
String month="",volume="",lastname="",initials="",number="",page="",medlineID="",url="",MedlineDate="";
4747
String series="",editor="",booktitle="",type="article",key="",address="",
48-
pubmedid="",doi="",pii="", majorTopic = "", minorTopics = "", language = "", pst= "";
48+
pubmedid="",doi="",pii="", pmc="",majorTopic = "", minorTopics = "", language = "", pst= "";
4949
ArrayList<String> authors=new ArrayList<String>();
5050
TreeSet<String> descriptors = new TreeSet<String>(); // To gather keywords
5151
int rowNum=0;
@@ -117,6 +117,8 @@ else if(localName.equals("ArticleId")){
117117
inDoi=true;
118118
else if(value.equals("pii"))
119119
inPii=true;
120+
else if(value.equals("pmc"))
121+
inPmc=true;
120122

121123
}
122124
}
@@ -194,6 +196,8 @@ public void endElement( String uri, String localName, String qName ) {
194196
}
195197
if(!pii.equals(""))
196198
b.setField("pii",pii);
199+
if(!pmc.equals(""))
200+
b.setField("pmc",pmc);
197201
if(!affiliation.equals("")) {
198202
b.setField("institution",affiliation.replaceAll("#", "\\\\#"));
199203
}
@@ -212,7 +216,7 @@ public void endElement( String uri, String localName, String qName ) {
212216
title="";
213217
journal="";
214218
keywords ="";
215-
doi=""; pii="";
219+
doi=""; pii=""; pmc="";
216220
year="";
217221
forename="";
218222
lastName="";
@@ -293,7 +297,9 @@ else if(localName.equals("ArticleId")){
293297
if(inDoi)
294298
inDoi=false;
295299
else if(inPii)
296-
inPii=false;}
300+
inPii=false;
301+
else if(inPmc)
302+
inPmc=false;}
297303
}
298304

299305
public void characters( char[] data, int start, int length ) {
@@ -332,6 +338,7 @@ else if(inForename){
332338
else if(inMedlineDate){ MedlineDate += new String(data,start,length);}
333339
else if(inDoi){ doi=new String(data,start,length);}
334340
else if(inPii){ pii=new String(data,start,length);}
341+
else if(inPmc){ pmc=new String(data,start,length);}
335342
else if(inAffiliation){ affiliation = new String(data,start,length);}
336343
}
337344

src/main/resources/help/About.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ <h2>Contributions from:</h2>
6767
Yara Grassi Gouffon,
6868
Leonardo Haddad Carlos
6969
Sascha Hunold,
70+
Philip Johnson,
7071
Bernd Kalbfuss,
7172
Martin K&auml;hmer,
7273
Ervin Kolenovic,

0 commit comments

Comments
 (0)