def __init__(self, session, pubmed_id): self.pubmed_id = pubmed_id self.pdf_status='N' self.source='PubMed script' self.created_by = session.user self.date_created = datetime.datetime.now() pubmed = get_medline_data(pubmed_id) #Set basic information for the reference. self.status = pubmed.publish_status self.citation = pubmed.citation self.year = pubmed.year self.pdf_status = pubmed.pdf_status self.pages = pubmed.pages self.volume = pubmed.volume self.title = pubmed.title self.issue = pubmed.issue pubmed = get_medline_data(self.pubmed_id) #Add the journal. self.journal = Journal.as_unique(session, abbreviation=pubmed.journal_abbrev) #Add the abstract. self.abst = Abstract.as_unique(session, reference_id = self.id, text = pubmed.abstract_txt) #Add the authors. order = 0 for author_name in pubmed.authors: order += 1 self.authors[order] = Author.as_unique(session, name=author_name) #Add the ref_type self.refType = RefType.as_unique(session, name=pubmed.pub_type)
def __init__(self, session, pubmed_id): self.pubmed_id = pubmed_id pubmed = get_medline_data(pubmed_id) self.citation = pubmed.citation self.abstract = pubmed.abstract_txt self.created_by = session.user self.date_created = datetime.datetime.now()
def __init__(self, session, pubmed_id): self.pubmed_id = pubmed_id self.pdf_status='N' self.source='Curator Triage' self.created_by = session.user self.date_created = datetime.datetime.now() pubmed = get_medline_data(pubmed_id) log_it('Got medline data', 'SUCCESS') #Set basic information for the reference. self.status = pubmed.publish_status self.citation = pubmed.citation self.year = pubmed.year self.pdf_status = pubmed.pdf_status self.page = pubmed.pages self.volume = pubmed.volume self.title = pubmed.title self.issue = pubmed.issue self.date_published = pubmed.date_published self.date_revised = pubmed.last_revised log_it('Basic info', 'SUCCESS') #Add the journal. self.journal = Journal.as_unique(session, abbreviation=pubmed.journal_abbrev) log_it('Got journal', 'SUCCESS') #Add the abstract. if pubmed.abstract_txt is not None and not pubmed.abstract_txt == "": self.abst = Abstract.as_unique(session, reference_id = self.id, text = pubmed.abstract_txt) log_it('Add abstract', 'SUCCESS') #Add the authors. order = 0 for author_name in pubmed.authors: order += 1 self.authors[order] = Author.as_unique(session, name=author_name) log_it('Add authors', 'SUCCESS') #Add the ref_type for name in pubmed.pub_types: self.refTypes.append(RefType.as_unique(session, name=name)) log_it('Add reftype', 'SUCCESS')