Module: Nppes

Defined in:
lib/nppes.rb,
lib/nppes/railtie.rb,
lib/nppes/version.rb,
lib/nppes/jobs/initer_job.rb,
lib/nppes/jobs/updater_job.rb,
lib/nppes/update_pack/base.rb,
lib/nppes/update_pack/data.rb,
lib/nppes/update_pack/pack.rb,
lib/nppes/jobs/searcher_job.rb,
lib/nppes/models/np_address.rb,
lib/nppes/models/np_license.rb,
lib/nppes/update_pack/header.rb,
lib/nppes/models/np_identifier.rb,
lib/nppes/models/np_update_check.rb,
lib/nppes/update_pack/code_values.rb,
lib/nppes/update_pack/required_fields.rb,
lib/generators/nppes/install_generator.rb

Defined Under Namespace

Modules: Generators, Jobs, UpdatePack Classes: NpAddress, NpIdentifier, NpLicense, NpUpdateCheck, Railtie

Constant Summary collapse

VERSION =
'0.3.3.5'

Class Method Summary collapse

Class Method Details

.background_initObject



44
45
46
# File 'lib/nppes.rb', line 44

def background_init
  UpdatePack::Pack.background_init_base
end

.background_update(continious = false) ⇒ Object



36
37
38
# File 'lib/nppes.rb', line 36

def background_update(continious = false)
  UpdatePack::Pack.background_check_updates(continious)
end

.decode_value(value_type, value) ⇒ Object



60
61
62
# File 'lib/nppes.rb', line 60

def decode_value(value_type, value)
  UpdatePack::CodeValues.decode(value_type, value)
end

.get_time_periodObject



56
57
58
# File 'lib/nppes.rb', line 56

def get_time_period
  weekly ? 8.days.to_i : 32.days.to_i
end

.has_npi?(npi) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/nppes.rb', line 52

def has_npi?(npi)
  Nppes::NpIdentifier.where(npi: npi).present?
end

.initObject



40
41
42
# File 'lib/nppes.rb', line 40

def init
  UpdatePack::Pack.init_base
end

.init_by_file(zip_file_name) ⇒ Object



48
49
50
# File 'lib/nppes.rb', line 48

def init_by_file(zip_file_name)
  UpdatePack::Pack.proceed(zip_file_name)
end

.loggerObject



24
25
26
# File 'lib/nppes.rb', line 24

def logger
  @@logger ||= Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Nppes)

    the object that the method was called on



28
29
30
# File 'lib/nppes.rb', line 28

def setup
  yield self
end

.updateObject



32
33
34
# File 'lib/nppes.rb', line 32

def update
  UpdatePack::Pack.check_updates
end