Class: Stupidedi::Config::TransactionSetConfig
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/config/transaction_set_config.rb
Overview
The implementation version specified in GS08 and ST03 indicates which implementation guide governs the transaction. Because each guide may define multiple transaction sets (eg X212 and X279), the functional code and transaction set code are needed to lookup a definition.
In english, we can’t just look at ST01 and link “837” to our definition of 837P from the HIPAA guide.
Instance Method Summary collapse
- #at(version, function, transaction) ⇒ TransactionSetDef
- #defined_at?(version, function, transaction) ⇒ Boolean
-
#initialize ⇒ TransactionSetConfig
constructor
A new instance of TransactionSetConfig.
- #pretty_print(q) ⇒ void
- #register(version, function, transaction, definition = nil, &constructor) ⇒ void
Methods included from Inspect
Constructor Details
#initialize ⇒ TransactionSetConfig
Returns a new instance of TransactionSetConfig.
16 17 18 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 16 def initialize @table = Hash.new end |
Instance Method Details
#at(version, function, transaction) ⇒ TransactionSetDef
65 66 67 68 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 65 def at(version, function, transaction) x = @table[Array[version, nil, transaction]] x.is_a?(Proc) ? x.call : x end |
#defined_at?(version, function, transaction) ⇒ Boolean
70 71 72 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 70 def defined_at?(version, function, transaction) @table.defined_at?([version, nil, transaction]) end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 75 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(version, function, transaction, definition = nil, &constructor) ⇒ void
This method returns an undefined value.
56 57 58 59 60 61 62 |
# File 'lib/stupidedi/config/transaction_set_config.rb', line 56 def register(version, function, transaction, definition = nil, &constructor) if block_given? @table[Array[version, nil, transaction]] = constructor else @table[Array[version, nil, transaction]] = definition end end |