Announcement

Collapse
No announcement yet.

Tilde within Segment

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

  • Tilde within Segment

    Im currently using Mirth Connect 3.7 version. I am trying to find out how to code or keep a tilde in one of the fields. FT1.26 contains two pieces of information separated by a tilde(~) instead of a carrot(^). Because these are charges how do I keep that tilde in place so that the receiving system can read it?

  • #2
    msg['FT1']['FT1.26'] = msg['FT1']['FT1.26'].toString().replace('~'/g,'\~');

    Comment


    • #3
      Tilde

      Cory_Cole
      Thank you for you reply but I tried it and it is not working. I don't want it to go away or replace it I just need to be able to bring over exactly what i am receiving on that field across.

      Comment


      • #4
        Try this...

        var FT126 = ''

        for each (ft126 in msg['FT1']['FT1.26'])
        {
        FT126 = msg['FT1']['FT1.26'].toString() + '\~';
        }


        msg['FT1']['FT1.26'] = FT126;

        You will need to strip off the last \~

        Comment


        • #5
          Normally you don't need to do anything to keep it in place. It should pass right through. You could be doing something that is removing it, in which case you might need to share your code.

          Comment

          Working...
          X