Comments (6)
Greatly appreciate it!! Thanks a bunch.
from staedi.
@hod-github - version 1.10.0
has been released with this change included. The reference
returned by the EDIStreamReader
will vary depending on the position of the reader within the input EDI stream.
EDIReference reference = reader.getSchemaTypeReference();
EDIType type = reference.getReferencedType();
String title = type.getTitle(); // "title" attribute from schema
String description = type.getDescription(); // "description" element text from schema
from staedi.
Wow, that was fast!! Do you mind adding a quick snapshot of how it looks like in the Schema xml? Just to I'm sure I'm going to use it correctly.
from staedi.
@hod-github - you would set the title
similar to the elements in the common X12 control schema:
https://github.com/xlate/staedi/blob/master/src/main/resources/X12/common.xml
Just to be clear, this addresses only the first item in the original issue description. The second point about 1000B
vs. L0001
is already covered. You just need to set the code
attributes on your loops accordingly.
from staedi.
Hi @MikeEdgar , while trying to use the new functionality I realized I probably have a gap in my understanding. So wanted to ask this quick question to see where I'm going wrong...
The description and title of an element might change depending on their position of it in the file, for example if I have this (simplified) file:
ISA*01*...
GS*HC*...
ST*837*...
BHT*0019*...
NM1*412SAMPLE INC46*496103
PER*IC*...
NM1*402PPO BLUE46*54771
.
.
You can see that I have two NM1 and both are the exact same structure, yet each one represents a different meaning, the first NM1 is "Submitter Name" while the second if the "Receiver name", how do I use the schema to associate a different title for each one so when I'm in line 5 the getTitle() will return "Submitter Name" and in line 7 "Receiver name"?
from staedi.
@hod-github - consider the following "standard" layout (everything after loop 1000 is omitted to make the point).
<transaction>
<sequence>
<segment type="BHT" minOccurs="1"/>
<segment type="REF" maxOccurs="3"/>
<loop code="1000" maxOccurs="10">
<sequence>
<segment type="NM1"/>
<segment type="N2" maxOccurs="2"/>
<segment type="N3" maxOccurs="2"/>
<segment type="N4"/>
<segment type="REF" maxOccurs="2"/>
<segment type="PER" maxOccurs="2"/>
</sequence>
</loop>
...
</sequence>
</transaction>
While the standard defines the generic layout of the transaction, the implementation defines what multiple occurrences of a loop should look like. For example, loop 1000A and 1000B are both occurrences of the standard loop 1000, with a reduction in the segments and elements that can be used. This roughly describes those two loops in the 837, again with the remainder of the implementation after loop 1000 omitted. Note the discriminator
attribute which names the element within the loop's first segment that is used to determine which of the occurrences to select for validation. In the case of loop 1000, the NM101 is either 41 or 40 (identified in the element enumeration in position 1). Segments that are not to be used at left out of the implementation.
<implementation>
<sequence>
<segment type="BHT" />
<loop code="1000A" type="1000" discriminator="1">
<sequence>
<segment type="NM1" title="Submitter Name">
<sequence>
<element position="1">
<enumeration>
<value>41</value>
</enumeration>
</element>
<element position="2"/>
<element position="3"/>
<element position="4"/>
<element position="5"/>
<element position="8"/>
<element position="9"/>
</sequence>
<segment>
<segment type="PER" />
</sequence>
</loop>
<loop code="1000B" type="1000" discriminator="1">
<sequence>
<segment type="NM1" title="Receiver Name">
<sequence>
<element position="1">
<enumeration>
<value>40</value>
</enumeration>
</element>
<element position="2"/>
<element position="3"/>
<element position="8"/>
<element position="9"/>
</sequence>
<segment>
</sequence>
</loop>
</sequence>
</implementation>
from staedi.
Related Issues (20)
- Add support for obtaining enumeration title values from schema for the element_data HOT 1
- Resolve GitHub action warnings HOT 1
- Control reference and count validation inactive for X12 HOT 3
- Read X12 File Error HOT 6
- Support to Split mulitple GS into separate EDI files HOT 9
- Repetition Elements are not being correctly identified HOT 3
- Error reported when reading ANSI encoded txt file HOT 27
- Missing Mandatory Segments HOT 8
- Does enumerated elements really requires minLength and maxLength? HOT 12
- Reporting a vulnerability HOT 2
- How to apply relational condition in schema HOT 11
- X12 unexpected segment error occurred when first segment of loop is missing HOT 5
- Support multiple ISA segments in an X12 EDI file
- Validator should be reset at end of interchange
- titles for segments like BGN, ST, INS are not accessible in 834 EDI HOT 1
- Adding condition to writeSegment HOT 4
- Option to ignore repetition separator in the ST/SE segments HOT 8
- default decimal mark is point (.) when UNA segment is not present HOT 2
- HL Segment is not interpreted correctly by ReaderService HOT 17
- How to define element inside element in schema? HOT 7
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 staedi.