Announcement

Collapse
No announcement yet.

All segments not always present in Inbound messages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • All segments not always present in Inbound messages

    I am receiving ORU messages that sometimes contain OBX and NTE segments, and sometimes do not. I have configured the system to contain the segments. Everything works fine when the messages contain the segments, but errors when the message does not contain them. How can I configure the system to see the segments as optional?

  • #2
    Re: All segments not always present in Inbound messages

    What errors are you getting within Mirth?

    Thanks
    -Chris
    Chris Lang

    Comment


    • #3
      Re: All segments not always present in Inbound mes

      We are also facing the same issue. Appreciate any help on this.

      Comment


      • #4
        Re: All segments not always present in Inbound mes

        I put a little piece of code in place to check for the presence of the segment.

        See below for an example.

        Code:
        var checkSeg = msg['NTE'].toString();
        if (checkSeg != ""«»)
        {
        	var ntei = 0;
        	var tempNTE = "";
        
        	while (msg['NTE']['NTE.1']['NTE.1.1'][ntei] != null) 
                  {
        	  tempNK1 = msg['NTE']['NTE.1']['NTE.1.1'][ntei].toString();
        	  if (tempNTE.length > 0) 
        	  {
        /* do your mappings here */
        
        	  }
        /* increment the index to move on to the next one */
        	  ntei++;
        
        	  }
        }
        
        else
        	{
        
        /* do something here like mapping null to values or something if needed*/
        	
        	}
        I hope that's helpful.

        Comment

        Working...
        X