PD_x12 1.3.2 → 1.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
 
5
5
  http://x12parser.rubyforge.org
6
6
 
7
- Copyright (C) 2009 APP Design, Inc.
7
+ Copyright (C) 2012 P & D Technology Solutions, LLC.
8
8
 
9
9
  This library is free software; you can redistribute it and/or
10
10
  modify it under the terms of the GNU Lesser General Public
@@ -19,8 +19,7 @@
19
19
  You should have received a copy of the GNU Lesser General Public
20
20
  License along with this library; if not, write to the Free Software
21
21
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
-
23
- $Id: T723.xml 78 2009-05-12 22:27:26Z ikk $
22
+
24
23
  -->
25
24
 
26
25
  <Table name="T723">
@@ -36,4 +35,10 @@
36
35
  <Entry name="10" value="Exclusion Condition Violated"/>
37
36
  <Entry name="12" value="Too Many Repetitions"/>
38
37
  <Entry name="13" value="Too Many Components"/>
38
+ <Entry name="I6" value="Code value not used in Implementation"/>
39
+ <Entry name="I9" value="Implememtation dependent data element missing"/>
40
+ <Entry name="I10" value="Implementation 'not used' data element present"/>
41
+ <Entry name="I11" value="Implementation too few repetitions"/>
42
+ <Entry name="I12" value="Implementation pattern match failure"/>
43
+ <Entry name="I13" value="Implementation dependent 'not used' data element present"/>
39
44
  </Table>
@@ -0,0 +1,77 @@
1
+ #--
2
+ # This file is part of the X12Parser library that provides tools to
3
+ # manipulate X12 messages using Ruby native syntax.
4
+ #
5
+ # http://x12parser.rubyforge.org
6
+ #
7
+ # Copyright (C) 2012 P&D Technical Solutions, LLC.
8
+ #
9
+ # This library is free software; you can redistribute it and/or
10
+ # modify it under the terms of the GNU Lesser General Public
11
+ # License as published by the Free Software Foundation; either
12
+ # version 2.1 of the License, or (at your option) any later version.
13
+ #
14
+ # This library is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ # Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public
20
+ # License along with this library; if not, write to the Free Software
21
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+ #++
23
+ #
24
+ require 'x12'
25
+ require 'test/unit'
26
+
27
+ class Test999Parse < Test::Unit::TestCase
28
+
29
+ def setup
30
+ @parser = X12::Parser.new('999.xml')
31
+ @msg =[]
32
+ @msg.push "ISA*00* *00* *27*PPPPPP *27*XXXXXX *100914*1025*^*00501*000000218*0*T*:~GS*FA*PPPPPP*XXXXXX*20100914*10251463*3*X*005010X231A1~ST*999*3001*005010X231A1~AK1*HC*2145001*005010X222A1~AK2*837*000000001*005010X222A1~IK5*A~AK9*A*1*1*1~SE*6*3001~GE*1*3~IEA*1*000000218~"
33
+ @msg.push "ISA*00* *00* *ZZ*123456789 *ZZ*987654321 *041117*1024*^*00501*000000286*0*P*:~GS*FA*RCVR*SNDR*20041117*1024*287*X*005010X231~ST*999*2870001*005010X231~AK1*HC*17456*004010X098A1~AK2*837*0001~IK5*A~AK2*837*0002~IK3*CLM*22**8~CTX*CLM01:123456789~IK4*2*782*1~IK5*R*5~AK2*837*0003~IK3*REF*57**3~CTX*SITUATIONAL TRIGGER*CLM*43**5:3*C023:1325~CTX*CLM01:987654321~IK5*R*5~AK9*P*3*3*1~SE*16*2870001~GE*1*287~IEA*1*000000286~"
34
+ end
35
+
36
+ def teardown
37
+ #nothing
38
+ end
39
+
40
+ #parse a simple accepted message
41
+ def test_simple
42
+ @r = @parser.parse('999', @msg[0])
43
+
44
+ assert_equal(@r.GS.ApplicationSendersCode, "PPPPPP")
45
+ assert_equal(@r.GS.ApplicationReceiversCode, "XXXXXX")
46
+
47
+ @r.L1000 {|a|
48
+ assert_equal(a.AK2.TransactionSetIdentifierCode, "837")
49
+ assert_equal(a.AK2.TransactionSetControlNumber, "000000001")
50
+ assert_equal(a.AK2.ImplementationConventionReference, "005010X222A1")
51
+
52
+ assert_equal(a.IK5.TransactionSetAcknowledgmentCode, "A")
53
+ }
54
+ end
55
+
56
+
57
+ #parse a multiple transaction with 1 accepted and 2 rejected claims
58
+ def test_all
59
+ @r = @parser.parse('999', @msg[1])
60
+
61
+
62
+ assert_equal(3, @r.L1000.size)
63
+ assert_equal("A", @r.L1000[0].IK5.TransactionSetAcknowledgmentCode)
64
+ assert_equal("R", @r.L1000[1].IK5.TransactionSetAcknowledgmentCode)
65
+ assert_equal("R", @r.L1000[2].IK5.TransactionSetAcknowledgmentCode)
66
+ end
67
+
68
+ def test_timing
69
+ start = Time::now
70
+ X12::TEST_REPEAT.times do
71
+ @r = @parser.parse('999', @msg[1])
72
+ end
73
+ finish = Time::now
74
+ puts sprintf("Parses per second, 999: %.2f, elapsed: %.1f", X12::TEST_REPEAT.to_f/(finish-start), finish-start)
75
+ end # test_timing
76
+
77
+ end
@@ -118,7 +118,7 @@ EOT
118
118
  @@p = @@parser.parse('270interchange', @@m)
