Getting addicted to the stats page – “Map fails in custom pipeline”

I know, it’s wrong. But oh so interesting!

The latest search term I noticed that reminded me of a problem was "map fails in custom pipeline". This was the bane of my life in a past project and resulted in an additional 100+ orchestrations in the eventual solution. When developing a solution with the HL7 accelerator you cannot put a map in the pipeline. The basic issue is that if a message is received in the pipe-delimited HL7 format which cannot be disassembled by the HL7 pipeline component it is not converted to XML. The map expects XML as an input and when it receives the non-XML message it fails, collapsing the pipeline.

That is a bit of a pain, and more so with solutions based on the Canonical model that require the ACK/NACK generated by the pipeline. Specifically if the pipeline collapses prematurely then the ACK/NACK is not written to the MessageBox and therefore never returned to the upstream system. Which then generally sulks and does nothing.

The solution is to place the map in an orchestration after the pipeline has completed. Which lead to the 100+ orchestrations in my solution; one for every HL7 trigger for every upstream system. Not fun.

So if there are any other issues that lead you to my blog, leave a comment, and I’ll see if I can help!

Tags: , , ,

Powered by Qumana

Advertisements

4 Responses to “Getting addicted to the stats page – “Map fails in custom pipeline””


  1. 1 brax December 27, 2007 at 10:14 am

    Hi Simon:

    I have a problem in my actual project, i need to call the BTAHL7ReceivePipeline inside an orchestration to create and HL7 message from a string variable with the content of an HL7 file.

    I am trying to make this:

    HL7Request = string;

    BTAHL7ReceivePipeline = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(typeof(BTAHL72XPipelines.BTAHL72XReceivePipeline), HL7Request);

    HL7Request2.MSHSegment = new System.Xml.XmlDocument();
    HL7Request2.BodySegments = new System.Xml.XmlDocument();
    HL7Request2.ZSegments = new System.Xml.XmlDocument();
    BTAHL7ReceivePipeline.MoveNext();
    BTAHL7ReceivePipeline.GetCurrent(HL7Request2);

    Where ‘string’ represents the HL7 content, ‘HL7Request’ is a System.String message and ‘HL7Request2’ is a BTAHL7 message.

    When i try to make this, it gives me the following error:

    “Message has an invalid header, it could be due to error in 1st/2nd field or the segment name is neither MSH nor FHS

    I have checked the hl7 content and is ok, it seems that the pipeline is not receiving the content correctly and it fails, i don´t know how to make this work…

    Could you help me please?

    PD: Is it true you cannot execute a map inside a pipeline with BTAHL7?

  2. 2 brax December 27, 2007 at 3:35 pm

    Hi Simon:

    I am trying to execute the BTAHL7ReceivePipeline inside an orchestration, the idea is to take a string variable with the HL7 content and convert it to a BTAHL7 message through the pipeline, this is what i am trying:

    HL7Request = string;

    BTAHL7ReceivePipeline = Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline(typeof(BTAHL72XPipelines.BTAHL72XReceivePipeline), HL7Request);

    HL7Request2.MSHSegment = new System.Xml.XmlDocument();
    HL7Request2.BodySegments = new System.Xml.XmlDocument();
    HL7Request2.ZSegments = new System.Xml.XmlDocument();
    BTAHL7ReceivePipeline.MoveNext();
    BTAHL7ReceivePipeline.GetCurrent(HL7Request2);

    Where ‘string’ contains the HL7 content, ‘HL7Request’ is a System.String message i pass to the pipeline and ‘HL7Request2’ is the message i get from the pipeline with the BTAHL7 format.

    My problem is that when i execute the BTAHL7ReceivePipeline, it says the following error:

    Message has an invalid header, it could be due to error in 1st/2nd field or the segment name is neither MSH nor FHS

    Could you help me, please?

  3. 3 simonchester December 27, 2007 at 5:36 pm

    Hi Brax

    So first off, I have to mention I have never tried calling the BTAHL7 pipeline from code before so this is all conjecture;
    The first thing I would check is that the encoding of the string is correct. HL7 messages are “framed” in a particular way and this may be effecting your code. Specifically I would check the way line breaks and carriage returns are encoded and ensure there are no unseen leading characters. I am not sure whether the framing has to be correct in order for the pipeline to be successful. I’ll ask some of my more code orientated friends about this one though and see if I can get you a more specific answer..

    With regards to maps; you can include them if you want, but it you are relying on the ACK mechanism you shouldn’t. They do not break provided the inbound message successfully converts to XML. If that fails, the map will fail as the input is not XML as expected. The pipeline will then collapse, and your ACK (or NACK) will not be produced, usually stopping the upstream system until it’s interface is reset.

    Cheers!

  4. 4 simonchester December 27, 2007 at 5:37 pm

    ps. Steve. Any thoughts here?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: