Skip to content

Commit

Permalink
Regression on the handling of the bounded loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinJSoles committed Feb 15, 2022
1 parent 0749360 commit cccf330
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 37 deletions.
4 changes: 3 additions & 1 deletion Madjic.Edi.Dom.Tests/TestBasicFileParsing.vb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ Public Class TestBasicFileParsing
Doc = Await Document.FromStreamAsync(stream)
End Using

Debug.WriteLine("Document read from stream.")

Dim RawTS = Doc.Envelopes(0).FunctionalGroups(0).Transactions(0)
Dim Imp = TryCast(RawTS, Transactions.Transaction271.Transaction271_B1.TransactionSet)

Expand All @@ -214,7 +216,7 @@ Public Class TestBasicFileParsing
End If

If lp3.PER IsNot Nothing AndAlso lp3.PER.Count > 0 Then
Debug.WriteLine("PER03 = " * lp3.PER.First().PER03)
Debug.WriteLine("PER03 = " & lp3.PER.First().PER03)
Else
Debug.WriteLine("(no PER)")
End If
Expand Down
4 changes: 2 additions & 2 deletions Madjic.Edi.Dom/Madjic.Edi.Dom.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<RepositoryUrl>https://github.com/MartinJSoles/Madjic.Edi</RepositoryUrl>
<PackageTags>HIPAA, EDI, ANSI X12</PackageTags>
<PackageReleaseNotes>This version is adding minimal support to indicate when a transaction set failed to parse correctly. To do this, an extra readonly property `HasReaderErrors` has been added to the base TransactionSet object.</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>2.1.0-alpha.2</Version>
<Version>2.1.0</Version>
<AssemblyVersion>2.0.1.0</AssemblyVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1546,38 +1546,18 @@
New ReaderState(17, "LS", ReadAction.PopulateSegmentAndStartBoundedLoop, 22, False),
New ReaderState(18, "LS", ReadAction.PopulateSegmentAndStartBoundedLoop, 22, False),
New ReaderState(20, "LS", ReadAction.PopulateSegmentAndStartBoundedLoop, 22, False),
New ReaderState(1, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(2, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(4, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(6, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(8, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(10, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(11, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(12, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(13, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(14, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(15, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(16, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(17, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(18, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(20, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "N2", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "N3", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "N4", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "PER", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "PRV", ReadAction.PopulateLoop, 23, False),
New ReaderState(23, "NM1", ReadAction.PopulateLoop, 23, False),
New ReaderState(1, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(2, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(4, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(6, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(8, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(10, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(11, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(12, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(13, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(14, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(15, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(16, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(17, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(18, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(20, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(23, "N2", ReadAction.PopulateLoop, 23, False),
New ReaderState(23, "N3", ReadAction.PopulateLoop, 23, False),
New ReaderState(23, "N4", ReadAction.PopulateLoop, 23, False),
New ReaderState(23, "PER", ReadAction.PopulateLoop, 23, False),
New ReaderState(23, "PRV", ReadAction.PopulateLoop, 23, False),
New ReaderState(22, "LE", ReadAction.PopulateSegment, 25, False),
New ReaderState(23, "LE", ReadAction.PopulateSegment, 25, False)})

Expand Down Expand Up @@ -1720,16 +1700,23 @@
Else
Await NewLoop.ReadAsync(args).ConfigureAwait(False)
End If
ElseIf String.Compare(args.DataSegment.SegmentID, "NM1", StringComparison.OrdinalIgnoreCase) = 0 Then
ElseIf String.Compare(args.DataSegment.SegmentID, "NM1", StringComparison.OrdinalIgnoreCase) = 0 OrElse
String.Compare(args.DataSegment.SegmentID, "N2", StringComparison.OrdinalIgnoreCase) = 0 OrElse
String.Compare(args.DataSegment.SegmentID, "N3", StringComparison.OrdinalIgnoreCase) = 0 OrElse
String.Compare(args.DataSegment.SegmentID, "N4", StringComparison.OrdinalIgnoreCase) = 0 OrElse
String.Compare(args.DataSegment.SegmentID, "PER", StringComparison.OrdinalIgnoreCase) = 0 OrElse
String.Compare(args.DataSegment.SegmentID, "PRV", StringComparison.OrdinalIgnoreCase) = 0 Then
Dim NewLoop As LoopBase = New Madjic.Edi.Dom.Transactions.Transaction271.Loop2120_Obj
Dim LoopKey As String = args.DataSegment.ToStringValue(0)
Loop2120_Obj.Add(NewLoop)
If MyBase.CompareKey(LoopKey, ";13;1I;1P;2B;36;73;FA;GP;GW;I3;IL;LR;OC;P3;P4;P5;PR;PRP;SEP;TTP;VER;VN;VY;X3;Y2;") AndAlso String.Compare(args.Implementation, "_271B1__2000C__2100C__2110C", StringComparison.OrdinalIgnoreCase) = 0 Then
'If MyBase.CompareKey(LoopKey, ";13;1I;1P;2B;36;73;FA;GP;GW;I3;IL;LR;OC;P3;P4;P5;PR;PRP;SEP;TTP;VER;VN;VY;X3;Y2;") AndAlso String.Compare(args.Implementation, "_271B1__2000C__2100C__2110C", StringComparison.OrdinalIgnoreCase) = 0 Then
If String.Compare(args.Implementation, "_271B1__2000C__2100C__2110C", StringComparison.OrdinalIgnoreCase) = 0 Then
args.Implementation = "_271B1__2000C__2100C__2110C__2120C"
NewLoop.SetArea = "4"
NewLoop.SetSequence = "1800"
Await NewLoop.ReadAsync(args).ConfigureAwait(False)
ElseIf MyBase.CompareKey(LoopKey, ";13;1I;1P;2B;36;73;FA;GP;GW;I3;IL;LR;OC;P3;P4;P5;PR;PRP;SEP;TTP;VER;VN;VY;X3;Y2;") AndAlso String.Compare(args.Implementation, "_271B1__2000D__2100D__2110D", StringComparison.OrdinalIgnoreCase) = 0 Then
'ElseIf MyBase.CompareKey(LoopKey, ";13;1I;1P;2B;36;73;FA;GP;GW;I3;IL;LR;OC;P3;P4;P5;PR;PRP;SEP;TTP;VER;VN;VY;X3;Y2;") AndAlso String.Compare(args.Implementation, "_271B1__2000D__2100D__2110D", StringComparison.OrdinalIgnoreCase) = 0 Then
ElseIf String.Compare(args.Implementation, "_271B1__2000D__2100D__2110D", StringComparison.OrdinalIgnoreCase) = 0 Then
args.Implementation = "_271B1__2000D__2100D__2110D__2120D"
NewLoop.SetArea = "5"
NewLoop.SetSequence = "1800"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ I need to add conveniences that set required fields when instantiating segments

## History

#### V2.1.0 (pre-release)
#### V2.1.0
* This release includes very basic validation when reading a transaction set. After parsing is complete, the `HasReaderErrors` property on the base `TransactionSet` object.
* Fixes an issue with writing a new document. When trying to write a document to a stream, performing the FlushAsync operation was throwing an error.

Expand Down

0 comments on commit cccf330

Please sign in to comment.