This project has moved and is read-only. For the latest updates, please go here.

Parsing TA1 Messages

Sep 24, 2011 at 4:17 PM

Hi,

We are trying to use the X12 Parser to parse TA1 messages.

We're running into two problems:

1. The TA1 messages have no container

2. The TA1 messages have no version

In looking at the parser source code, it looks like changes would need to take place in a couple of locations:

- The X12Parser.Parse method inside the segment switch statement

- The SpecificationFinder.FindSegmentSpec method

- The SpecificationFinder.FindTransactionSpec method

I think we can add in support for these TA1 messages, but the way we're going about it seems wrong/hacky ...so could you please advise as to the best way to add support for this? The additional problem/constraint is that the TA1 messages may have multiple TA1 lines in it. 

Thank you.

Sep 24, 2011 at 5:30 PM

Is your message a TA1 inside an ISA without any GS segments?

Can you give me an example of a complete message or point me to a specification?

Sep 24, 2011 at 5:49 PM

I think I have fixed this with your suggestion in changeset 10682, if you have some sample messages then I will add it to the unit test.  I have added the change to the switch statement as you have suggested.

I am not certain what changes you feel need to happen with the SpecificationFinder, but since the acknowledgment can happen in any transaction set, the change shouldn't care about what transaction set this is.

 

Incidently, I am looking to add something that will create these acknowledgment files from an incoming file.  I am aware of the 997 and 999, and know this TA1 acknowledgement.  Do you have any suggestions as to what would be a useful way to provide these acknowledgements?  I was thinking of simple method calls that took in the incoming message as a parameter and the return value would be these acknowledgment messages.

Sep 24, 2011 at 6:18 PM

Thank you!

Here is the sample message we are testing

ISA>00>1234567890>00>1234567890>28>PPPPP          >28>SSSSSS         >100624>1430>^>00501>000000001>0>P>+

TA1>900000001>100624>1430>R>006>+

IEA>0>000000001

...although please note, the TA1 may appear multiple times.

I didn't realize what you were saying about where acknowledgements can happen...so I guess you're right that the SpecificationFinder might not need to change.

 

We have created the xml for the 999 file, and I'll post that shortly, in case it helps.

As for a way of providing acknowledgements, my gut programmer instinct says to create an interface called IAcknowledgementProvider or create an event on the Parser (or something else) 

event EventHandler<AcknowledgementRequestedEventArgs> AcknowledgementRequested

that allows the parser to request an acknowledgement to generate.

...But without being as close to the code as you are, I'm sure your intuition would be better on this.

Sep 24, 2011 at 6:52 PM

I have added a unit test and made some other fixes in changeset 10684.  Let me know how it works out for you.

Sep 24, 2011 at 7:07 PM

I have added your sample message into the unit tests.

I like your idea about the event handler.  I guess if it was a simple acknowledgement that you received something than it can be a simple transform where you get in a file and spit out a file.

Some of the acknowledgment files look like they require you to do a bunch of validation which may be implementation specific.  I think your idea of doing the event handler sounds perfect for that.  I would probably have to throw an event to allow the client app to inject any of it's own business rules but then take care of construction the message.  It's been on my list for a while to do, and someone else just added that they wanted the 999 acknowledgement also.

Thanks for your ideas.

Sep 26, 2011 at 3:35 AM

Thanks, we will try it out tomorrow morning.

Unrelated - here is the 999 spec we put together (I know it's not much, but in case it helps someone else):

 

<?xml version="1.0" encoding="utf-8" ?>
<TransactionSpecification xmlns="http://tempuri.org/X12ParserSpecification.xsd" TransactionSetIdentifierCode="999">
	<Segment SegmentId="ST"/>
	<Segment SegmentId="AK1">
		<EntityIdentifier Code="HC"/>
	<Loop LoopId="2000">
		<Name>Transaction Set Response Header</Name>
		<StartingSegment SegmentId="AK2"/>
			<EntityIdentifier Code="837"/>
		</StartingSegment>
	</Loop>
	<Loop LoopId="2100">
		<Name>Error Identification</Name>
		<StartingSegment SegmentId="IK3"/>
		<Segment SegmentId="CTX"/>
		<Segment SegmentId="CTX/">
	</Loop>
	<Loop LoopId="2110">
		<Name>Implementation Data Element Note</Name>
		<StartingSegment SegmentId="IK4"/>
		<Segment SegmentId="CTX"/>
		<Segment SegmentId="IK5"/>
		<Segment SegmentId="AK9"/>
	</Loop>
</TransactionSpecification>
Sep 27, 2011 at 4:26 AM

Cool, I started with your specification and found a document at http://www.dhs.wisconsin.gov/publications/P0/p00268.pdf to make some modifications and grab a sample message.  Changes are checked in at 10775 if you would like to test it against your messages.