Sha256: ea3a8108e0046a5479987b781dfb015ff4ab130dc3509d71478f963bdbc7320d
Contents?: true
Size: 1.22 KB
Versions: 32
Compression:
Stored size: 1.22 KB
Contents
# frozen_string_literal: true module Briard module Pubmed # def get_pubmed_metadata(pmid, options = {}) # return {} if pmid.blank? # url = "http://www.ebi.ac.uk/europepmc/webservices/rest/search/query=ext_id:#{pmid}&format=json" # response = Maremma.get(url, options) # metadata = response.body.fetch("data", {}).fetch("resultList", {}).fetch("result", []).first # return { error: 'Resource not found.', status: 404 } if metadata.blank? # metadata["issued"] = metadata.fetch("pubYear", nil) # author_string = metadata.fetch("authorString", "").chomp(".") # metadata["author"] = get_authors(author_string.split(", ")) # metadata["title"] = metadata.fetch("title", "").chomp(".") # metadata["container-title"] = metadata.fetch("journalTitle", nil) # metadata["volume"] = metadata.fetch("journalVolume", nil) # metadata["page"] = metadata.fetch("pageInfo", nil) # metadata["type"] = "article-journal" # metadata # end def pmid_as_url(pmid) "http://www.ncbi.nlm.nih.gov/pubmed/#{pmid}" if pmid.present? end def pmcid_as_url(pmcid) "http://www.ncbi.nlm.nih.gov/pmc/articles/PMC#{pmcid}" if pmcid.present? end end end
Version data entries
32 entries across 32 versions & 1 rubygems