web stats
Tilde within Segment - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2019, 12:11 PM
cabanjose367 cabanjose367 is offline
Mirth Newb
 
Join Date: Sep 2018
Posts: 9
cabanjose367 is on a distinguished road
Talking 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?
Reply With Quote
  #2  
Old 06-20-2019, 05:44 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,228
cory_cole is on a distinguished road
Default

msg['FT1']['FT1.26'] = msg['FT1']['FT1.26'].toString().replace('~'/g,'\~');
Reply With Quote
  #3  
Old 06-20-2019, 06:52 AM
cabanjose367 cabanjose367 is offline
Mirth Newb
 
Join Date: Sep 2018
Posts: 9
cabanjose367 is on a distinguished road
Default 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.
Reply With Quote
  #4  
Old 06-20-2019, 06:57 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,228
cory_cole is on a distinguished road
Default

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 \~
Reply With Quote
  #5  
Old 06-20-2019, 01:34 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 802
agermano is on a distinguished road
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:26 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation