web stats
Mirth Community - View Single Post - Mirth Transformer converts \ to \\ when converting from hl7 to JSON
View Single Post
  #5  
Old 07-22-2019, 01:47 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,110
agermano is on a distinguished road
Default

You don't have to. It will happen at the remote end.

Code:
var o = {};
o.value = msg['OBX'][0]['OBX.4']['OBX.4.1'].toString();

// This is how it will look after your transformer is finished
var json = JSON.stringify(o);
logger.info(json);

// This is how it will look to the remote end using your returned json
var parsed = JSON.parse(json);
logger.info(parsed.value);
I used your sample segment in my message. This is the output:
Code:
1 [main] INFO root  - {"value":" \\n \\n \\n \\n \\nNormal sinus rhythm \\n \\nPoor R wave progression V1-V6"}
3 [main] INFO root  -  \n \n \n \n \nNormal sinus rhythm \n \nPoor R wave progression V1-V6
Reply With Quote