Nppes provides methods for building and refreshing the National Plan and Provider Enumeration System database. Gem background operations are based on delayed_job_active_record(https://github.com/collectiveidea/delayed_job_active_record) gem.
Add it to your Gemfile:
gem 'nppes'Run the following command to install it:
bundle installRun the generator:
rails generate nppes:installRun the migrations:
rake db:migrateRun the following for initialization of DB:
rake nppes:init_baseThis command runs cycle check for updates in the background:
rake nppes:auto_updateThis command checks for update once:
rake nppes:updateRun delayed job (Always run automatically):
rake nppes:start_background_envStop delayed job:
rake nppes:stop_background_env##Requests
Request to base by NPI:
@npi = Nppes::NpIdentifier.where(npi: 'NPI as integer').firstHave next fields: npi, owner_id, owner_type, npi_deactivation_reason_code, npi_deactivation_date, npi_reactivation_date, first_name, middle_name, last_name, prefix, suffix, gender_code, entity_type_code Have next helpers: Gender name helper:
@npi.decoded_genderEntity type name helper:
@npi.decoded_entity_typeDeactivation reason helper:
@npi.decoded_deactivation_reasonResult of request has next relations:
** Addresses
@npi.np_addressesHave next fields: address1, address2, city, state, country, zip, phone Have next helpers: Country name helper:
@npi.np_licenses.first.decoded_countryState name helper:
@npi.np_licenses.first.decoded_state** Licenses
@npi.np_licensesHave next fields: taxonomy_code, license_number, state Have next helpers: Speciality title by taxonomy code:
@npi.np_licenses.first.decoded_specialityState name:
@npi.np_licenses.first.decoded_stateMIT License. Copyright 2011-2013.