I make so many mistakes with BizTalk that I forget how much I have learned, or better yet, how many mistakes I really can make! (This blog is a testament tosome of them that I at least confess to.)A recent contract reminded of a behavior of the BTAHL7 pipeline component that is not that obvious.
While starting off on a new message, the first thing that I normally do is send the message in using the BTAHL72X pipeline on both the send and recieve port (yes, I put the BTS.ReceivePortName as the filter). I normally look in the destination folder to make sure it is a valid, which it almost never shows up!
I then go to my first troubleshooting haven – HAT. There I look at the last 100 instances, and see that the receive successfully, but the sending had an issue:
In looking closer, it looks like it cannot re serialized back into HL7
So the problem must be in the send pipeline.
WRONG
The actual issue is when the BTAHL72XReceivePipeline attempts to parse the HL7 message, and it is unable to, it completes successfullyby doing nothing and sending it in as a text blob. Of course the send pipeline is expecting that multipart message in xml format, not some unserializable text blob, which of course it knows nothing about!
CORRECTION: I justpulled a Pinocchio;the recieve pipelineactually does something, it logs information to the event log, and will create a ACK/NAK if it is configured. It will not suspend the message because it would then queue up all of the rest of the messages that are following this erroneous message. So it does not stop the other messages from coming in. You also need to make sure that you have a send port that has the BTAHL7.ParseError==true filter to pick have a subscription looking for those bad HL7 messages. I briefly blogged about this here.
The actual errors are logged to the event log (and created in the ACK if you have configured that component). This was a definate Doh moment, when at a different client, I ended up calling support because I was rock headed and did not even bother to look in the event log when data was not showing up out of the message box in xml format.
When I look at the event logI get all of the details I want:
Event Type: Error
Event Source: BizTalk Accelerator for HL7
Event Category: None
Event ID: 4101
Date: 11/17/2006
Time: 6:43:37 PM
User: N/A
Computer: SERVER2003
Description:
Error happened in body during parsing
Error # 1
Segment Id: PID_PatientIdentification
Sequence Number: 1
Field Number: 3
Error Number: 101
Error Description: Required field is missing
Encoding System: HL7nnnn
Error # 2
Segment Id: PV1_PatientVisit
Sequence Number: 1
Field Number: 2
Error Number: 101
Error Description: Required field is missing
Encoding System: HL7nnnn
…
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.