Class: Stupidedi::Config::TransactionSetConfig

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/stupidedi/config/transaction_set_config.rb

Overview

The implementation version specified in GS08 (or ST03) indicates which implementation guide governs the transaction.

Note we can't look only at ST01 to link "837" to our definition of 837P from the HIPAA guide without also considering "005010X222", because thereare several different "837"s (including "005010X223", etc)

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Inspect

#inspect

Constructor Details

#initializeTransactionSetConfig

Returns a new instance of TransactionSetConfig.



20
21
22
# File 'lib/stupidedi/config/transaction_set_config.rb', line 20

def initialize
  @table = Hash.new
end

Instance Attribute Details

#tableHash<[GS08/ST03, GS01, ST01], TransactionSetDef> (readonly)

Returns:

  • (Hash<[GS08/ST03, GS01, ST01], TransactionSetDef>)


18
19
20
# File 'lib/stupidedi/config/transaction_set_config.rb', line 18

def table
  @table
end

Instance Method Details

#at(gs08, gs01, st01) ⇒ TransactionSetDef

Returns:

  • (TransactionSetDef)


38
39
40
41
# File 'lib/stupidedi/config/transaction_set_config.rb', line 38

def at(gs08, gs01, st01)
  x = @table[Array[gs08, gs01, st01]]
  x.is_a?(Proc) ? x.call : x
end

#customize(&block)



24
25
26
# File 'lib/stupidedi/config/transaction_set_config.rb', line 24

def customize(&block)
  tap(&block)
end

#defined_at?(gs08, gs01, st01) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/stupidedi/config/transaction_set_config.rb', line 43

def defined_at?(gs08, gs01, st01)
  @table.defined_at?([gs08, gs01, st01])
end

#pretty_print(q)

This method returns an undefined value.

:nocov:



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/stupidedi/config/transaction_set_config.rb', line 49

def pretty_print(q)
  q.text "TransactionSetConfig"
  q.group(2, "(", ")") do
    q.breakable ""
    @table.keys.each do |e|
      unless q.current_group.first?
        q.text ","
        q.breakable
      end
      q.pp e
    end
  end
end

#register(gs08, gs01, st01, definition = nil, &constructor)

This method returns an undefined value.



29
30
31
32
33
34
35
# File 'lib/stupidedi/config/transaction_set_config.rb', line 29

def register(gs08, gs01, st01, definition = nil, &constructor)
  if block_given?
    @table[Array[gs08, gs01, st01]] = constructor
  else
    @table[Array[gs08, gs01, st01]] = definition
  end
end