119
119
  end
120
120
  @r = @@p
121
- # @@p.show
121
+ #@@p.show
122
122
 
123
123
  end # setup
124
124
 
@@ -37,7 +37,7 @@ class Test837pParse < Test::Unit::TestCase
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
38
  @msg << @temporary
39
39
 
40
- @r = @parser.parse('837p', @msg[0])
40
+ @r = @parser.parse('837p', @msg[0])
41
41
  end
42
42
 
43
43
  def teardown
@@ -76,6 +76,7 @@ EOT
76
76
 
77
77
  @@p = @@parser.parse('997', @@m997)
78
78
  end
79
+ #@@p.show
79
80
  @r = @@p
80
81
  end # setup
81
82
 
@@ -47,7 +47,7 @@ N3*P O BOX 12312~
47
47
  N4*DURHAM*NC*27715~
48
48
  DMG*D8*19670807*F~
49
49
  NM1*PR*2*BCBSNC*****PI*987654321~
50
- CLM*PTACCT2235057*100.5***11::1*Y*A*Y*N**********~
50
+ CLM*PTACCT2235057*100.5***11::1*Y*A*Y*N~
51
51
  REF*EA*MEDREC11111~
52
52
  HI*BK:78901~
53
53
  LX*1~
@@ -28,6 +28,8 @@ class Test997Factory < Test::Unit::TestCase
28
28
 
29
29
  @@p = nil
30
30
  tmp=<<-EOT
31
+ ISA****************~
32
+ GS********~
31
33
  ST*997*2878~
32
34
  AK1*HS*293328532~
33
35
  AK2*270*~
@@ -42,6 +44,8 @@ AK4*1**1~
42
44
  AK5*E****999~
43
45
  AK9****~
44
46
  SE**~
47
+ GE**~
48
+ IEA**~
45
49
  EOT
46
50
 
47
51
  @@result = tmp.gsub!(/\n/,'')
