Class: Stupidedi::Config

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/stupidedi/config.rb,
lib/stupidedi/config/editor_config.rb,
lib/stupidedi/config/code_list_config.rb,
lib/stupidedi/config/interchange_config.rb,
lib/stupidedi/config/transaction_set_config.rb,
lib/stupidedi/config/functional_group_config.rb

Defined Under Namespace

Classes: CodeListConfig, EditorConfig, FunctionalGroupConfig, InterchangeConfig, TransactionSetConfig

Instance Attribute Summary collapse

Constructors collapse

Instance Method Summary collapse

Methods included from Inspect

#inspect

Constructor Details

#initializeConfig

Returns a new instance of Config.


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

def initialize
  @interchange      = InterchangeConfig.new
  @functional_group = FunctionalGroupConfig.new
  @transaction_set  = TransactionSetConfig.new
  @code_list        = CodeListConfig.new
  @editor           = EditorConfig.new
end

Instance Attribute Details

#code_listCodeListConfig (readonly)

Returns:


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

def code_list
  @code_list
end

#editorEditorConfig (readonly)

Returns:


27
28
29
# File 'lib/stupidedi/config.rb', line 27

def editor
  @editor
end

#functional_groupFunctionalGroupConfig (readonly)


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

def functional_group
  @functional_group
end

#interchangeInterchangeConfig (readonly)

Returns:


15
16
17
# File 'lib/stupidedi/config.rb', line 15

def interchange
  @interchange
end

#transaction_setTransactionSetConfig (readonly)


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

def transaction_set
  @transaction_set
end

Class Method Details

.contrib(base = default)


143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/stupidedi/config.rb', line 143

def contrib(base = default)
  base.customize do |c|
    c.transaction_set.customize do |x|
      x.register("002001", "SH", "856") { Stupidedi::TransactionSets::TwoThousandOne::Standards::SH856 }
      x.register("002001", "PO", "830") { Stupidedi::TransactionSets::TwoThousandOne::Standards::PO830 }
      x.register("002001", "FA", "997") { Stupidedi::TransactionSets::TwoThousandOne::Standards::FA997 }
      x.register("003010", "RA", "820") { Stupidedi::TransactionSets::ThirtyTen::Standards::RA820 }
      x.register("003010", "PO", "850") { Stupidedi::TransactionSets::ThirtyTen::Standards::PO850 }
      x.register("003010", "PC", "860") { Stupidedi::TransactionSets::ThirtyTen::Standards::PC860 }
      x.register("003010", "PS", "830") { Stupidedi::TransactionSets::ThirtyTen::Standards::PS830 }
      x.register("003040", "WA", "142") { Stupidedi::TransactionSets::ThirtyForty::Standards::WA142 }
      x.register("003050", "PO", "850") { Stupidedi::TransactionSets::ThirtyFifty::Standards::PO850 }
      x.register("004010", "PO", "850") { Stupidedi::TransactionSets::FortyTen::Standards::PO850 }
      x.register("004010", "PR", "855") { Stupidedi::TransactionSets::FortyTen::Standards::PR855 }
      x.register("004010", "OW", "940") { Stupidedi::TransactionSets::FortyTen::Standards::OW940 }
      x.register("004010", "AR", "943") { Stupidedi::TransactionSets::FortyTen::Standards::AR943 }
      x.register("004010", "RE", "944") { Stupidedi::TransactionSets::FortyTen::Standards::RE944 }
      x.register("004010", "SW", "945") { Stupidedi::TransactionSets::FortyTen::Standards::SW945 }
      x.register("004010", "SM", "204") { Stupidedi::TransactionSets::FortyTen::Standards::SM204 }
      x.register("004010", "QM", "214") { Stupidedi::TransactionSets::FortyTen::Standards::QM214 }
      x.register("004010", "IM", "210") { Stupidedi::TransactionSets::FortyTen::Standards::IM210 }
      x.register("004010", "GF", "990") { Stupidedi::TransactionSets::FortyTen::Standards::GF990 }
      x.register("004010", "SS", "862") { Stupidedi::TransactionSets::FortyTen::Standards::SS862 }
      x.register("004010", "PS", "830") { Stupidedi::TransactionSets::FortyTen::Standards::PS830 }
      x.register("004010", "SH", "856") { Stupidedi::TransactionSets::FortyTen::Standards::SH856 }
      x.register("004010", "SQ", "866") { Stupidedi::TransactionSets::FortyTen::Standards::SQ866 }
      x.register("004010", "FA", "997") { Stupidedi::TransactionSets::FortyTen::Standards::FA997 }
      x.register("004010", "SC", "832") { Stupidedi::TransactionSets::FortyTen::Standards::SC832 }
    end
  end
end

.defaultConfig

Returns:


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/stupidedi/config.rb', line 73

def default
  new.customize do |c|
    c.interchange.customize do |x|
      x.register("00200") { Stupidedi::Interchanges::TwoHundred::InterchangeDef }
      x.register("00300") { Stupidedi::Interchanges::ThreeHundred::InterchangeDef }
      x.register("00400") { Stupidedi::Interchanges::FourHundred::InterchangeDef }
      x.register("00401") { Stupidedi::Interchanges::FourOhOne::InterchangeDef }
      x.register("00501") { Stupidedi::Interchanges::FiveOhOne::InterchangeDef }
    end

    c.functional_group.customize do |x|
      x.register("002001") { Stupidedi::Versions::TwoThousandOne::FunctionalGroupDef }
      x.register("003010") { Stupidedi::Versions::ThirtyTen::FunctionalGroupDef }
      x.register("003040") { Stupidedi::Versions::ThirtyForty::FunctionalGroupDef }
      x.register("003050") { Stupidedi::Versions::ThirtyFifty::FunctionalGroupDef }
      x.register("004010") { Stupidedi::Versions::FortyTen::FunctionalGroupDef }
      x.register("005010") { Stupidedi::Versions::FiftyTen::FunctionalGroupDef }
    end
  end
