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( gem.


Add it to your Gemfile:

gem 'nppes'

Run the following command to install it:

bundle install

Run the generator:

rails generate nppes:install

Run the migrations:

rake db:migrate


Run the following for initialization of DB:

rake nppes:init_base

This command runs cycle check for updates in the background:

rake nppes:auto_update

This command checks for update once:

rake nppes:update

Service commands

Run delayed job (Always run automatically):

rake nppes:start_background_env

Stop delayed job:

rake nppes:stop_background_env


Request to base by NPI:

@npi = Nppes::NpIdentifier.where(npi: 'NPI as integer').first

Have 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:


Entity type name helper:


Deactivation reason helper:


Result of request has next relations:

** Addresses


Have next fields: address1, address2, city, state, country, zip, phone Have next helpers: Country name helper:


State name helper:


** Licenses


Have next fields: taxonomy_code, license_number, state Have next helpers: Speciality title by taxonomy code:


State name:



MIT License. Copyright 2011-2013.