web stats
Mirth Community - View Single Post - Preprocessor for handling single quotes not functioning
View Single Post
Old 09-29-2015, 03:12 PM
mirthguy301 mirthguy301 is offline
Mirth Newb
Join Date: Sep 2015
Posts: 14
mirthguy301 is on a distinguished road

Originally Posted by plew View Post
Your example has one single-quote, but your regular expression is looking for two. Dac is on the right track, but their example is doubling all single-quotes. If you want all single quotes removed, do this instead:
return message.replace(/'/g, "");
So if this was the case that makes sense why the preprocessor wasn't doing anything I noticed. I added this logic to the actual data writer and it worked:
var GuarantorEmployerName = msg['GT1']['GT1.16']['GT1.16.1'].toString().replace(/'/g,"''");
But I will add what you have back to the preprocessor
Reply With Quote