Search Pubmed by Pubmed API
0
0
Entering edit mode
4.6 years ago

Hi,

I am using pubmed API to return some papers. My code is this:

def search(query):
    Entrez.email = 'z.poorbahman1@fooo.bar'
    handle = Entrez.esearch(db='pubmed',
                            usehistory = 'y',
                            sort='relevance',
                            retmax=str(_num),
                            retmode='xml',
                            datetype='pdat',
                            mindate='2014',
                            maxdate='2019',
                            term=query)
    results = Entrez.read(handle)
    return results

def fetch_details(id_list):
    ids = ','.join(id_list)
    Entrez.email = 'z.poorbahman1@foo.bar'
    handle = Entrez.efetch(db='pubmed',
                           retmode='xml',
                           id=ids)
    results = Entrez.read(handle)
    return results

def main():
    result = search("\"Breathing Exercises\"[MeSH Terms] OR \"Coronary Vessels\"[MeSH Terms] OR \"Heart Transplantation\"[MeSH Terms]")
    id_list = results['IdList']
    papers = fetch_details(id_list)

Unfortunately, some returned papers do not have even one of searched mesh terms(Breathing Exercises, Coronary Vessels, Heart Transplantation).

I do not know what the reason is?!

I would appreciate it if you guide me.

Many thanks

Assembly • 1.1k views
ADD COMMENT
0
Entering edit mode

I have abstracted your email address for privacy purposes. Also, you're looking for help with pubmed, eutils in what looks like python code and the only tag you've used is an irrelevant one. Why is that?

ADD REPLY
0
Entering edit mode

Hi, I did not know which tag I should choose. Which tag should I choose? How to change it? I saw a post about pubmed on your website, and I thought that you could help me. Is it possible to get help of you? Regards

ADD REPLY

Login before adding your answer.

Traffic: 1467 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6