Sha256: 5e8e16dd8c5629e10a075ece1d17ed1d21410eafdc865360a6b0eaa31b4d0e6f

Contents?: true

Size: 1.22 KB

Versions: 197

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module Bolognese
  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

197 entries across 197 versions & 1 rubygems

Version Path
bolognese-2.3.2 lib/bolognese/pubmed.rb
bolognese-2.3.0 lib/bolognese/pubmed.rb
bolognese-2.2.0 lib/bolognese/pubmed.rb
bolognese-2.1.1 lib/bolognese/pubmed.rb
bolognese-2.1.0 lib/bolognese/pubmed.rb
bolognese-2.0.3 lib/bolognese/pubmed.rb
bolognese-2.0.2 lib/bolognese/pubmed.rb
bolognese-2.0.1 lib/bolognese/pubmed.rb
bolognese-2.0.0 lib/bolognese/pubmed.rb
bolognese-1.11.5 lib/bolognese/pubmed.rb
bolognese-1.11.4 lib/bolognese/pubmed.rb
bolognese-1.11.3 lib/bolognese/pubmed.rb
bolognese-1.11.2 lib/bolognese/pubmed.rb
bolognese-1.11.0 lib/bolognese/pubmed.rb
bolognese-1.10.0 lib/bolognese/pubmed.rb
bolognese-1.9.18 lib/bolognese/pubmed.rb
bolognese-1.9.17 lib/bolognese/pubmed.rb
bolognese-1.9.14 lib/bolognese/pubmed.rb
bolognese-1.9.13 lib/bolognese/pubmed.rb
bolognese-1.9.12 lib/bolognese/pubmed.rb