Module: BloomApi

Defined in:
lib/bloom_api.rb,
lib/bloom_api/version.rb,
lib/bloom_api/address.rb,
lib/bloom_api/provider.rb,
lib/bloom_api/specialty.rb,
lib/bloom_api/identifier.rb,
lib/bloom_api/individual.rb,
lib/bloom_api/organization.rb,
lib/bloom_api/organization_official.rb

Overview

A module which contains all code necessary for looking up health care providers via the Bloom API.

For more details visit www.bloomapi.com/

Author:

  • Dan Carpenter

Defined Under Namespace

Classes: Address, Identifier, Individual, Organization, OrganizationOfficial, Provider, ProviderNotFound, Specialty

Constant Summary collapse

BASE_URL =

The base url for the bloom api.

"www.bloomapi.com"
VERSION =

the gem's version

"0.0.2"

Class Method Summary collapse

Class Method Details

.find_by_npi(npi) ⇒ BloomApi::Individual, BloomApi::Organization

Look up a health care provider by their national provider identifier

Returns:

Raises:


32
33
34
35
36
# File 'lib/bloom_api.rb', line 32

def self.find_by_npi(npi)
  response = Net::HTTP.get_response(BASE_URL, "/api/npis/#{npi}")

  build_provider(JSON.parse(response.body)['result']) if response.code == "200"
end