Comments (10)
I can get around this issue by passing strict = false
builder = Stupidedi::Builder::BuilderDsl.build(config, false)
Now I get:
Stupidedi::Exceptions::OutputError - separators occur as data:
from stupidedi.
This and a few other ISA elements are handled as a special case. Try putting a blank (nil or "") value in that element and then look at the output when you serialize it using .to_x12 -- it should be converted to 10 spaces automatically.
-- Kyle
On Aug 3, 2014, at 7:27 AM, Isi Robayna [email protected] wrote:
I have the have the following definition data element summary definition:
M ISA02 I02 Authorization Information M AN 10/10
Key Point:
Must be 10 spaces
it is a mandatory field but must contain 10 spaces. Any way to work around this?I am trying to build the output file using:
config = Stupidedi::Config.contrib
builder = Stupidedi::Builder::BuilderDsl.build(config)builder.ISA "00", " ", "00", " ", "01", "005548384", "01", "126444801", "990531", "1230", "U", "00200", "63373", "0", "P", ":"
β
Reply to this email directly or view it on GitHub.
from stupidedi.
When using a blank (nil or "") I get original error, required element ISA02 is blank
To get around ti have to use strict: false
Note: if you change the interchange version you will see the error message
builder.ISA("00", "", # authorization information
"00", "", # authentication information
"ZZ", "SUBMITTER ID", # submitter identification
"ZZ", "RECEIVER ID", # recipient identification
Time.now.utc, # date
Time.now.utc, # time
"^", # repetition separator
"00200", # interchange version
"333666999", # control number
"1", # acknowledgement request
"T", # usage indicator
":")
from stupidedi.
Oh right, I see. I think this was handled in version 5010 by declaring that element Optional (and probably ISA04 too), but then the ElementDef is a special case of AN that formats itself as 10 spaces when itβs βblankβ instead of an empty string. So Iβd recommend changing your ISA to make that element optional, and use SpecialAN as the element type.
β Kyle
On Aug 3, 2014, at 11:36 AM, Isi Robayna [email protected] wrote:
When using a blank (nil or "") I get original error, required element ISA02 is blank
To get around ti have to use strict: false
Note: if you change the interchange version you will see the error message
builder.ISA("00", "", # authorization information
"00", "", # authentication information
"ZZ", "SUBMITTER ID", # submitter identification
"ZZ", "RECEIVER ID", # recipient identification
Time.now.utc, # date
Time.now.utc, # time
"^", # repetition separator
"00200", # interchange version
"333666999", # control number
"1", # acknowledgement request
"T", # usage indicator
":")
β
Reply to this email directly or view it on GitHub.
from stupidedi.
thank you!
sure thing... I will
Any thoughts on as to why this happens?
Stupidedi::Exceptions::OutputError - separators occur as data:
from stupidedi.
I'm not entirely sure, but I think we ought to put quotes around each separator in the error message. I suspect the separator it's complaining about is some kind of whitespace.
Before generating output the Writer
looks at the Separators
you want to use (either passed as an argument or there may be a default). If any of those characters occur as data in the parse tree, it will throw that error because it may be unclear if an occurrence of that character is indicates data or a delimiter.
Try explicitly constructing Separators
and passing them to the writer, and maybe change the exception message to put some kind of quotes around each separator after "separators occur as data: " so you can see what they were. For instance, you would see "separators occur as data: 'a', 'b'" if you declared "a" and "b" as segment and element separators, but those characters showed up as data somewhere.
from stupidedi.
I think I am using a proper separators
per the documentation
builder.ISA("00", "11", # authorization information
"00", "11", # authentication information
"ZZ", "SUBMITTER ID", # submitter identification
"ZZ", "RECEIVER ID", # recipient identification
Time.now.utc, # date
Time.now.utc, # time
"U", # repetition separator
"00200", # interchange version
"333666999", # control number
"1", # acknowledgement request
"T", # usage indicator
":") # component separator
builder.GS "PO", "009348384", "126564801", "19990531", "1230", "1", "X", "002001"
builder.ST "830", "8573"
builder.BFR "04", nil, "140801", "DL", "A", "XX14-08-01", "XX14-08-01", "XX14-08-01",
nil, "CP"
builder.machine.zipper.tap do |z|
separators =
Stupidedi::Reader::Separators.build :segment => "~\n",
:element => "*",
:component => ":",
:repetition => "^"
w = Stupidedi::Writer::Default.new(z.root, separators)
w.write($stdout)
end
end
from stupidedi.
Looks like present?
is returning true
on an empty set -- the set of data characters that are also used as delimiters. This may be a regression caused by recent changes to present?
or just a bad interaction with the set library Cantor
. Should have a fix momentarily.
from stupidedi.
Here's what is going on
>> s = Cantor.absolute([])
=> AbsoluteSet()
>> s.empty?
=> true
>> s.present?
=> true # huh?
from stupidedi.
π Thank you!
from stupidedi.
Related Issues (20)
- Question: Is it possible to override or monkey patch validations? HOT 2
- Need help for parsing a very simple piece of file HOT 2
- Easy Guide HOT 3
- Support for pattern matching (Ruby 2.7+)
- Unable to set CSH segment HOT 2
- non-deterministic machine state revisitied HOT 4
- problems customizing a transaction set HOT 3
- Transaction splitting using notes/split.rb script: out of date? HOT 3
- 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
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.