PD_x12 1.3.2 → 1.3.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/init.rb +1 -0
- data/lib/x12.rb +1 -0
- data/lib/x12/base.rb +1 -0
- data/lib/x12/loop.rb +8 -0
- data/lib/x12/parser.rb +3 -7
- data/lib/x12/version.rb +1 -1
- data/lib/x12/xmldefinitions.rb +34 -18
- data/misc/837p.xml +203 -199
- data/misc/997.xml +7 -2
- data/misc/999.xml +53 -0
- data/misc/AK1.xml +1 -0
- data/misc/AK2.xml +1 -0
- data/misc/C998.xml +29 -0
- data/misc/C999.xml +29 -0
- data/misc/CLM.xml +11 -11
- data/misc/CTX.xml +33 -0
- data/misc/IK3.xml +30 -0
- data/misc/IK4.xml +30 -0
- data/misc/IK5.xml +32 -0
- data/misc/PAT.xml +9 -9
- data/misc/T618.xml +50 -0
- data/misc/T620.xml +39 -0
- data/misc/T621.xml +39 -0
- data/misc/T723.xml +8 -3
- data/test/tc_parse_999.rb +77 -0
- data/test/{tc_parse_270interchange.rb → xc_parse_270interchange.rb} +1 -1
- data/test/{tc_parse_837p.rb → xc_parse_837p.rb} +1 -1
- data/test/{tc_parse_997.rb → xc_parse_997.rb} +1 -0
- data/test/{tc_factory_270.rb → xtc_factory_270.rb} +0 -0
- data/test/{tc_factory_270interchange.rb → xtc_factory_270interchange.rb} +0 -0
- data/test/{tc_factory_837p.rb → xtc_factory_837p.rb} +1 -1
- data/test/{tc_factory_997.rb → xtc_factory_997.rb} +4 -0
- data/test/xtc_factory_999.rb +128 -0
- data/test/{tc_parse_270.rb → xtc_parse_270.rb} +1 -1
- data/test/{tc_parse_835.rb → xtc_parse_835.rb} +0 -1
- metadata +35 -20
data/README.md
CHANGED
@@ -34,6 +34,8 @@ Or install it yourself as:
|
|
34
34
|
|
35
35
|
$ gem install PD_x12
|
36
36
|
|
37
|
+
To initialize in Rails 3.2 application, in your config/initializers directory, create a file called x12.rb and add the line: require 'x12' to it.
|
38
|
+
|
37
39
|
## Documentation
|
38
40
|
### Wiki Page: https://github.com/mjpete3/x12/wiki
|
39
41
|
|
@@ -54,6 +56,10 @@ The authors of the project were inspired by the following works:
|
|
54
56
|
|
55
57
|
|
56
58
|
# Change Log
|
59
|
+
1/26/13 - relesase 1.3.6
|
60
|
+
* changed the referencing of the misc directory so that local copies of the xml definitions are not required
|
61
|
+
* added an init.rb file in the root
|
62
|
+
|
57
63
|
12/2/12 - release 1.3.2
|
58
64
|
* Added the 835 transaction
|
59
65
|
|
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'x12'
|
data/lib/x12.rb
CHANGED
data/lib/x12/base.rb
CHANGED
data/lib/x12/loop.rb
CHANGED
data/lib/x12/parser.rb
CHANGED
@@ -56,18 +56,14 @@ module X12
|
|
56
56
|
|
57
57
|
# Deal with Microsoft devices
|
58
58
|
# get the current working directory
|
59
|
-
@dir_name = Dir.pwd + "/misc/"
|
60
|
-
file_name = @dir_name + file_name
|
61
|
-
|
62
|
-
|
63
59
|
base_name = File.basename(file_name, '.xml')
|
64
60
|
if MS_DEVICES.find{|i| i == base_name}
|
65
61
|
file_name = File.join(File.dirname, "#{base_name}_.xml")
|
66
62
|
end
|
67
|
-
|
68
|
-
|
63
|
+
file_location = File.join(File.dirname(__FILE__), "../../misc", file_name)
|
64
|
+
|
69
65
|
# Read and parse the definition
|
70
|
-
str = File.open(
|
66
|
+
str = File.open(file_location, 'r').read
|
71
67
|
#@dir_name = File.dirname(File.expand_path(file_name)) # to look up other files if needed
|
72
68
|
@x12_definition = X12::XMLDefinitions.new(str)
|
73
69
|
|
data/lib/x12/version.rb
CHANGED
data/lib/x12/xmldefinitions.rb
CHANGED
@@ -35,16 +35,20 @@ module X12
|
|
35
35
|
# Parse definitions out of XML file
|
36
36
|
def initialize(str)
|
37
37
|
doc = REXML::Document.new(str)
|
38
|
-
definitions = doc.root.name =~ /^Definition$/i ? doc.root.elements.to_a : [doc.root]
|
38
|
+
definitions = doc.root.name =~ /^Definition$/i ? doc.root.elements.to_a : [doc.root]
|
39
|
+
|
39
40
|
definitions.each { |element|
|
40
41
|
#puts element.name
|
41
42
|
syntax_element = case element.name
|
42
|
-
when /table/i
|
43
|
-
|
44
|
-
when /
|
45
|
-
|
43
|
+
when /table/i
|
44
|
+
parse_table(element)
|
45
|
+
when /segment/i
|
46
|
+
parse_segment(element)
|
47
|
+
when /composite/i
|
48
|
+
parse_composite(element)
|
49
|
+
when /loop/i
|
50
|
+
parse_loop(element)
|
46
51
|
end
|
47
|
-
|
48
52
|
self[syntax_element.class] ||= {}
|
49
53
|
self[syntax_element.class][syntax_element.name]=syntax_element
|
50
54
|
}
|
@@ -54,10 +58,14 @@ module X12
|
|
54
58
|
|
55
59
|
def parse_boolean(s)
|
56
60
|
return case s
|
57
|
-
when nil
|
58
|
-
|
59
|
-
when
|
60
|
-
|
61
|
+
when nil
|
62
|
+
false
|
63
|
+
when ""
|
64
|
+
false
|
65
|
+
when /(^y(es)?$)|(^t(rue)?$)|(^1$)/i
|
66
|
+
true
|
67
|
+
when /(^no?$)|(^f(alse)?$)|(^0$)/i
|
68
|
+
false
|
61
69
|
else
|
62
70
|
nil
|
63
71
|
end # case
|
@@ -65,12 +73,18 @@ module X12
|
|
65
73
|
|
66
74
|
def parse_type(s)
|
67
75
|
return case s
|
68
|
-
when nil
|
69
|
-
|
70
|
-
when /^
|
71
|
-
|
72
|
-
when /^
|
73
|
-
|
76
|
+
when nil
|
77
|
+
'string'
|
78
|
+
when /^C.+$/
|
79
|
+
s
|
80
|
+
when /^i(nt(eger)?)?$/i
|
81
|
+
'int'
|
82
|
+
when /^l(ong)?$/i
|
83
|
+
'long'
|
84
|
+
when /^d(ouble)?$/i
|
85
|
+
'double'
|
86
|
+
when /^s(tr(ing)?)?$/i
|
87
|
+
'string'
|
74
88
|
else
|
75
89
|
nil
|
76
90
|
end # case
|
@@ -146,8 +160,10 @@ module X12
|
|
146
160
|
|
147
161
|
components = e.elements.to_a.inject([]){|r, element|
|
148
162
|
r << case element.name
|
149
|
-
when /loop/i
|
150
|
-
|
163
|
+
when /loop/i
|
164
|
+
parse_loop(element)
|
165
|
+
when /segment/i
|
166
|
+
parse_segment(element)
|
151
167
|
else
|
152
168
|
throw Exception.new("Cannot recognize syntax for: #{element.inspect} in loop #{e.inspect}")
|
153
169
|
end # case
|
data/misc/837p.xml
CHANGED
@@ -41,205 +41,209 @@
|
|
41
41
|
<Segment name="HL" max="1" required="y" comment="Billing provider hierarchical level"/>
|
42
42
|
<Segment name="PRV" max="1" required="n" comment="Billing provider specialty information"/>
|
43
43
|
<Segment name="CUR" max="1" required="n" comment="Foreign currency information"/>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
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
|
-
|
142
|
-
|
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
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
44
|
+
<Loop name="L2010AA" max="1" required="y">
|
45
|
+
<Segment name="NM1" max="1" required="y" comment="Billing provider name"/>
|
46
|
+
<Segment name="N3" max="1" required="y" comment="Billing provider address"/>
|
47
|
+
<Segment name="N4" max="1" required="y" comment="Billing provider city/state/zip code"/>
|
48
|
+
<Segment name="REF" max="1" required="y" comment="Billing provider tax id"/>
|
49
|
+
<Segment name="REF" max="2" required="n" comment="Billing provider upin/license information"/>
|
50
|
+
<Segment name="PER" max="2" required="n" comment="Billing provider contact information"/>
|
51
|
+
</Loop>
|
52
|
+
<Loop name="L2010AB" max="1" required="n">
|
53
|
+
<Segment name="NM1" max="1" required="y" comment="Pay-to address name"/>
|
54
|
+
<Segment name="N3" max="1" required="y" comment="Pay-to provider address"/>
|
55
|
+
<Segment name="N4" max="1" required="y" comment="Pay-to provider city/state/zip code"/>
|
56
|
+
</Loop>
|
57
|
+
<Loop name="L2010AC" max="1" required="n">
|
58
|
+
<Segment name="NM1" max="1" required="y" comment="Pay-to plan name"/>
|
59
|
+
<Segment name="N3" max="1" required="y" comment="Pay-to plan address"/>
|
60
|
+
<Segment name="N4" max="1" required="y" comment="Pay-to plan city/state/zip code"/>
|
61
|
+
<Segment name="REF" max="1" required="n" comment="Pay-to plan secondary id"/>
|
62
|
+
<Segment name="REF" max="1" required="y" comment="Pay-to plan tax id"/>
|
63
|
+
</Loop>
|
64
|
+
|
65
|
+
<Loop name="L2000B" required="y">
|
66
|
+
<Segment name="HL" max="1" required="y" comment="Subscriber heiarchical level"/>
|
67
|
+
<Segment name="SBR" max="1" required="y" comment="subscriber information"/>
|
68
|
+
<Segment name="PAT" max="1" required="n" comment="Patient information"/>
|
69
|
+
|
70
|
+
<Loop name="L2010BA" max="1" required="y">
|
71
|
+
<Segment name="NM1" max="1" required="y" comment="Subscriber name"/>
|
72
|
+
<Segment name="N3" max="1" required="n" comment="Subscriber address"/>
|
73
|
+
<Segment name="N4" max="1" required="n" comment="Subscriber city/state/zip"/>
|
74
|
+
<Segment name="DMG" max="1" required="n" comment="Subscriber demographic information"/>
|
75
|
+
<Segment name="REF" max="2" required="n"/>
|
76
|
+
<Segment name="PER" max="1" required="n" comment="Property and casualty subscriber contact information"/>
|
77
|
+
</Loop>
|
78
|
+
<Loop name="L2010BB" max="1" required="y">
|
79
|
+
<Segment name="NM1" max="1" required="y" comment="Payer name"/>
|
80
|
+
<Segment name="N3" max="1" required="n" comment="Payer address"/>
|
81
|
+
<Segment name="N4" max="1" required="n" comment="Payer city/state/zip code"/>
|
82
|
+
<Segment name="REF" max="5" required="n" />
|
83
|
+
</Loop>
|
84
|
+
|
85
|
+
<Loop name="L2000C" required="n">
|
86
|
+
<Segment name="HL" required="y" comment="Patient heirarchical level"/>
|
87
|
+
<Segment name="PAT" required="y" comment="Patient information"/>
|
88
|
+
<Loop name="L2010CA" max="1" required="n">
|
89
|
+
<Segment name="NM1" max="1" required="y" comment="Patient name"/>
|
90
|
+
<Segment name="N3" max="1" required="y" comment="Patient address"/>
|
91
|
+
<Segment name="N4" max="1" required="y" comment="Patient city/state/zip"/>
|
92
|
+
<Segment name="DMG" max="1" required="y" comment="Patient demographic information"/>
|
93
|
+
<Segment name="REF" max="1" required="n" comment="Property and casualty claim number"/>
|
94
|
+
<Segment name="PER" max="1" required="n" comment="Property and casualty subscriber contact information"/>
|
95
|
+
</Loop>
|
96
|
+
</Loop>
|
97
|
+
<Loop name="L2300" max="100" required="y">
|
98
|
+
<Segment name="CLM" max="1" required="y" comment="Claim information"/>
|
99
|
+
<Segment name="DTP" max="16" required="n" comment="Claim Dates. Up to 16 different dates can be set for a 837p" />
|
100
|
+
<Segment name="PWK" max="10" required="n" comment="Claim supplemental information" />
|
101
|
+
<Segment name="CN1" max="1" required="n" comment="Contract information" />
|
102
|
+
<Segment name="AMT" max="1" required="n" comment="Patient amount paid" />
|
103
|
+
<Segment name="REF" max="14" required="n" comment="Claim References. Up to 14 different claim references can be set for a 837p" />
|
104
|
+
<Segment name="K3" max="10" required="n" comment="File information" />
|
105
|
+
<Segment name="NTE" max="1" required="n" comment="Claim note" />
|
106
|
+
<Segment name="CR1" max="1" required="n" comment="Ambulance transport information" />
|
107
|
+
<Segment name="CR2" max="1" required="n" comment="Spinal manipulation service information" />
|
108
|
+
<Segment name="CRC" max="8" required="n" comment="Code Category. Up to 8 different CRC categories can be set for an 837p" />
|
109
|
+
<Segment name="HI" max="1" required="y" comment="Healthcare diagnostic code" />
|
110
|
+
<Segment name="HI" max="1" required="n" comment="Anesthesia related procedure code" />
|
111
|
+
<Segment name="HI" max="2" required="n" comment="Condition information" />
|
112
|
+
<Segment name="HCP" max="1" required="n" comment="Claim pricing / repricing information" />
|
113
|
+
|
114
|
+
<Loop name="L2310A" max="1" required="n">
|
115
|
+
<Segment name="NM1" max="1" required="y" comment="Referring provider name"/>
|
116
|
+
<Segment name="REF" max="3" required="n" comment="Referring provider secondary id"/>
|
117
|
+
</Loop>
|
118
|
+
<Loop name="L2310B" max="1" required="n">
|
119
|
+
<Segment name="NM1" max="1" required="n" comment="Rendering provider name"/>
|
120
|
+
<Segment name="PRV" max="1" required="n" comment="Rendering provider specialty information"/>
|
121
|
+
<Segment name="REF" max="4" required="n" comment="Rendering provider secondary id"/>
|
122
|
+
</Loop>
|
123
|
+
<Loop name="L2310C" required="n">
|
124
|
+
<Segment name="NM1" max="1" required="y" comment="Service facility location"/>
|
125
|
+
<Segment name="N3" max="1" required="y" comment="Service facility address"/>
|
126
|
+
<Segment name="N4" max="1" required="y" comment="Service facility city/state/zip"/>
|
127
|
+
<Segment name="REF" max="3" required="n" comment="Service facility location secondary id"/>
|
128
|
+
<Segment name="PER" max="1" required="y" comment="Service facility contact information"/>
|
129
|
+
</Loop>
|
130
|
+
<Loop name="L2310D" max="1" required="n">
|
131
|
+
<Segment name="NM1" max="1" required="n" comment="Supervising provider name"/>
|
132
|
+
<Segment name="REF" max="4" required="n" comment="Supervising provider secondary id"/>
|
133
|
+
</Loop>
|
134
|
+
<Loop name="L2310E" max="1" required="n">
|
135
|
+
<Segment name="NM1" max="1" required="y" comment="Ambulance pick up location"/>
|
136
|
+
<Segment name="N3" max="1" required="y" comment="Ambulance pick up address"/>
|
137
|
+
<Segment name="N4" max="1" required="y" comment="Ambulance pick up city/state/zip"/>
|
138
|
+
</Loop>
|
139
|
+
<Loop name="L2310F" max="1" required="n">
|
140
|
+
<Segment name="NM1" max="1" required="y" comment="Ambulance dropoff location"/>
|
141
|
+
<Segment name="N3" max="1" required="y" comment="Ambulance dropoff address"/>
|
142
|
+
<Segment name="N4" max="1" required="y" comment="Ambulance dropoff city/state/zip"/>
|
143
|
+
</Loop>
|
144
|
+
<Loop name="L2320" max="10" required="n">
|
145
|
+
<Segment name="SBR" max="1" required="n" comment="Other subscriber information" />
|
146
|
+
<Segment name="CAS" max="5" required="n" comment="Claim level adjustment" />
|
147
|
+
<Segment name="AMT" max="3" required="n" comment="Claim level adjustment amounts" />
|
148
|
+
<Segment name="OI" max="1" required="y" comment="Other insurance coverage information" />
|
149
|
+
<Segment name="MOA" max="1" required="n" comment="Medicare outpatient adjudication information" />
|
150
|
+
</Loop>
|
151
|
+
<Loop name="L2330A" max="1" required="n">
|
152
|
+
<Segment name="NM1" max="1" required="y" comment="Other subscriber name"/>
|
153
|
+
<Segment name="N3" max="1" required="n" comment="Other subscriber address"/>
|
154
|
+
<Segment name="N4" max="1" required="y" comment="Other subscriber city/state/zip"/>
|
155
|
+
<Segment name="REF" max="1" required="n" comment="Other subscriber location secondary id"/>
|
156
|
+
</Loop>
|
157
|
+
<Loop name="L2330B" max="1" required="n">
|
158
|
+
<Segment name="NM1" max="1" required="y" comment="Other payer name" />
|
159
|
+
<Segment name="N3" max="1" required="n" comment="Other payer address"/>
|
160
|
+
<Segment name="N4" max="1" required="y" comment="Other payer city/state/zip"/>
|
161
|
+
<Segment name="DTP" max="1" required="n" comment="Date - claim check or remittance date" />
|
162
|
+
<Segment name="REF" max="6" required="n" comment="Other reference information. Up to 6 different references can be associated to an 837p" />
|
163
|
+
</Loop>
|
164
|
+
<Loop name="L2330CDEFG" max="6" required="n" comment="Loops 2330C through 2330G combined for inbound transactions, application needs to determine the correct loop being provided.">
|
165
|
+
<Segment name="NM1" max="1" required="y" comment="Name" />
|
166
|
+
<Segment name="REF" max="3" required="y" comment="Secondary id"/>
|
167
|
+
</Loop>
|
168
|
+
<Loop name="L2400" max="50" required="y">
|
169
|
+
<Segment name="LX" max="1" required="y" comment="Service line" />
|
170
|
+
<Segment name="SV1" max="1" required="y" comment="Professional service" />
|
171
|
+
<Segment name="SV5" max="1" required="n" comment="Durable medical equipment service" />
|
172
|
+
<Segment name="PWK" max="10" required="n" comment="Line supplemental informtion" />
|
173
|
+
<Segment name="PWK" max="1" required="n" comment="Durable medical equipment certificate of medical necessity indicator" />
|
174
|
+
<Segment name="CR1" max="1" required="n" comment="Ambulance transport information" />
|
175
|
+
<Segment name="CR3" max="1" required="n" comment="Durable medical equipment certification" />
|
176
|
+
<Segment name="CRC" max="3" required="n" comment="Ambulance certification" />
|
177
|
+
<Segment name="CRC" max="1" required="n" comment="Hospice employee indicator" />
|
178
|
+
<Segment name="CRC" max="1" required="n" comment="Condition indicator durable medical equipment" />
|
179
|
+
<Segment name="DTP" max="1" required="y" comment="Date - service date; qualifier=472" />
|
180
|
+
<Segment name="DTP" max="9" required="n" />
|
181
|
+
<Segment name="QTY" max="1" required="n" comment="Ambulance patient count; qualifier=PT" />
|
182
|
+
<Segment name="QTY" max="1" required="n" comment="Obstetric Anesthesia additional units; qualifier=FL" />
|
183
|
+
<Segment name="MEA" max="5" required="n" comment="Test Results" />
|
184
|
+
<Segment name="CN1" max="1" required="n" comment="Contract information" />
|
185
|
+
<Segment name="REF" max="17" required="n" />
|
186
|
+
<Segment name="AMT" max="2" required="n" />
|
187
|
+
<Segment name="K3" max="10" required="n" comment="File information" />
|
188
|
+
<Segment name="NTE" max="2" required="n" />
|
189
|
+
<Segment name="PS1" max="1" required="n" comment="Purchasd service information" />
|
190
|
+
<Segment name="HCP" max="1" required="n" comment="Line pricing/repricing information" />
|
191
|
+
</Loop>
|
192
|
+
<Loop name="L2410" max="1" required="n" >
|
193
|
+
<Segment name="LIN" max="1" required="n" comment="Drug identification" />
|
194
|
+
<Segment name="CTP" max="1" required="y" comment="Drug pricing" />
|
195
|
+
<Segment name="REF" max="1" required="n" comment="Prescription or compound drug association number" />
|
196
|
+
</Loop>
|
197
|
+
<Loop name="L2420A" max="1" required="n" >
|
198
|
+
<Segment name="NM1" max="1" required="n" comment="Rendering provider name" />
|
199
|
+
<Segment name="PRV" max="1" required="n" comment="Rendering provider specialty information" />
|
200
|
+
<Segment name="REF" max="20" required="n" comment="Rendering provider secondary id" />
|
201
|
+
</Loop>
|
202
|
+
<Loop name="L2420B" max="1" required="n" >
|
203
|
+
<Segment name="NM1" max="1" required="n" comment="Purchased service provider name" />
|
204
|
+
<Segment name="REF" max="20" required="n" comment="Purchased service provider secondary id" />
|
205
|
+
</Loop>
|
206
|
+
<Loop name="L2420C" max="1" required="n" >
|
207
|
+
<Segment name="NM1" max="1" required="n" comment="Service facility location name" />
|
208
|
+
<Segment name="N3" max="1" required="y" comment="Service facility location address" />
|
209
|
+
<Segment name="N4" max="1" required="y" comment="Service facility location city/state/zip" />
|
210
|
+
<Segment name="REF" max="3" required="n" comment="Service facility location secondary id" />
|
211
|
+
</Loop>
|
212
|
+
<Loop name="L2420D" max="1" required="n">
|
213
|
+
<Segment name="NM1" max="1" required="n" comment="Supervising provider name" />
|
214
|
+
<Segment name="REF" max="20" required="n" comment="Supervising provider secondary id" />
|
215
|
+
</Loop>
|
216
|
+
<Loop name="L2420E" required="n">
|
217
|
+
<Segment name="NM1" max="1" required="n" comment="Ordering provider name" />
|
218
|
+
<Segment name="N3" max="1" required="n" comment="Ordering provider address" />
|
219
|
+
<Segment name="N4" max="1" required="y" comment="Ordering provider city/state/zip" />
|
220
|
+
<Segment name="REF" max="20" required="n" comment="Ordering provider secondary id" />
|
221
|
+
<Segment name="PER" max="1" required="n" comment="Ordering provider contact information" />
|
222
|
+
</Loop>
|
223
|
+
<Loop name="L2420F" max="2" required="n">
|
224
|
+
<Segment name="NM1" max="1" required="n" comment="Refering provider name" />
|
225
|
+
<Segment name="REF" max="20" required="n" comment="Refering provider secondary id" />
|
226
|
+
</Loop>
|
227
|
+
<Loop name="L2420G" max="1" required="n">
|
228
|
+
<Segment name="NM1" max="1" required="n" comment="Ambulance pickup information" />
|
229
|
+
<Segment name="N3" max="1" required="y" comment="Ambulance pickup address" />
|
230
|
+
<Segment name="N4" max="1" required="y" comment="Ambulance pickup city/state/zip" />
|
231
|
+
</Loop>
|
232
|
+
<Loop name="L2420H" max="1" required="n">
|
233
|
+
<Segment name="NM1" max="1" required="n" comment="Ambulance dropoff information" />
|
234
|
+
<Segment name="N3" max="1" required="y" comment="Ambulance dropoff address" />
|
235
|
+
<Segment name="N4" max="1" required="y" comment="Ambulance dropoff city/state/zip" />
|
236
|
+
</Loop>
|
237
|
+
<Loop name="L2430" max="15" required="n">
|
238
|
+
<Segment name="SVD" max="1" required="n" comment="Line adjudication information" />
|
239
|
+
<Segment name="CAS" max="5" required="n" comment="Line adjustment" />
|
240
|
+
<Segment name="DTP" max="1" required="y" comment="Line check or remittance date" />
|
241
|
+
<Segment name="AMT" max="1" required="n" comment="Remaining patient liability" />
|
242
|
+
<Segment name="LQ" max="1" required="n" comment="Form identification code" />
|
243
|
+
<Segment name="FRM" max="99" required="n" comment="Supporting documentation" />
|
244
|
+
</Loop>
|
245
|
+
</Loop>
|
246
|
+
</Loop>
|
243
247
|
</Loop>
|
244
248
|
<Segment name="SE" required="y" />
|
245
249
|
</Loop>
|