@@ -0,0 +1,128 @@
1
+ #--
2
+ # This file is part of the X12Parser library that provides tools to
3
+ # manipulate X12 messages using Ruby native syntax.
4
+ #
5
+ # http://x12parser.rubyforge.org
6
+ #
7
+ # Copyright (C) 2012 P&D Technical Solutions, LLC.
8
+ #
9
+ # This library is free software; you can redistribute it and/or
10
+ # modify it under the terms of the GNU Lesser General Public
11
+ # License as published by the Free Software Foundation; either
12
+ # version 2.1 of the License, or (at your option) any later version.
13
+ #
14
+ # This library is distributed in the hope that it will be useful,
15
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ # Lesser General Public License for more details.
18
+ #
19
+ # You should have received a copy of the GNU Lesser General Public
20
+ # License along with this library; if not, write to the Free Software
21
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+ #++
23
+ #
24
+ require 'x12'
25
+ require 'test/unit'
26
+
27
+ class Test999Factory < Test::Unit::TestCase
28
+
29
+ def setup
30
+ @parser = X12::Parser.new('999.xml')
31
+ @msg = "ISA*00* *00* *27*PPPPPP *27*XXXXXX *100914*1025*^*00501*000000218*0*T*:~GS*FA*PPPPPP*XXXXXX*20100914*10251463*3*X*005010X231A1~ST*999*3001*005010X231A1~AK1*HC*2145001*005010X222A1~AK2*837*000000001*005010X222A1~IK5*A~AK9*A*1*1*1~SE*6*3001~GE*1*3~IEA*1*000000218~"
32
+ end
33
+
34
+ def teardown
35
+ #nothing
36
+ end
37
+
38
+ def set_header(r)
39
+ r.ISA.AuthorizationInformationQualifier = "00"
40
+ r.ISA.AuthorizationInformation = " "
41
+ r.ISA.SecurityInformationQualifier = "00"
42
+ r.ISA.SecurityInformation = " "
43
+ r.ISA.InterchangeIdQualifier1 = "27"
44
+ r.ISA.InterchangeSenderId = "PPPPPP "
45
+ r.ISA.InterchangeIdQualifier2 = "27"
46
+ r.ISA.InterchangeReceiverId = "XXXXXX "
47
+ r.ISA.InterchangeDate = "100914"
48
+ r.ISA.InterchangeTime = "1025"
49
+ r.ISA.InterchangeControlStandardsIdentifier = "^"
50
+ r.ISA.InterchangeControlVersionNumber = "00501"
51
+ r.ISA.InterchangeControlNumber = "000000218"
52
+ r.ISA.AcknowledgmentRequested = "0"
53
+ r.ISA.UsageIndicator = "T"
54
+ r.ISA.ComponentElementSeparator = ":"
55
+
56
+ r.GS.FunctionalIdentifierCode = "FA"
57
+ r.GS.ApplicationSendersCode = "PPPPPP"
58
+ r.GS.ApplicationReceiversCode = "XXXXXX"
59
+ r.GS.Date = "20100914"
60
+ r.GS.Time = "10251463"
61
+ r.GS.GroupControlNumber = "3"
62
+ r.GS.ResponsibleAgencyCode = "X"
63
+ r.GS.VersionReleaseIndustryIdentifierCode = "005010X231A1"
64
+
65
+ r.ST.TransactionSetIdentifierCode = 999
66
+ r.ST.TransactionSetControlNumber = '3001'
67
+ r.ST.ImplementationConventionReference = "005010X231A1"
68
+ return r
69
+ end
70
+
71
+ def set_trailer(r, count)
72
+ r.SE.NumberOfIncludedSegments = count
73
+ r.SE.TransactionSetControlNumber = "3001"
74
+
75
+ r.GE.NumberOfTransactionSetsIncluded = "1"
76
+ r.GE.GroupControlNumber = "3"
77
+
78
+ r.IEA.NumberOfIncludedFunctionalGroups = "1"
79
+ r.IEA.InterchangeControlNumber = "000000218"
80
+ return r
81
+ end
82
+
83
+ def test_all
84
+ @r = @parser.factory('999')
85
+ @r = set_header(@r)
86
+ #count both the ST and SE segments
87
+ @seg_count = 2
88
+
89
+ @r.AK1 {|a|
90
+ a.FunctionalIdentifierCode = "HC"
91
+ a.GroupControlNumber = "2145001"
92
+ a.VersionReleaseIndustryIdentifierCode = "005010X222A1"
93
+ }
94
+ @seg_count += 1
95
+
96
+ @r.L1000 {|a|
97
+ a.AK2.TransactionSetIdentifierCode = "837"
98
+ a.AK2.TransactionSetControlNumber = "000000001"
99
+ a.AK2.ImplementationConventionReference = "005010X222A1"
100
+ @seg_count += 1
101
+ a.IK5.TransactionSetAcknowledgmentCode = "A"
102
+ @seg_count += 1
103
+ }
104
+
105
+ @r.AK9 {|a|
106
+ a.FunctionalGroupAcknowledgeCode = "A"
107
+ a.NumberOfTransactionSetsIncluded = "1"
108
+ a.NumberOfReceivedTransactionSets = "1"
109
+ a.NumberOfAcceptedTransactionSets = "1"
110
+ }
111
+ @seg_count += 1
112
+
113
+ @r = set_trailer(@r, @seg_count)
114
+
115
+ assert_equal(@msg, @r.render)
116
+ end
117
+
118
+ def test_timing
119
+ start = Time::now
120
+ X12::TEST_REPEAT.times do
121
+ test_all
122
+ end
123
+ finish = Time::now
124
+ puts sprintf("Factories per second, 999: %.2f, elapsed: %.1f", X12::TEST_REPEAT.to_f/(finish-start), finish-start)
125
+ end # test_timing
126
+
127
+
128
+ end
@@ -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
@@ -43,7 +43,6 @@ class Test835Parse < Test::Unit::TestCase
43
43
  def test_ISA_IEA
44
44
  assert_equal('ISA*00* *00* *ZZ*5010TEST *ZZ*835RECVR *110930*1105*^*00501*000004592*0*T*:~', @r.ISA.to_s)
45
45
  assert_equal('5010TEST ', @r.ISA.InterchangeSenderId)
46
- puts @r.IEA.to_s
47
46
  assert_equal('1', @r.IEA.NumberOfIncludedFunctionalGroups)
48
47
  end # test_ST
49
48
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PD_x12
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-12-02 00:00:00.000000000 Z
14
+ date: 2013-01-26 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: ! 'A gem to handle parsing and generation of ANSI X12 documents. Currently
17
17
  tested with Ruby >= 1.9.2. Gem supports X12 EDI transactions 270, 997, 837p and