end

.hipaa(base = default)


94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/stupidedi/config.rb', line 94

def hipaa(base = default)
  base.customize do |c|
    c.transaction_set.customize do |x|
      x.register("004010",       "HP", "835") { Stupidedi::TransactionSets::FortyTen::Standards::HP835 }
      x.register("004010X091A1", "HP", "835") { Stupidedi::TransactionSets::FortyTen::Implementations::X091A1::HP835 }

      x.register("005010",       "HR", "276") { Stupidedi::TransactionSets::FiftyTen::Standards::HR276 }
      x.register("005010",       "HN", "277") { Stupidedi::TransactionSets::FiftyTen::Standards::HN277 }
      x.register("005010",       "BE", "834") { Stupidedi::TransactionSets::FiftyTen::Standards::BE834 }
      x.register("005010",       "HP", "835") { Stupidedi::TransactionSets::FiftyTen::Standards::HP835 }
      x.register("005010",       "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010",       "FA", "997") { Stupidedi::TransactionSets::FiftyTen::Standards::FA997 }
      x.register("005010",       "FA", "999") { Stupidedi::TransactionSets::FiftyTen::Standards::FA999 }
      x.register("005010",       "RA", "820") { Stupidedi::TransactionSets::FiftyTen::Standards::RA820 }
      x.register("005010X212",   "HR", "276") { Stupidedi::TransactionSets::FiftyTen::Implementations::X212::HR276 }
      x.register("005010X212",   "HN", "277") { Stupidedi::TransactionSets::FiftyTen::Implementations::X212::HN277 }
      x.register("005010X214",   "HN", "277") { Stupidedi::TransactionSets::FiftyTen::Implementations::X214::HN277 }
      x.register("005010X220",   "BE", "834") { Stupidedi::TransactionSets::FiftyTen::Implementations::X220::BE834 }
      x.register("005010X221",   "HP", "835") { Stupidedi::TransactionSets::FiftyTen::Implementations::X221::HP835 }
      x.register("005010X222",   "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Implementations::X222::HC837 }
      x.register("005010X223",   "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Implementations::X223::HC837 }
      x.register("005010X231",   "FA", "999") { Stupidedi::TransactionSets::FiftyTen::Implementations::X231::FA999 }
      x.register("005010X279",   "HS", "270") { Stupidedi::TransactionSets::FiftyTen::Implementations::X279::HS270 }
      x.register("005010X279",   "HB", "271") { Stupidedi::TransactionSets::FiftyTen::Implementations::X279::HB271 }
      x.register("005010X220A1", "BE", "834") { Stupidedi::TransactionSets::FiftyTen::Implementations::X220A1::BE834 }
      x.register("005010X221A1", "HP", "835") { Stupidedi::TransactionSets::FiftyTen::Implementations::X221A1::HP835 }
      x.register("005010X222A1", "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Implementations::X222A1::HC837 }
      x.register("005010X223A1", "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Implementations::X223A1::HC837 }
      x.register("005010X231A1", "FA", "999") { Stupidedi::TransactionSets::FiftyTen::Implementations::X231A1::FA999 }
      x.register("005010X279A1", "HS", "270") { Stupidedi::TransactionSets::FiftyTen::Implementations::X279A1::HS270 }
      x.register("005010X279A1", "HB", "271") { Stupidedi::TransactionSets::FiftyTen::Implementations::X279A1::HB271 }
      x.register("005010X223A2", "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Implementations::X223A2::HC837 }
      x.register("005010X223A3", "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Implementations::X223A3::HC837 }

      x.register("005010X217",   "HI", "278") { Stupidedi::TransactionSets::FiftyTen::Standards::HI278 }
      x.register("005010X218",   "RA", "820") { Stupidedi::TransactionSets::FiftyTen::Standards::RA820 }
      x.register("005010X224",   "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010X224A1", "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010X224A2", "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010X230",   "FA", "997") { Stupidedi::TransactionSets::FiftyTen::Standards::FA997 }
      x.register("005010X291",   "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010X292",   "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010X298",   "HC", "837") { Stupidedi::TransactionSets::FiftyTen::Standards::HC837 }
      x.register("005010X306",   "RA", "820") { Stupidedi::TransactionSets::FiftyTen::Standards::RA820 }
      x.register("005010X307",   "BE", "834") { Stupidedi::TransactionSets::FiftyTen::Standards::BE834 }
    end
  end
end

Instance Method Details

#customize(&block)


37
38
39
# File 'lib/stupidedi/config.rb', line 37

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

#pretty_print(q)

This method returns an undefined value.


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/stupidedi/config.rb', line 42

def pretty_print(q)
  q.text "Config"
  q.group 2, "(", ")" do
    q.breakable ""

    q.pp @interchange
    q.text ","
    q.breakable

    q.pp @functional_group
    q.text ","
    q.breakable

    q.pp @transaction_set
    q.text ","
    q.breakable

    q.pp @code_list
    q.text ","
    q.breakable

    q.pp @editor
  end
end