Class: Resources::Provider

Inherits:
BaseResource show all
Includes:
ConfiguredAccountPrompter, ServiceDefinitionPrompter, ThirdPartyPrompter
Defined in:
lib/pvdgm-svc-client/resources/provider.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#options, #prompter

Instance Method Summary collapse

Methods included from ConfiguredAccountPrompter

#configured_account_id

Methods included from ServiceDefinitionPrompter

#service_definition_id

Methods included from ThirdPartyPrompter

#third_party_id

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from BaseResource

Instance Method Details

#listObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/pvdgm-svc-client/resources/provider.rb', line 8

def list
  tp_id = third_party_id
  sd_id = service_definition_id
  ca_id = 

  result = get("services/sltc_providers?configured_account_id=#{ca_id}")

  puts "\nProviders for account:"
  table = Terminal::Table.new headings: [ 'id', 'Name', 'State', 'NPI', 'CCN', 'FacId' ] do |t|
    result.each do | provider |
      t << [ provider['id'], 
             provider['name'],
             provider['state'], 
             provider['npi'],
             provider['ccn'],
             provider['fac_id'] ]
    end
  end

  prompter.say table.to_s
  puts
end