@@ -32,6 +32,7 @@ files:
32
32
  - Rakefile
33
33
  - example/factory.rb
34
34
  - example/parse.rb
35
+ - init.rb
35
36
  - lib/x12.rb
36
37
  - lib/x12/base.rb
37
38
  - lib/x12/composite.rb
@@ -49,6 +50,7 @@ files:
49
50
  - misc/837p.xml
50
51
  - misc/997.xml
51
52
  - misc/997single.xml
53
+ - misc/999.xml
52
54
  - misc/AAA.xml
53
55
  - misc/ACD.xml
54
56
  - misc/ACK.xml
@@ -236,6 +238,8 @@ files:
236
238
  - misc/C4.xml
237
239
  - misc/C8.xml
238
240
  - misc/C8C.xml
241
+ - misc/C998.xml
242
+ - misc/C999.xml
239
243
  - misc/CA1.xml
240
244
  - misc/CAD.xml
241
245
  - misc/CAI.xml
@@ -312,6 +316,7 @@ files:
312
316
  - misc/CTC.xml
313
317
  - misc/CTP.xml
314
318
  - misc/CTT.xml
319
+ - misc/CTX.xml
315
320
  - misc/CUR.xml
316
321
  - misc/CV.xml
317
322
  - misc/CYC.xml
@@ -541,6 +546,9 @@ files:
541
546
  - misc/IGI.xml
542
547
  - misc/III.xml
543
548
  - misc/IIS.xml
549
+ - misc/IK3.xml
550
+ - misc/IK4.xml
551
+ - misc/IK5.xml
544
552
  - misc/IM.xml
545
553
  - misc/IMA.xml
546
554
  - misc/IMM.xml
@@ -1523,6 +1531,9 @@ files:
1523
1531
  - misc/T612.xml
1524
1532
  - misc/T615.xml
1525
1533
  - misc/T617.xml
1534
+ - misc/T618.xml
1535
+ - misc/T620.xml
1536
+ - misc/T621.xml
1526
1537
  - misc/T623.xml
1527
1538
  - misc/T625.xml
1528
1539
  - misc/T626.xml
@@ -1851,15 +1862,17 @@ files:
1851
1862
  - misc/ZR.xml
1852
1863
  - misc/ZT.xml
1853
1864
  - misc/rdoc_template.rb
1854
- - test/tc_factory_270.rb
1855
- - test/tc_factory_270interchange.rb
1856
- - test/tc_factory_837p.rb
1857
- - test/tc_factory_997.rb
1858
- - test/tc_parse_270.rb
1859
- - test/tc_parse_270interchange.rb
1860
- - test/tc_parse_835.rb
1861
- - test/tc_parse_837p.rb
1862
- - test/tc_parse_997.rb
1865
+ - test/tc_parse_999.rb
1866
+ - test/xc_parse_270interchange.rb
1867
+ - test/xc_parse_837p.rb
1868
+ - test/xc_parse_997.rb
1869
+ - test/xtc_factory_270.rb
1870
+ - test/xtc_factory_270interchange.rb
1871
+ - test/xtc_factory_837p.rb
1872
+ - test/xtc_factory_997.rb
1873
+ - test/xtc_factory_999.rb
1874
+ - test/xtc_parse_270.rb
1875
+ - test/xtc_parse_835.rb
1863
1876
  - x12.gemspec
1864
1877
  homepage: https://github.com/mjpete3/x12
1865
1878
  licenses:
@@ -1887,12 +1900,14 @@ signing_key:
1887
1900
  specification_version: 3
1888
1901
  summary: A gem to handle parsing and generation of ANSI X12 documents
1889
1902
  test_files:
1890
- - test/tc_factory_270.rb
1891
- - test/tc_factory_270interchange.rb
1892
- - test/tc_factory_837p.rb
1893
- - test/tc_factory_997.rb
1894
- - test/tc_parse_270.rb
1895
- - test/tc_parse_270interchange.rb
1896
- - test/tc_parse_835.rb
1897
- - test/tc_parse_837p.rb
1898
- - test/tc_parse_997.rb
1903
+ - test/tc_parse_999.rb
1904
+ - test/xc_parse_270interchange.rb
1905
+ - test/xc_parse_837p.rb
1906
+ - test/xc_parse_997.rb
1907
+ - test/xtc_factory_270.rb
1908
+ - test/xtc_factory_270interchange.rb
1909
+ - test/xtc_factory_837p.rb
1910
+ - test/xtc_factory_997.rb
1911
+ - test/xtc_factory_999.rb
1912
+ - test/xtc_parse_270.rb
1913
+ - test/xtc_parse_835.rb