Open dazza-codes opened 7 years ago
I just tested, and the response from PubMed works as coded. e.g.
pmids=['25277988','26488913']
pmclient=PubmedClient.new
response=pmclient.fetch_records_for_pmid_list(pmids)
produces an XML response with both docs listed as expected. In fact, you can even do this and it works:
pmids='25277988,26488913'
pmclient=PubmedClient.new
response=pmclient.fetch_records_for_pmid_list(pmids)
As implemented, our code allows you to send in an array or a comma delimited list and appears to get the correct response from PubMed either way.
The change suggested applies within the code in pmclient.fetch_records_for_pmid_list
, not to how that method is called. As tested ^^, it will result in the same requests. (Good to know that they seem to be working.)
Yup, but since it is all working as is, I am not sure there is a need to change it.
What happens when the list of PubMed IDs get larger and larger? Is there any limit that breaks it? Testing it with 2 IDs is a small request that runs quickly. What about say 500 IDs? There might be a case where the harvester pulls in SW records for a new professor who could have hundreds of pubs?
At https://github.com/sul-dlss/sul_pub/blob/master/lib/pubmed_client.rb#L15, it does
Some PubMed docs indicate the
id
param is a CSV, so maybe this code should be: