pd_x12 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -1
- data/lib/x12/field.rb +8 -6
- data/lib/x12/version.rb +1 -1
- data/misc/270interchange.xml +3 -2
- data/test/tc_factory_270.rb +4 -4
- data/test/tc_factory_270interchange.rb +11 -11
- data/test/tc_factory_271.rb +37 -37
- data/test/tc_factory_837p.rb +48 -48
- data/test/tc_factory_997.rb +13 -13
- data/test/tc_parse_270.rb +4 -4
- data/test/tc_parse_271.rb +26 -26
- data/test/tc_parse_837p.rb +20 -20
- data/x12.gemspec +1 -1
- metadata +8 -5
- checksums.yaml +0 -15
data/README.md
CHANGED
@@ -42,7 +42,7 @@ Or install it yourself as:
|
|
42
42
|
## Major deficiencies
|
43
43
|
|
44
44
|
Validation is not implemented.
|
45
|
-
Field types
|
45
|
+
Field types are ignored.
|
46
46
|
No access methods for composites’ fields.
|
47
47
|
|
48
48
|
# Acknowledgments
|
@@ -57,6 +57,11 @@ The authors of the project were inspired by the following works:
|
|
57
57
|
|
58
58
|
|
59
59
|
# Change Log
|
60
|
+
4/15/13 - release 1.4.5
|
61
|
+
* Facotires now enforce minimum sizes - wbajzek contributed
|
62
|
+
* 270Interchnage.xml updated ST segment's field list - wbajzek contributed
|
63
|
+
* Test updated for minimum size - wbajzek contributed
|
64
|
+
|
60
65
|
3/22/13 - releases 1.4.1 - 1.4.3
|
61
66
|
* Fix errors in the 835.xml file
|
62
67
|
|
data/lib/x12/field.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2008 APP Design, Inc.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -33,11 +33,11 @@ module X12
|
|
33
33
|
|
34
34
|
# Create a new field with given parameters
|
35
35
|
def initialize(name, type, required, min_length, max_length, validation)
|
36
|
-
@name = name
|
37
|
-
@type = type
|
36
|
+
@name = name
|
37
|
+
@type = type
|
38
38
|
@required = required
|
39
39
|
@min_length = min_length.to_i
|
40
|
-
@max_length = max_length.to_i
|
40
|
+
@max_length = max_length.to_i
|
41
41
|
@validation = validation
|
42
42
|
@content = nil
|
43
43
|
end
|
@@ -56,7 +56,9 @@ module X12
|
|
56
56
|
unless @content
|
57
57
|
@content = $1 if self.type =~ /"(.*)"/ # If it's a constant
|
58
58
|
end
|
59
|
-
@content || ''
|
59
|
+
rendered = @content || ''
|
60
|
+
rendered = rendered.ljust(@min_length) if @required
|
61
|
+
rendered
|
60
62
|
end # render
|
61
63
|
|
62
64
|
# Check if it's been set yet and it's not a constant
|
data/lib/x12/version.rb
CHANGED
data/misc/270interchange.xml
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
This file is part of the X12Parser library that provides tools to
|
3
3
|
manipulate X12 messages using Ruby native syntax.
|
4
4
|
|
5
|
-
http://x12parser.rubyforge.org
|
6
|
-
|
5
|
+
http://x12parser.rubyforge.org
|
6
|
+
|
7
7
|
Copyright (C) 2009 APP Design, Inc.
|
8
8
|
|
9
9
|
This library is free software; you can redistribute it and/or
|
@@ -33,6 +33,7 @@
|
|
33
33
|
<Segment name="ST" required="y" max="1">
|
34
34
|
<Field name="TransactionSetIdentifierCode" const="270" comment="Code uniquely identifying a Transaction Set"/>
|
35
35
|
<Field name="TransactionSetControlNumber" min="4" max="9" comment="Identifying control number that must be unique within the transaction set functional group assigned by the originator for a transaction set"/>
|
36
|
+
<Field name="ImplementationConventionReference" required="n" min="1" max="35" comment="Reference assigned to identify Implementation Convention"/>
|
36
37
|
</Segment>
|
37
38
|
<Segment name="BHT" required="y" max="1" comment="To define the business hierarchical structure of the transaction set and identify the business application purpose and reference data, i.e., number, date, and time">
|
38
39
|
<Field name="HierarchicalStructureCode" required="y" const="0022" comment="Code indicating the hierarchical application structure of a transaction set that utilizes the HL segment to define the structure of the transaction set"/>
|
data/test/tc_factory_270.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2008 APP Design, Inc.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -33,7 +33,7 @@ BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
|
33
33
|
HL*1**20*1~
|
34
34
|
NM1*PR*2*BIG PAYOR*****PI*CHICAGO BLUES~
|
35
35
|
HL*2*1*21*1~
|
36
|
-
NM1*1P*1
|
36
|
+
NM1*1P*1* *****SV*daw~
|
37
37
|
HL*3*2*22*0~
|
38
38
|
NM1*IL*1*Doe*Joe~
|
39
39
|
DMG*D8*19700725~
|
@@ -97,7 +97,7 @@ EOT
|
|
97
97
|
hl.HierarchicalChildCode='1'
|
98
98
|
}
|
99
99
|
count += 1
|
100
|
-
|
100
|
+
|
101
101
|
l2000B.L2100B {|l2100B|
|
102
102
|
l2100B.NM1 {|nm1|
|
103
103
|
nm1.EntityIdentifierCode1='1P'
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2008 APP Design, Inc.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -28,14 +28,14 @@ class Test270FactoryInterchange < Test::Unit::TestCase
|
|
28
28
|
|
29
29
|
@@p = nil
|
30
30
|
@@result=<<-EOT
|
31
|
-
ISA*03*user *01*password *ZZ*0000000Eliginet*ZZ*CHICAGO BLUES*070724*1726*U*00401*230623206*0*T*:~
|
31
|
+
ISA*03*user *01*password *ZZ*0000000Eliginet*ZZ*CHICAGO BLUES *070724*1726*U*00401*230623206*0*T*:~
|
32
32
|
GS*HS*0000000Eliginet*CHICAGO BLUES*20070724*1726*000*X*004010X092A1~
|
33
33
|
ST*270*0000~
|
34
34
|
BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
35
35
|
HL*1**20*1~
|
36
36
|
NM1*PR*2*RED CROSS*****PI*CHICAGO BLUES~
|
37
37
|
HL*2*1*21*1~
|
38
|
-
NM1*1P*1
|
38
|
+
NM1*1P*1* *****SV*daw~
|
39
39
|
HL*3*2*22*0~
|
40
40
|
NM1*IL*1*LastName*FirstName~
|
41
41
|
DMG*D8*19700725~
|
@@ -47,7 +47,7 @@ BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
|
47
47
|
HL*1**20*1~
|
48
48
|
NM1*PR*2*RED CROSS*****PI*CHICAGO BLUES~
|
49
49
|
HL*2*1*21*1~
|
50
|
-
NM1*1P*1
|
50
|
+
NM1*1P*1* *****SV*daw~
|
51
51
|
HL*3*2*22*0~
|
52
52
|
NM1*IL*1*LastName*FirstName~
|
53
53
|
DMG*D8*19700725~
|
@@ -59,7 +59,7 @@ BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
|
59
59
|
HL*1**20*1~
|
60
60
|
NM1*PR*2*RED CROSS*****PI*CHICAGO BLUES~
|
61
61
|
HL*2*1*21*1~
|
62
|
-
NM1*1P*1
|
62
|
+
NM1*1P*1* *****SV*daw~
|
63
63
|
HL*3*2*22*0~
|
64
64
|
NM1*IL*1*LastName*FirstName~
|
65
65
|
DMG*D8*19700725~
|
@@ -73,7 +73,7 @@ BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
|
73
73
|
HL*1**20*1~
|
74
74
|
NM1*PR*2*RED CROSS*****PI*CHICAGO BLUES~
|
75
75
|
HL*2*1*21*1~
|
76
|
-
NM1*1P*1
|
76
|
+
NM1*1P*1* *****SV*daw~
|
77
77
|
HL*3*2*22*0~
|
78
78
|
NM1*IL*1*LastName*FirstName~
|
79
79
|
DMG*D8*19700725~
|
@@ -85,7 +85,7 @@ BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
|
85
85
|
HL*1**20*1~
|
86
86
|
NM1*PR*2*RED CROSS*****PI*CHICAGO BLUES~
|
87
87
|
HL*2*1*21*1~
|
88
|
-
NM1*1P*1
|
88
|
+
NM1*1P*1* *****SV*daw~
|
89
89
|
HL*3*2*22*0~
|
90
90
|
NM1*IL*1*LastName*FirstName~
|
91
91
|
DMG*D8*19700725~
|
@@ -99,7 +99,7 @@ BHT*0022*13*LNKJNFGRWDLR*20070724*1726~
|
|
99
99
|
HL*1**20*1~
|
100
100
|
NM1*PR*2*RED CROSS*****PI*CHICAGO BLUES~
|
101
101
|
HL*2*1*21*1~
|
102
|
-
NM1*1P*1
|
102
|
+
NM1*1P*1* *****SV*daw~
|
103
103
|
HL*3*2*22*0~
|
104
104
|
NM1*IL*1*LastName*FirstName~
|
105
105
|
DMG*D8*19700725~
|
@@ -165,7 +165,7 @@ EOT
|
|
165
165
|
hl.HierarchicalChildCode='1'
|
166
166
|
}
|
167
167
|
count += 1
|
168
|
-
|
168
|
+
|
169
169
|
l2000B.L2100B {|l2100B|
|
170
170
|
l2100B.NM1 {|nm1|
|
171
171
|
nm1.EntityIdentifierCode1='1P'
|
@@ -248,7 +248,7 @@ EOT
|
|
248
248
|
ge.GroupControlNumber=groupControlNumber
|
249
249
|
}
|
250
250
|
end # create_fg
|
251
|
-
|
251
|
+
|
252
252
|
def test_all
|
253
253
|
@r = @@p.factory('270interchange')
|
254
254
|
@r.ISA {|isa|
|
data/test/tc_factory_271.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2008 APP Design, Inc.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -27,11 +27,11 @@ require 'test/unit'
|
|
27
27
|
class Test271Factory < Test::Unit::TestCase
|
28
28
|
|
29
29
|
#message in readable format
|
30
|
-
RESULT = "ISA*00*0000000000*00*0000000000*ZZ*610017
|
30
|
+
RESULT = "ISA*00*0000000000*00*0000000000*ZZ*610017 *ZZ*T0001799 *030430*1700*U*00401*000000157*0*P*:~
|
31
31
|
GS*HB*610017*T0001799*20030430*1700190*1570001*X*004010X092A1~
|
32
32
|
ST*271*0001~
|
33
33
|
BHT*0022*11*270-001-AK*20030430*1700~
|
34
|
-
HL*1
|
34
|
+
HL*1* *20*1~
|
35
35
|
NM1*PR*2*BCBSRI*****PI*00870~
|
36
36
|
HL*2*1*21*1~
|
37
37
|
NM1*1P*1*DOE*JOHN****XX*NPI#~
|
@@ -42,31 +42,31 @@ NM1*IL*1*DOE*ROBERT****MI*BP10375089330~
|
|
42
42
|
N3*80 GREEN STREET~
|
43
43
|
N4*WOONSOCKET*RI*02895~
|
44
44
|
DMG*D8*19801130*M~
|
45
|
-
EB*R
|
45
|
+
EB*R* *30~
|
46
46
|
SE*15*0001~
|
47
47
|
GE*1*1570001~
|
48
48
|
IEA*1*000000157~"
|
49
|
-
|
50
|
-
|
51
|
-
def setup
|
52
|
-
# result message that we are building and will test against
|
49
|
+
|
50
|
+
|
51
|
+
def setup
|
52
|
+
# result message that we are building and will test against
|
53
53
|
@result = RESULT
|
54
54
|
# make the result usable in the tests
|
55
55
|
@result.gsub!(/\n/,'')
|
56
56
|
|
57
57
|
@parser = X12::Parser.new('271.xml')
|
58
58
|
end
|
59
|
-
|
60
|
-
|
59
|
+
|
60
|
+
|
61
61
|
def teardown
|
62
62
|
#nothing
|
63
63
|
end
|
64
|
-
|
65
|
-
|
64
|
+
|
65
|
+
|
66
66
|
def test_all
|
67
67
|
@r = @parser.factory('271')
|
68
68
|
count = 0
|
69
|
-
|
69
|
+
|
70
70
|
@r.ISA { |isa|
|
71
71
|
isa.AuthorizationInformationQualifier = '00'
|
72
72
|
isa.AuthorizationInformation = '0000000000'
|
@@ -85,8 +85,8 @@ IEA*1*000000157~"
|
|
85
85
|
isa.UsageIndicator = 'P'
|
86
86
|
isa.ComponentElementSeparator = ':'
|
87
87
|
}
|
88
|
-
|
89
|
-
@r.GS {|gs|
|
88
|
+
|
89
|
+
@r.GS {|gs|
|
90
90
|
gs.FunctionalIdentifierCode = 'HB'
|
91
91
|
gs.ApplicationSendersCode = '610017'
|
92
92
|
gs.ApplicationReceiversCode = 'T0001799'
|
@@ -96,7 +96,7 @@ IEA*1*000000157~"
|
|
96
96
|
gs.ResponsibleAgencyCode = 'X'
|
97
97
|
gs.VersionReleaseIndustryIdentifierCode = '004010X092A1'
|
98
98
|
}
|
99
|
-
|
99
|
+
|
100
100
|
# build the message
|
101
101
|
@r.ST.TransactionSetIdentifierCode = '271'
|
102
102
|
@r.ST.TransactionSetControlNumber = '0001'
|
@@ -104,13 +104,13 @@ IEA*1*000000157~"
|
|
104
104
|
|
105
105
|
@r.BHT {|bht|
|
106
106
|
bht.HierarchicalStructureCode='0022'
|
107
|
-
bht.TransactionSetPurposeCode='11'
|
108
|
-
bht.ReferenceIdentification="270-001-AK"
|
107
|
+
bht.TransactionSetPurposeCode='11'
|
108
|
+
bht.ReferenceIdentification="270-001-AK"
|
109
109
|
bht.Date='20030430'
|
110
110
|
bht.Time='1700'
|
111
111
|
}
|
112
112
|
count += 1
|
113
|
-
|
113
|
+
|
114
114
|
@r.L2000A.HL {|hl|
|
115
115
|
hl.HierarchicalIdNumber="1"
|
116
116
|
hl.HierarchicalParentIdNumber=""
|
@@ -118,7 +118,7 @@ IEA*1*000000157~"
|
|
118
118
|
hl.HierarchicalChildCode="1"
|
119
119
|
}
|
120
120
|
count += 1
|
121
|
-
|
121
|
+
|
122
122
|
@r.L2100A.NM1 {|nm1|
|
123
123
|
nm1.EntityIdentifierCode1="PR"
|
124
124
|
nm1.EntityTypeQualifier="2"
|
@@ -131,7 +131,7 @@ IEA*1*000000157~"
|
|
131
131
|
nm1.IdentificationCode="00870"
|
132
132
|
}
|
133
133
|
count += 1
|
134
|
-
|
134
|
+
|
135
135
|
@r.L2000B.HL {|hl|
|
136
136
|
hl.HierarchicalIdNumber="2"
|
137
137
|
hl.HierarchicalParentIdNumber="1"
|
@@ -139,7 +139,7 @@ IEA*1*000000157~"
|
|
139
139
|
hl.HierarchicalChildCode="1"
|
140
140
|
}
|
141
141
|
count += 1
|
142
|
-
|
142
|
+
|
143
143
|
@r.L2100B.NM1 {|nm1|
|
144
144
|
nm1.EntityIdentifierCode1="1P"
|
145
145
|
nm1.EntityTypeQualifier="1"
|
@@ -149,13 +149,13 @@ IEA*1*000000157~"
|
|
149
149
|
nm1.IdentificationCode="NPI#"
|
150
150
|
}
|
151
151
|
count += 1
|
152
|
-
|
152
|
+
|
153
153
|
@r.L2100B.REF {|ref|
|
154
154
|
ref.ReferenceIdentificationQualifier="N5"
|
155
155
|
ref.ReferenceIdentification="0000099818"
|
156
156
|
}
|
157
157
|
count += 1
|
158
|
-
|
158
|
+
|
159
159
|
@r.L2000C.HL {|hl|
|
160
160
|
hl.HierarchicalIdNumber="3"
|
161
161
|
hl.HierarchicalParentIdNumber="2"
|
@@ -163,14 +163,14 @@ IEA*1*000000157~"
|
|
163
163
|
hl.HierarchicalChildCode="0"
|
164
164
|
}
|
165
165
|
count += 1
|
166
|
-
|
166
|
+
|
167
167
|
@r.L2000C.TRN {|trn|
|
168
168
|
trn.TraceTypeCode="2"
|
169
169
|
trn.ReferenceIdentification1="100-270-001-AK"
|
170
|
-
trn.OriginatingCompanyIdentifier="9050469595"
|
170
|
+
trn.OriginatingCompanyIdentifier="9050469595"
|
171
171
|
}
|
172
172
|
count += 1
|
173
|
-
|
173
|
+
|
174
174
|
@r.L2100C.NM1 {|nm1|
|
175
175
|
nm1.EntityIdentifierCode1="IL"
|
176
176
|
nm1.EntityTypeQualifier="1"
|
@@ -182,30 +182,30 @@ IEA*1*000000157~"
|
|
182
182
|
count += 1
|
183
183
|
|
184
184
|
@r.L2100C.N3 {|n3|
|
185
|
-
n3.AddressInformation1="80 GREEN STREET"
|
185
|
+
n3.AddressInformation1="80 GREEN STREET"
|
186
186
|
}
|
187
187
|
count += 1
|
188
|
-
|
188
|
+
|
189
189
|
@r.L2100C.N4 {|n4|
|
190
190
|
n4.CityName="WOONSOCKET"
|
191
191
|
n4.StateOrProvinceCode="RI"
|
192
192
|
n4.PostalCode="02895"
|
193
193
|
}
|
194
194
|
count += 1
|
195
|
-
|
195
|
+
|
196
196
|
@r.L2100C.DMG {|dmg|
|
197
197
|
dmg.DateTimePeriodFormatQualifier="D8"
|
198
198
|
dmg.DateTimePeriod="19801130"
|
199
199
|
dmg.GenderCode="M"
|
200
200
|
}
|
201
201
|
count += 1
|
202
|
-
|
202
|
+
|
203
203
|
@r.L2110C.EB {|eb|
|
204
|
-
eb.EligibilityOrBenefitInformation="R"
|
204
|
+
eb.EligibilityOrBenefitInformation="R"
|
205
205
|
eb.ServiceTypeCode="30"
|
206
206
|
}
|
207
207
|
count += 1
|
208
|
-
|
208
|
+
|
209
209
|
count += 1
|
210
210
|
@r.SE {|se|
|
211
211
|
se.NumberOfIncludedSegments = count
|
@@ -214,12 +214,12 @@ IEA*1*000000157~"
|
|
214
214
|
|
215
215
|
@r.GE.NumberOfTransactionSetsIncluded = "1"
|
216
216
|
@r.GE.GroupControlNumber = "1570001"
|
217
|
-
|
217
|
+
|
218
218
|
@r.IEA.NumberOfIncludedFunctionalGroups = '1'
|
219
219
|
@r.IEA.InterchangeControlNumber = '000000157'
|
220
220
|
|
221
|
-
# compare the built message to the result
|
222
|
-
assert_equal(@result, @r.render)
|
221
|
+
# compare the built message to the result
|
222
|
+
assert_equal(@result, @r.render)
|
223
223
|
end
|
224
224
|
|
225
225
|
def test_timing
|
data/test/tc_factory_837p.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2012 P&D Technical Solutions, LLC.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -25,15 +25,15 @@ require 'x12'
|
|
25
25
|
require 'test/unit'
|
26
26
|
|
27
27
|
class Test837pFactory < Test::Unit::TestCase
|
28
|
-
|
29
|
-
RESULT = "ISA*00* *00* *01*9012345720000
|
28
|
+
|
29
|
+
RESULT = "ISA*00* *00* *01*9012345720000 *01*9088877320000 *100822*1134*U*00200*000000007*0*T*:~
|
30
30
|
GS*HC*901234572000*908887732000*20100822*1615*7*X*005010X222~
|
31
31
|
ST*837*0007*005010X222~
|
32
32
|
BHT*0019*00*123BATCH*20100822*1615*CH~
|
33
33
|
NM1*41*2*ABC CLEARINGHOUSE*****46*123456789~
|
34
34
|
PER*IC*WILMA FLINSTONE*TE*9195551111~
|
35
35
|
NM1*40*2*BCBSNC*****46*987654321~
|
36
|
-
HL*1
|
36
|
+
HL*1* *20*1~
|
37
37
|
NM1*85*1*SMITH*ELIZABETH*A**M.D.*XX*0123456789~
|
38
38
|
N3*123 MUDD LANE~
|
39
39
|
N4*DURHAM*NC*27701~
|
@@ -58,14 +58,14 @@ IEA*1*000000007~"
|
|
58
58
|
def setup
|
59
59
|
@result = RESULT
|
60
60
|
@result.gsub!(/\n/,'')
|
61
|
-
|
61
|
+
|
62
62
|
@parser = X12::Parser.new('837p.xml')
|
63
|
-
end
|
64
|
-
|
63
|
+
end
|
64
|
+
|
65
65
|
def teardown
|
66
66
|
#nothing
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def segment_nm1(nm1, code1, code2, code3, code4, code5, code6, code7, code8, code9)
|
70
70
|
nm1.EntityIdentifierCode1 = code1
|
71
71
|
nm1.EntityTypeQualifier = code2
|
@@ -77,20 +77,20 @@ IEA*1*000000007~"
|
|
77
77
|
nm1.IdentificationCodeQualifier = code8
|
78
78
|
nm1.IdentificationCode = code9
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def segment_n3(n3, code1, code2)
|
82
82
|
n3.AddressInformation1 = code1
|
83
83
|
if code2 != ""
|
84
84
|
n3.AddressInformation2 = code2
|
85
85
|
end
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
def segment_n4(n4, code1, code2, code3)
|
89
89
|
n4.CityName = code1
|
90
90
|
n4.StateOrProvinceCode = code2
|
91
91
|
n4.PostalCode = code3
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
def loop_l1000a(loop)
|
95
95
|
segment_nm1(loop.NM1,"41","2","ABC CLEARINGHOUSE","","","","","46","123456789")
|
96
96
|
loop.PER {|p|
|
@@ -100,46 +100,46 @@ IEA*1*000000007~"
|
|
100
100
|
p.CommunicationNumber1 = "9195551111"
|
101
101
|
}
|
102
102
|
end
|
103
|
-
|
103
|
+
|
104
104
|
def loop_l1000b(loop)
|
105
105
|
segment_nm1(loop.NM1,"40","2","BCBSNC","","","","","46","987654321")
|
106
106
|
end
|
107
|
-
|
107
|
+
|
108
108
|
def loop_l2000a(loop)
|
109
109
|
loop.HL { |h|
|
110
|
-
h.HierarchicalIdNumber = "1"
|
110
|
+
h.HierarchicalIdNumber = "1"
|
111
111
|
h.HierarchicalLevelCode = "20"
|
112
112
|
h.HierarchicalChildCode = "1"
|
113
113
|
}
|
114
114
|
end
|
115
|
-
|
115
|
+
|
116
116
|
def loop_l2010aa(loop)
|
117
117
|
segment_nm1(loop.NM1,"85","1","SMITH","ELIZABETH","A","","M.D.","XX","0123456789")
|
118
118
|
segment_n3(loop.N3,"123 MUDD LANE","")
|
119
119
|
segment_n4(loop.N4,"DURHAM","NC","27701")
|
120
|
-
|
120
|
+
|
121
121
|
loop.REF {|r|
|
122
122
|
r.ReferenceIdentificationQualifier = "EI"
|
123
123
|
r.ReferenceIdentification = "123456789"
|
124
|
-
}
|
124
|
+
}
|
125
125
|
end
|
126
126
|
|
127
127
|
def loop_l2000b(loop)
|
128
128
|
loop.HL { |h|
|
129
|
-
h.HierarchicalIdNumber = "2"
|
130
|
-
h.HierarchicalParentIdNumber = "1"
|
129
|
+
h.HierarchicalIdNumber = "2"
|
130
|
+
h.HierarchicalParentIdNumber = "1"
|
131
131
|
h.HierarchicalLevelCode = "22"
|
132
132
|
h.HierarchicalChildCode = "0"
|
133
133
|
}
|
134
134
|
loop.SBR {|s|
|
135
135
|
s.PayerResponsibilitySequenceNumberCode = "P"
|
136
136
|
s.IndividualRelationshipCode = "18"
|
137
|
-
s.InsuredGroupOrPolicyNumber = "ABC123101"
|
137
|
+
s.InsuredGroupOrPolicyNumber = "ABC123101"
|
138
138
|
s.ClaimFilingIndicatorCode = "BL"
|
139
139
|
}
|
140
|
-
|
140
|
+
|
141
141
|
end
|
142
|
-
|
142
|
+
|
143
143
|
def loop_l2010ba(loop)
|
144
144
|
segment_nm1(loop.NM1,"IL","1","DOUGH","MARY","B","","","MI","24670389600")
|
145
145
|
segment_n3(loop.N3, "P O BOX 12312", "")
|
@@ -149,52 +149,52 @@ IEA*1*000000007~"
|
|
149
149
|
d.DateTimePeriod = "19670807"
|
150
150
|
d.GenderCode = "F"
|
151
151
|
}
|
152
|
-
|
152
|
+
|
153
153
|
end
|
154
|
-
|
154
|
+
|
155
155
|
def loop_l2010bb(loop)
|
156
156
|
segment_nm1(loop.NM1,"PR","2","BCBSNC","","","","","PI","987654321")
|
157
157
|
end
|
158
|
-
|
158
|
+
|
159
159
|
def loop_l2300(loop)
|
160
160
|
loop.CLM {|c|
|
161
161
|
c.PatientAccountNumber = "PTACCT2235057"
|
162
162
|
c.MonetaryAmount = "100.5"
|
163
|
-
c.HealthCareServiceLocationInformation = "11::1"
|
163
|
+
c.HealthCareServiceLocationInformation = "11::1"
|
164
164
|
c.ProviderOrSupplierSignatureIndicator = "Y"
|
165
165
|
c.MedicareAssignmentCode = "A"
|
166
166
|
c.BenefitsAssignmentCertificationIndicator = "Y"
|
167
167
|
c.ReleaseOfInformationCode = "N"
|
168
168
|
}
|
169
|
-
|
169
|
+
|
170
170
|
loop.REF {|r|
|
171
171
|
r.ReferenceIdentificationQualifier = "EA"
|
172
172
|
r.ReferenceIdentification = "MEDREC11111"
|
173
|
-
}
|
173
|
+
}
|
174
174
|
|
175
|
-
loop.HI.HealthCareCodeInformation1 = "BK:78901"
|
175
|
+
loop.HI.HealthCareCodeInformation1 = "BK:78901"
|
176
176
|
end
|
177
|
-
|
177
|
+
|
178
178
|
def loop_l2400(loop)
|
179
179
|
loop.LX.AssignedNumber = "1"
|
180
180
|
loop.SV1 {|s|
|
181
|
-
s.CompositeMedicalProcedureIdentifier = "HC:99212"
|
181
|
+
s.CompositeMedicalProcedureIdentifier = "HC:99212"
|
182
182
|
s.LineItemChargeAmount = "100.5"
|
183
183
|
s.UnitOrBasisForMeasurementCode = "UN"
|
184
184
|
s.ServiceUnitAmount = "1"
|
185
|
-
s.PlaceOfServiceCode = "12"
|
186
|
-
s.CompositeDiagnosisCodePointer = "1"
|
185
|
+
s.PlaceOfServiceCode = "12"
|
186
|
+
s.CompositeDiagnosisCodePointer = "1"
|
187
187
|
s.EmergencyIndicator = "N"
|
188
188
|
}
|
189
|
-
|
189
|
+
|
190
190
|
loop.DTP {|d|
|
191
191
|
d.DateTimeQualifier = "472"
|
192
192
|
d.DateTimePeriodFormatQualifier = "D8"
|
193
193
|
d.DateTimePeriod = "20100801"
|
194
194
|
}
|
195
195
|
end
|
196
|
-
|
197
|
-
|
196
|
+
|
197
|
+
|
198
198
|
def test_all
|
199
199
|
@r = @parser.factory('837p')
|
200
200
|
count = 0
|
@@ -217,8 +217,8 @@ IEA*1*000000007~"
|
|
217
217
|
isa.UsageIndicator = 'T'
|
218
218
|
isa.ComponentElementSeparator = ':'
|
219
219
|
}
|
220
|
-
|
221
|
-
@r.GS {|gs|
|
220
|
+
|
221
|
+
@r.GS {|gs|
|
222
222
|
gs.FunctionalIdentifierCode = 'HC'
|
223
223
|
gs.ApplicationSendersCode = '901234572000'
|
224
224
|
gs.ApplicationReceiversCode = '908887732000'
|
@@ -228,12 +228,12 @@ IEA*1*000000007~"
|
|
228
228
|
gs.ResponsibleAgencyCode = 'X'
|
229
229
|
gs.VersionReleaseIndustryIdentifierCode = '005010X222'
|
230
230
|
}
|
231
|
-
|
231
|
+
|
232
232
|
@r.ST.TransactionSetIdentifierCode = '837'
|
233
233
|
@r.ST.TransactionSetControlNumber = '0007'
|
234
234
|
@r.ST.ImplementationConventionReference = '005010X222'
|
235
235
|
count += 1
|
236
|
-
|
236
|
+
|
237
237
|
@r.BHT.HierarchicalStructureCode = '0019'
|
238
238
|
@r.BHT.TransactionSetPurposeCode = '00'
|
239
239
|
@r.BHT.ReferenceIdentification = '123BATCH'
|
@@ -260,19 +260,19 @@ IEA*1*000000007~"
|
|
260
260
|
count += 3
|
261
261
|
loop_l2400(@r.L2400)
|
262
262
|
count += 3
|
263
|
-
|
263
|
+
|
264
264
|
@r.SE.NumberOfIncludedSegments = count + 1
|
265
265
|
@r.SE.TransactionSetControlNumber = '0007'
|
266
|
-
|
266
|
+
|
267
267
|
@r.GE.NumberOfTransactionSetsIncluded = 1
|
268
268
|
@r.GE.GroupControlNumber = 7
|
269
|
-
|
269
|
+
|
270
270
|
@r.IEA.NumberOfIncludedFunctionalGroups = '1'
|
271
271
|
@r.IEA.InterchangeControlNumber = '000000007'
|
272
|
-
|
273
|
-
assert_equal(@result, @r.render)
|
272
|
+
|
273
|
+
assert_equal(@result, @r.render)
|
274
274
|
end
|
275
|
-
|
275
|
+
|
276
276
|
def test_timing
|
277
277
|
start = Time::now
|
278
278
|
X12::TEST_REPEAT.times do
|
@@ -281,5 +281,5 @@ IEA*1*000000007~"
|
|
281
281
|
finish = Time::now
|
282
282
|
puts sprintf("Factories per second, 837p: %.2f, elapsed: %.1f", X12::TEST_REPEAT.to_f/(finish-start), finish-start)
|
283
283
|
end # test_timing
|
284
|
-
|
284
|
+
|
285
285
|
end
|
data/test/tc_factory_997.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2008 APP Design, Inc.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -28,13 +28,13 @@ class Test997Factory < Test::Unit::TestCase
|
|
28
28
|
|
29
29
|
@@p = nil
|
30
30
|
tmp=<<-EOT
|
31
|
-
ISA
|
32
|
-
GS
|
31
|
+
ISA* * * * * * * * * * * * * * * * ~
|
32
|
+
GS* * * * * * * * ~
|
33
33
|
ST*997*2878~
|
34
34
|
AK1*HS*293328532~
|
35
|
-
AK2*270
|
36
|
-
AK3*NM1
|
37
|
-
AK4
|
35
|
+
AK2*270* ~
|
36
|
+
AK3*NM1* *L1000D~
|
37
|
+
AK4* **55*Bad element~
|
38
38
|
AK5*A~
|
39
39
|
AK3*DMG*0*L1010*22~
|
40
40
|
AK4*0**0~
|
@@ -42,10 +42,10 @@ AK4*0**1~
|
|
42
42
|
AK4*1**0~
|
43
43
|
AK4*1**1~
|
44
44
|
AK5*E****999~
|
45
|
-
AK9
|
46
|
-
SE
|
47
|
-
GE
|
48
|
-
IEA
|
45
|
+
AK9* * * * ~
|
46
|
+
SE* * ~
|
47
|
+
GE* * ~
|
48
|
+
IEA* * ~
|
49
49
|
EOT
|
50
50
|
|
51
51
|
@@result = tmp.gsub!(/\n/,'')
|
@@ -85,7 +85,7 @@ EOT
|
|
85
85
|
l.AK4 {|s|
|
86
86
|
#s.PositionInSegment =
|
87
87
|
#s.DataElementReferenceNumber =
|
88
|
-
#s.DataElementSyntaxErrorCode =
|
88
|
+
#s.DataElementSyntaxErrorCode =
|
89
89
|
s.CopyOfBadDataElement = 'Bad element'
|
90
90
|
}
|
91
91
|
}
|
@@ -109,7 +109,7 @@ EOT
|
|
109
109
|
(0..1).each {|ak4_repeat| # Two repeats of the segment AK4
|
110
110
|
l1010.AK4.repeat {|s|
|
111
111
|
s.PositionInSegment = loop_repeat
|
112
|
-
#s.DataElementReferenceNumber =
|
112
|
+
#s.DataElementReferenceNumber =
|
113
113
|
s.DataElementSyntaxErrorCode = ak4_repeat
|
114
114
|
#s.CopyOfBadDataElement =
|
115
115
|
} # s
|
data/test/tc_parse_270.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2008 APP Design, Inc.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -51,7 +51,7 @@ EOT
|
|
51
51
|
# @@p.show
|
52
52
|
end
|
53
53
|
@r = @@p
|
54
|
-
|
54
|
+
|
55
55
|
end # setup
|
56
56
|
|
57
57
|
def teardown
|
@@ -78,7 +78,7 @@ EOT
|
|
78
78
|
def test_absent
|
79
79
|
assert_equal(X12::EMPTY, @r.L2000D.HHH)
|
80
80
|
assert_equal(X12::EMPTY, @r.L2000B.L2111)
|
81
|
-
assert_equal('', @r.L2000C.L2100C.N3.AddressInformation1)
|
81
|
+
assert_equal(' ', @r.L2000C.L2100C.N3.AddressInformation1)
|
82
82
|
end # test_absent
|
83
83
|
|
84
84
|
def test_timing
|
data/test/tc_parse_271.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2012 P&D Technical Solutions, LLC.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -26,7 +26,7 @@ require 'x12'
|
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
class Test271Parse < Test::Unit::TestCase
|
29
|
-
|
29
|
+
|
30
30
|
MESSAGE = "ISA*00* *00* *ZZ*6175910AAC21T *ZZ*54503516A *061130*1445*U*00401*309242122*0*T*:~
|
31
31
|
GS*HB*617591011C21T*545035165*20030924*21000083*309001*X*004010X092A1~
|
32
32
|
ST*271*COMP1420~
|
@@ -78,30 +78,30 @@ GE*1*309001~
|
|
78
78
|
IEA*1*309242122~"
|
79
79
|
|
80
80
|
|
81
|
-
def setup
|
81
|
+
def setup
|
82
82
|
@message = MESSAGE
|
83
83
|
# make the result usable in the tests
|
84
84
|
@message.gsub!(/\n/,'')
|
85
85
|
|
86
|
-
@parser = X12::Parser.new('271.xml')
|
87
|
-
@r = @parser.parse('271', @message)
|
86
|
+
@parser = X12::Parser.new('271.xml')
|
87
|
+
@r = @parser.parse('271', @message)
|
88
88
|
end
|
89
|
-
|
90
|
-
|
89
|
+
|
90
|
+
|
91
91
|
def teardown
|
92
92
|
#nothing
|
93
93
|
end
|
94
|
-
|
95
|
-
|
94
|
+
|
95
|
+
|
96
96
|
def test_header
|
97
97
|
assert_equal("00", @r.ISA.AuthorizationInformationQualifier)
|
98
|
-
assert_equal("
|
98
|
+
assert_equal(" ", @r.ISA.AuthorizationInformation)
|
99
99
|
assert_equal("00", @r.ISA.SecurityInformationQualifier)
|
100
|
-
assert_equal("
|
100
|
+
assert_equal(" ", @r.ISA.SecurityInformation)
|
101
101
|
assert_equal("ZZ", @r.ISA.InterchangeIdQualifier1)
|
102
|
-
assert_equal("6175910AAC21T
|
102
|
+
assert_equal("6175910AAC21T ", @r.ISA.InterchangeSenderId)
|
103
103
|
assert_equal("ZZ", @r.ISA.InterchangeIdQualifier2)
|
104
|
-
assert_equal("54503516A
|
104
|
+
assert_equal("54503516A ", @r.ISA.InterchangeReceiverId)
|
105
105
|
assert_equal("061130", @r.ISA.InterchangeDate)
|
106
106
|
assert_equal("1445", @r.ISA.InterchangeTime)
|
107
107
|
assert_equal("U", @r.ISA.InterchangeControlStandardsIdentifier)
|
@@ -110,7 +110,7 @@ IEA*1*309242122~"
|
|
110
110
|
assert_equal("0", @r.ISA.AcknowledgmentRequested)
|
111
111
|
assert_equal("T", @r.ISA.UsageIndicator)
|
112
112
|
assert_equal(":", @r.ISA.ComponentElementSeparator)
|
113
|
-
|
113
|
+
|
114
114
|
assert_equal("HB", @r.GS.FunctionalIdentifierCode)
|
115
115
|
assert_equal("617591011C21T", @r.GS.ApplicationSendersCode)
|
116
116
|
assert_equal("545035165", @r.GS.ApplicationReceiversCode)
|
@@ -119,31 +119,31 @@ IEA*1*309242122~"
|
|
119
119
|
assert_equal("309001", @r.GS.GroupControlNumber)
|
120
120
|
assert_equal("X", @r.GS.ResponsibleAgencyCode)
|
121
121
|
assert_equal("004010X092A1", @r.GS.VersionReleaseIndustryIdentifierCode)
|
122
|
-
|
122
|
+
|
123
123
|
assert_equal("271", @r.ST.TransactionSetIdentifierCode)
|
124
124
|
assert_equal("COMP1420", @r.ST.TransactionSetControlNumber)
|
125
125
|
end
|
126
|
-
|
127
|
-
|
126
|
+
|
127
|
+
|
128
128
|
def test_trailer
|
129
|
-
assert_equal("45", @r.SE.NumberOfIncludedSegments)
|
129
|
+
assert_equal("45", @r.SE.NumberOfIncludedSegments)
|
130
130
|
assert_equal("COMP1420", @r.SE.TransactionSetControlNumber)
|
131
131
|
assert_equal("1", @r.GE.NumberOfTransactionSetsIncluded)
|
132
132
|
assert_equal("309001", @r.GE.GroupControlNumber)
|
133
133
|
assert_equal("1", @r.IEA.NumberOfIncludedFunctionalGroups)
|
134
|
-
assert_equal("309242122", @r.IEA.InterchangeControlNumber)
|
134
|
+
assert_equal("309242122", @r.IEA.InterchangeControlNumber)
|
135
135
|
end
|
136
|
-
|
136
|
+
|
137
137
|
def test_each_loop
|
138
138
|
# each loop for Loops
|
139
139
|
# each loop for Segments
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
def test_various_fields
|
143
|
-
|
143
|
+
|
144
144
|
end
|
145
|
-
|
146
|
-
|
145
|
+
|
146
|
+
|
147
147
|
def test_timing
|
148
148
|
start = Time::now
|
149
149
|
X12::TEST_REPEAT.times do
|
@@ -153,6 +153,6 @@ IEA*1*309242122~"
|
|
153
153
|
puts sprintf("Parses per second, 271: %.2f, elapsed: %.1f", X12::TEST_REPEAT.to_f/(finish-start), finish-start)
|
154
154
|
end # test_timing
|
155
155
|
|
156
|
-
|
156
|
+
|
157
157
|
end
|
158
158
|
|
data/test/tc_parse_837p.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file is part of the X12Parser library that provides tools to
|
3
3
|
# manipulate X12 messages using Ruby native syntax.
|
4
4
|
#
|
5
|
-
# http://x12parser.rubyforge.org
|
6
|
-
#
|
5
|
+
# http://x12parser.rubyforge.org
|
6
|
+
#
|
7
7
|
# Copyright (C) 2012 P&D Technical Solutions, LLC.
|
8
8
|
#
|
9
9
|
# This library is free software; you can redistribute it and/or
|
@@ -25,51 +25,51 @@ require 'x12'
|
|
25
25
|
require 'test/unit'
|
26
26
|
|
27
27
|
class Test837pParse < Test::Unit::TestCase
|
28
|
-
|
29
|
-
def setup
|
28
|
+
|
29
|
+
def setup
|
30
30
|
@parser = X12::Parser.new('837p.xml')
|
31
31
|
@msg = []
|
32
32
|
|
33
|
-
# sample 5010 837p test message
|
34
|
-
@temporary = "ISA*00* *00* *ZZ*SENDERID
|
35
|
-
@msg << @temporary
|
33
|
+
# sample 5010 837p test message
|
34
|
+
@temporary = "ISA*00* *00* *ZZ*SENDERID *33*NAIC *090809*1130*U*00501*000000230*1*T*:~GS*HC*SENDERID*NAIC*20090809*1615*230*X* 005010X222A1~ST*837*999999999*005010X222A1~BHT*0019*00*CLMSIPTP1*20090809*1834*CH~NM1*41*2*NAVINET*****46*PFAMPCLM~PER*IC*PROVIDER NAME*TE*PROVIDER CONTACT INFORMATION~NM1*40*2*RECEIVER NAME*****46*RECEIVER PRIMARY ID NUMBER~HL*1**20*1~NM1*85*2*PROVIDER NAME*****XX*NPI NUMBER~N3*PROVIER ADDRESS~N4*PROVIDER CITY*STATE*ZIP~REF*EI*FEDERAL TAX ID~HL*2*1*22*0~SBR*P*18**000163*****BL~NM1*IL*1*SUBSCRIBER NAME*****MI*SUBSCRIBER ID~N3*SUBSCRIBER ADDRESS~N4*SUBSCRIBER CITY*STATE*ZIP CODE~DMG*D8*SUBSCRIBER DATE OF BIRTH*SUBSCRIBER SEX~NM1*PR*2*PAYER NAME*****PI*PAYER ID NUMBER~N3*PAYER ADDRESS~N4*PAYER CITY*STATE*ZIP*COUNTRY~REF*G2*LEGACY NUMBER~CLM*PATIENT ACCOUNT NUMBER*195***11::1*Y*A*Y*Y*C******P~DTP*454*D8*20090701~NM1*82*2*RENDERING PROVIDER NAME*****XX*NPI NUMBER~PRV*PE*ZZ*207RC0000X~REF*G2*LEGACY NUMBER~LX*1~SV1*HC:92135*100*UN*1*****Y~DTP*472*D8*20090729~LX*2~SV1*HC:59840:LT*50*UN*1*****Y~DTP*472*D8*20090729~LX*3~SV1*HC:92012*45*UN*1*****Y~DTP*472*D8*20090729~SE*38*999999999~GE*1*230~IEA*1*000000230~"
|
35
|
+
@msg << @temporary
|
36
36
|
# 2 payors in test message
|
37
37
|
@temporary = "ISA*00**00**ZZ*000009340000000*ZZ*000000010000000*100423*1740*^*00501*000000181*0*P*:~GS*HC*00000934*00000001*20100423*1740*181*X*005010X222A1~ST*837*0001*005010X222A1~BHT*0019*00*181*20100423*1740*CH~NM1*41*2*EDI BILLING*****46*00000934~PER*IC*BILLER NAME*TE*2135559999~NM1*40*2*LAC DEPARTMENT OF MENTAL HEALTH*****46*00000001~HL*1**20*1~NM1*85*2*PROVIDER NAME*****XX*1477632479~N3*146 WESTWOOD BLVD~N4*LOS ANGELES*CA*900059876~REF*EI*959999346~HL*2*1*22*0~SBR*S*18**1001*****11~NM1*IL*1*DOE*JOHN****MI*9998211~N3*15 BEFORD~N4*LOS ANGELES*CA*900359876~DMG*D8*19900923*F~NM1*PR*2*LAC DEPARTMENT OF MENTAL HEALTH*****PI*953893470~REF*FY*123100~CLM*0000181*150***12:B:1*Y*A*Y*Y*P~REF*G1*89194428225~HI*BK:30002~NM1*82*1*RENDERING*JOHN****XX*1518169325~PRV*PE*PXC*2084P0800X~SBR*P*18*******MC~OI***Y*P**Y~NM1*IL*1*DOE*JOHN****MI*99929939C~N3*15 BEFORD~N4*LOS ANGELES*CA*900359876~NM1*PR*2*MEDI-CAL*****PI*01~LX*1~SV1*HC:90847*150*UN*60***1~DTP*472*D8*20100403~SE*33*0001~GE*1*181~IEA*1*000000181~"
|
38
|
-
@msg << @temporary
|
39
|
-
|
40
|
-
@r = @parser.parse('837p', @msg[0])
|
38
|
+
@msg << @temporary
|
39
|
+
|
40
|
+
@r = @parser.parse('837p', @msg[0])
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def teardown
|
44
44
|
#nothing
|
45
45
|
end
|
46
|
-
|
47
|
-
|
46
|
+
|
47
|
+
|
48
48
|
def test_ISA_IEA
|
49
|
-
assert_equal('ISA*00* *00* *ZZ*SENDERID
|
50
|
-
assert_equal('SENDERID
|
49
|
+
assert_equal('ISA*00* *00* *ZZ*SENDERID *33*NAIC *090809*1130*U*00501*000000230*1*T*:~', @r.ISA.to_s)
|
50
|
+
assert_equal('SENDERID ', @r.ISA.InterchangeSenderId)
|
51
51
|
assert_equal('1', @r.IEA.NumberOfIncludedFunctionalGroups)
|
52
52
|
end # test_ST
|
53
|
-
|
54
|
-
|
53
|
+
|
54
|
+
|
55
55
|
def test_loops
|
56
56
|
assert_equal("NAVINET", @r.L837.L1000A.NM1.NameLastOrOrganizationName.to_s)
|
57
57
|
assert_equal("PROVIDER NAME", @r.L837.L2010AA.NM1.NameLastOrOrganizationName.to_s)
|
58
58
|
assert_equal("SUBSCRIBER NAME", @r.L837.L2010BA.NM1.NameLastOrOrganizationName.to_s)
|
59
59
|
assert_equal("SUBSCRIBER ID", @r.L837.L2010BA.NM1.IdentificationCode.to_s)
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
def test_claims
|
63
63
|
assert_equal("CLM*PATIENT ACCOUNT NUMBER*195***11::1*Y*A*Y*Y*C******P~",@r.L837.L2300.CLM.to_s)
|
64
64
|
assert_equal("DTP*454*D8*20090701~", @r.L837.L2300.DTP[0].to_s)
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
def test_service_line
|
68
68
|
assert_equal("LX*1~",@r.L837.L2400[0].LX.to_s)
|
69
69
|
assert_equal("LX*2~",@r.L837.L2400[1].LX.to_s)
|
70
70
|
assert_equal("LX*3~",@r.L837.L2400[2].LX.to_s)
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def test_timing
|
74
74
|
start = Time::now
|
75
75
|
X12::TEST_REPEAT.times do
|
data/x12.gemspec
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path('../lib/x12/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = "pd_x12"
|
6
6
|
gem.version = X12::VERSION
|
7
|
-
gem.authors = ["App Design, Inc.", "Sean Walberg", "Marty Petersen"]
|
7
|
+
gem.authors = ["App Design, Inc.", "Sean Walberg", "Marty Petersen", "William Bajzek"]
|
8
8
|
gem.email = ["info@appdesign.com", "sean@ertw.com", "themooseman@comcast.net"]
|
9
9
|
gem.description = %q{A gem to handle parsing and generation of ANSI X12 documents. Currently tested with Ruby >= 1.9.2. Gem supports X12 EDI transactions 270, 997, 837p and 835. Anyone wanting to create additional XML files for other transactions welcomed. }
|
10
10
|
gem.summary = %q{A gem to handle parsing and generation of ANSI X12 documents}
|
metadata
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pd_x12
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- App Design, Inc.
|
8
9
|
- Sean Walberg
|
9
10
|
- Marty Petersen
|
11
|
+
- William Bajzek
|
10
12
|
autorequire:
|
11
13
|
bindir: bin
|
12
14
|
cert_chain: []
|
13
|
-
date: 2013-
|
15
|
+
date: 2013-04-15 00:00:00.000000000 Z
|
14
16
|
dependencies: []
|
15
17
|
description: ! 'A gem to handle parsing and generation of ANSI X12 documents. Currently
|
16
18
|
tested with Ruby >= 1.9.2. Gem supports X12 EDI transactions 270, 997, 837p and
|
@@ -1881,26 +1883,27 @@ files:
|
|
1881
1883
|
homepage: https://github.com/mjpete3/x12
|
1882
1884
|
licenses:
|
1883
1885
|
- GPL-2
|
1884
|
-
metadata: {}
|
1885
1886
|
post_install_message:
|
1886
1887
|
rdoc_options: []
|
1887
1888
|
require_paths:
|
1888
1889
|
- lib
|
1889
1890
|
required_ruby_version: !ruby/object:Gem::Requirement
|
1891
|
+
none: false
|
1890
1892
|
requirements:
|
1891
1893
|
- - ! '>='
|
1892
1894
|
- !ruby/object:Gem::Version
|
1893
1895
|
version: '0'
|
1894
1896
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1897
|
+
none: false
|
1895
1898
|
requirements:
|
1896
1899
|
- - ! '>='
|
1897
1900
|
- !ruby/object:Gem::Version
|
1898
1901
|
version: '0'
|
1899
1902
|
requirements: []
|
1900
1903
|
rubyforge_project:
|
1901
|
-
rubygems_version:
|
1904
|
+
rubygems_version: 1.8.24
|
1902
1905
|
signing_key:
|
1903
|
-
specification_version:
|
1906
|
+
specification_version: 3
|
1904
1907
|
summary: A gem to handle parsing and generation of ANSI X12 documents
|
1905
1908
|
test_files:
|
1906
1909
|
- test/tc_factory_270.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
ZGYwMjJhMzE3ZTllNDU4MzI5N2NlZDhhYjY5MDE1ZGUzNmU4YWMzMQ==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MjlhMWRiMDgyZmRhMWMzOTlhZWEzNmQwZmI3NjhhZTc0ZmI1NjRiMQ==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NWJmY2IxY2MxZjJjY2Q4OTdmYjk3YWYzNTE2YzJhMDkwMWFkZDM4MTNiZmEx
|
10
|
-
YzA2MjMzNmQwNjVhNjY4YzRhNjk1MmI0ZjJjMzY3NGRiMTdlN2M1ODY1MGE0
|
11
|
-
NTc1ZWEyOWU1MjlhYTc1OWIxMWRjMjQyNGVlYzQxODg0OTIyMDY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YmIyNjVmNmVmYzU0YjA0MTg2ZGIxMDVlODMyMjhmOTY0MWM2OGE4ZWM3Yjgx
|
14
|
-
OGJjNDRkYjMwYjQ1YzUxMWIxZWE1YjYxMDMxOThjNjU5YzNhYjU5YThhM2Q3
|
15
|
-
NDVjZGQ5MTZhOTkzZTA5NjYxNDNiYTI2YjA1MDQ4MDZmMzk1MzQ=
|