1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
293 views
by thanatad-r-3439 (160 points)

Context
I'm building a mapping node.
I'm trying to force it MSH-2 to show "^~\&"

Approach:
Custom script

Snippet

message = qie.createHL7Message('UTF-8');
message.setNode("MSH", "MSH|^~\&|||||||||T|2.3||");
message.setNode("MSH-2", '^~\&');


Result
MSH|^~&|...


1 Answer

+1 vote

The backslash is a special character, so you need to escape it by putting two backslashes next to each other, like this:

message.setNode("MSH", "MSH|^~\\&|||||||||T|2.3||");
by jon-t-7005 (8.2k points)
...