org.vivoweb.harvester.fetch
Class PubmedFetch

java.lang.Object
  extended by org.vivoweb.harvester.fetch.NIHFetch
      extended by org.vivoweb.harvester.fetch.PubmedFetch

public class PubmedFetch
extends NIHFetch

Module for fetching PubMed Citations using the PubMed SOAP Interface Based on the example code available at the PubMed Website.

Author:
Stephen V. Williams (swilliams@ctrip.ufl.edu), Dale R. Scheppler (dscheppler@ctrip.ufl.edu), Christopher Haines (hainesc@ctrip.ufl.edu)

Field Summary
protected static XMLRecordOutputStream baseXMLROS
          a base xmlrecordoutputstream
 
Constructor Summary
PubmedFetch(ArgList argList)
          Constructor
PubmedFetch(java.lang.String[] args)
          Constructor
PubmedFetch(java.lang.String emailAddress, java.io.OutputStream outStream)
          Constructor: Primary method for running a PubMed Fetch.
PubmedFetch(java.lang.String emailAddress, java.lang.String searchTerm, java.lang.String maxRecords, java.lang.String batchSize, java.io.OutputStream outStream)
          Constructor: Primary method for running a PubMed Fetch.
PubmedFetch(java.lang.String emailAddress, java.lang.String searchTerm, java.lang.String maxRecords, java.lang.String batchSize, RecordHandler rh)
          Constructor: Primary method for running a PubMed Fetch.
 
Method Summary
 void fetchRecords(java.lang.String WebEnv, java.lang.String QueryKey, java.lang.String retStart, java.lang.String numRecords)
          Performs an NIH Fetch using a previously defined esearch environment and querykey
protected  int getLatestRecord()
          Get latest NIH result
static void main(java.lang.String... args)
          Main method
 
Methods inherited from class org.vivoweb.harvester.fetch.NIHFetch
execute, fetchRecords, fetchRecords, getBatchSize, getEmailAddress, getMaxRecords, getOsWriter, getParser, getSearchTerm, getToolName, runESearch, runESearch, setBatchSize, setEmailAddress, setMaxRecords, setOsWriter, setSearchTerm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseXMLROS

protected static XMLRecordOutputStream baseXMLROS
a base xmlrecordoutputstream

Constructor Detail

PubmedFetch

public PubmedFetch(java.lang.String emailAddress,
                   java.io.OutputStream outStream)
            throws java.io.IOException
Constructor: Primary method for running a PubMed Fetch. The email address of the person responsible for this install of the program is required by NIH guidelines so the person can be contacted if there is a problem, such as sending too many queries too quickly.

Parameters:
emailAddress - contact email address of the person responsible for this install of the VIVO Harvester
outStream - output stream to write to
Throws:
java.io.IOException - error finding latest record

PubmedFetch

public PubmedFetch(java.lang.String emailAddress,
                   java.lang.String searchTerm,
                   java.lang.String maxRecords,
                   java.lang.String batchSize,
                   java.io.OutputStream outStream)
Constructor: Primary method for running a PubMed Fetch. The email address of the person responsible for this install of the program is required by NIH guidelines so the person can be contacted if there is a problem, such as sending too many queries too quickly.

Parameters:
emailAddress - contact email address of the person responsible for this install of the VIVO Harvester
searchTerm - query to run on pubmed data
maxRecords - maximum number of records to fetch
batchSize - number of records to fetch per batch
outStream - output stream to write to

PubmedFetch

public PubmedFetch(java.lang.String emailAddress,
                   java.lang.String searchTerm,
                   java.lang.String maxRecords,
                   java.lang.String batchSize,
                   RecordHandler rh)
Constructor: Primary method for running a PubMed Fetch. The email address of the person responsible for this install of the program is required by NIH guidelines so the person can be contacted if there is a problem, such as sending too many queries too quickly.

Parameters:
emailAddress - contact email address of the person responsible for this install of the VIVO Harvester
searchTerm - query to run on pubmed data
maxRecords - maximum number of records to fetch
batchSize - number of records to fetch per batch
rh - record handler to write to

PubmedFetch

public PubmedFetch(java.lang.String[] args)
            throws java.io.IOException
Constructor

Parameters:
args - commandline argument
Throws:
java.io.IOException - error creating task

PubmedFetch

public PubmedFetch(ArgList argList)
            throws java.io.IOException
Constructor

Parameters:
argList - parsed argument list
Throws:
java.io.IOException - error creating task
Method Detail

fetchRecords

public void fetchRecords(java.lang.String WebEnv,
                         java.lang.String QueryKey,
                         java.lang.String retStart,
                         java.lang.String numRecords)
                  throws java.io.IOException
Description copied from class: NIHFetch
Performs an NIH Fetch using a previously defined esearch environment and querykey

Specified by:
fetchRecords in class NIHFetch
Parameters:
WebEnv - web environment from an ESearch
QueryKey - query key from an ESearch
retStart - record number (out of the total - eg: '1200' out of 15000 records), not the record ID
numRecords - The number of records to fetch
Throws:
java.io.IOException - error fetching records

getLatestRecord

protected int getLatestRecord()
                       throws java.io.IOException
Description copied from class: NIHFetch
Get latest NIH result

Specified by:
getLatestRecord in class NIHFetch
Returns:
latest record
Throws:
java.io.IOException - error processing search

main

public static void main(java.lang.String... args)
Main method

Parameters:
args - commandline arguments