Closed bjordan2010 closed 1 year ago
Can you either post a complete input and your current testing schema here or email to me at jf.tech.llc at gmail? It'd be a low easier for me to debug and make suggestion
I don't know your specific EDI specification and its hierarchical and loop structure so it's a bit guessing game and hard to be concrete. But from what you said:
a) After INS
there are multiple REF
segments. And if a particular REF
has a 2nd element of 1F
then it can be
optionally followed by a DTP
segment.
b) After HD
segment, there could be zero or more DTP
segments.
My questions are:
1) Are those two REF
s (one with 0F
and one with 1F
) optional or mandatory? Any repeats of these REF
s more than
the two instances (0F
and 1F
)?
2) Is HD
segment mandatory (min=max=1) or optional?
3) Are any of the segments after REF/DTP
and before HD
mandatory? Such as NM1
, N3
, DMG
, etc, any of these
mandatory?
We're following up offline, but want to post progress/updates here for future references:
Issues we've identified so far:
\r\n
not just \n
. segment_delimiter
needs to be fixed.INS
is the actual looping segment, we need to create a segment_group
to create INS
and its subsequent segments.DTP
to be underneath the second REF
(the REF*1L
) and moving the second DTP
to be underneath HD
. This way we can differentiate between DTP
with different xpaths.Issue remaining to be clarified/resolved:
HD/DTP
. However given HD/DTP
has max:-1
, thus in a particular instance of INS
, we have two HD/DTP
s, creating xpath query ambiguity. Need @bjordan2010 to clarify the usage.Final update, the last issue has been resolved: turns out the we only need to extra date data from HD/DTP
seg whose index 1 element value being 348 thus a simple xpath query HD/FTP[qualifier = 348]/date
returns the unique segment for extraction.
Hello. I have a particular EDI case that if resolvable will add another unique example to your docs. In the example file below a unique entity is defined from the INS segment to the DTP segment(s). Therefore, there are 2 unique entities below.
There can be many DTP segments and they are usually the last segments in the entity after the HD segment. However, as you can see with the first entity in this example below, there is an extra DTP segment after the REF1L segment. Is it possible to define a schema with a DTP segment after REF1L and it is optional (0 or 1) and also define DTP segment(s) [0 or more] following the HD segment?
For after REF*0F I use { "name": "DTP", "min": 0, "max": 1 }. For after HD I used the one below. But I get the error Error: input '' at segment no.1 (char[1,1]): segment 'ISA' needs min occur 1, but only got 0. If I remove the first DTP segment from the schema and remove the first entity then it works. So it doesn't like when the that first DTP segment is missing even though I said min 0 and max 1.