Comments (4)
@kputnam I have tried the last two days to recreate the guide and transaction set definition for message RA820
as out of the messages I have implemented the one that appears to not be behaving correctly (the parsing that is). If I follow the implementation details as per the guide I get non deterministic and edi-pp
never returns even with -N
so I have end up back where I started.
When originally implementing this message we were getting a lot of NonDeterministic errors and you suggested collapsing some loops. This worked in the sense edi-pp
is able to parse the message correctly. But somehow when I traverse the tree I get odd results. My main concern is getting the N1 LI
segments in order that are associated with N1 HH
segment
from stupidedi.
Can you email me a sample document and tell me which branch you're working in? I have a vague understanding of the problem but not enough to troubleshoot.
from stupidedi.
PS: In your example you're looping over ST
segments, but in the body of the loop you are discarding the "current" ST
segment and re-finding the first ST
after GS
each time. Instead of gs.find(:ST)
should you be referring to st
instead?
from stupidedi.
This example seems unusual to me, so let me know if I've misunderstood. Here's my translation:
First, start at GS
and then find ST
, from here find LS*A
. From LS*A
, loop over each N1*HH
occurrence, call it n1
, and print out it's second element. Then from this n1
find the _next_ N1*HH
called x
, and from here find the next occurrence of RMT*IV
.
Print the RMT
segment's second and third element and start the loop over. When the loop starts again, it will find the N1*HH
segment we previously called x
, but it will be known as n1
in this iteration.
gs.find(:ST).flatmap{|x| x.find(:LS,'A') }
.tap do |ls|
ls.iterate(:N1, 'HH') do |n1|
puts "N1 HH #{n1.element(2).map(&:node).fetch(0)}"
n1.find(:N1, 'HH').flatmap{|x| x.find(:RMT,'IV') }
.tap do |rmt|
@seller_invoice_number = "#{rmt.element(2).map(&:node).fetch(0)}"
@total_gross_amount = "#{rmt.element(3).map(&:node).fetch(0)}"
puts "RMT IV [$#{@total_gross_amount}] #{@seller_invoice_number}"
puts "==========================="
end
I suspect you have one too many traversals, and n1.find(:N1, 'HH').flatmap{|x| x.find(:RMT, 'IV' }
should be instead n1.find(:RMT, 'IV')
, but I might be mistaken.
from stupidedi.
Related Issues (20)
- iterating over files with multiple ISAs HOT 3
- Doesn't handle arbitrarily large input files, and never will be able to HOT 5
- Duplicate Keys HOT 3
- Unknown patient gender in 270 causes validation error HOT 2
- value PR is not allowed in element NM101 HOT 2
- Segment ST Does not occur HOT 2
- Parse EDI 850 ERROR HOT 1
- Accept Tempfile in Stupidedi::Reader.build HOT 1
- Segment N1*PR~ cannot be reached
- Parsing an 837 and grabbing segment values HOT 2
- Is there a way to skip validations and build without some of the segments HOT 2
- 004010 version - B3-07 precision doesn't work as intended HOT 2
- value 091 is not allowed in element DTM01 Date/Time Qualifier HOT 2
- TD1 for X12 Release 4010 gets reduced to 2 fields instead of 10 for no reason HOT 1
- 835 - 005010X221A1 - NTE segment error HOT 2
- Stream writing HOT 2
- help wanted: Only the first element is return when iterating a repeated element HOT 2
- Inconsistent floating point output in 834 ICM data HOT 9
- Adding the additional accepted values for a segement HOT 1
- File permissions issue on v1.4.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stupidedi.