/// <summary> /// Issue the second NCBI query to fetch the results. /// </summary> /// <param name="results">The results of the first query.</param> /// <returns>A string containing the results in NCBI text format</returns> private string ExecuteFetch(EsearchResults results) { string sURL = "http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=" + this.FetchMethod + "&retmode=text&restart=0&db=Pubmed"; sURL = sURL + ApiKeyParam; sURL = sURL + "&retmax=" + results.Count; sURL = sURL + "&query_key=" + results.QueryKey; sURL = sURL + "&WebEnv=" + results.WebEnv; WebRequest request = WebRequest.Create(sURL); return(ExecuteWebRequest(request)); }
/// <summary> /// Execute a query against NCBI /// This is a virtual function because MockNCBI must override it /// </summary> /// <param name="query">The query string to search for</param> /// <returns>The results of the search in the format specified when the instance was initializd</returns> public virtual string Search(string query) { EsearchResults esearchResults = ExecuteEsearch(query, ApiKeyParam); return(ExecuteFetch(esearchResults)); }