Sidebar
0 votes
463 views
by john-p-3531 (210 points)
I am creating a parameter map for a value that is in an incoming JSON message using a look-up table:

var tableOrg = qie.doTableLookup('m:/Organization', '', 'Org', 'source', 'destination');

var parameterMap = qie.newParameterMap();

parameterMap.put('Org', tableOrg);

I am then using the parameter {p:org} in the message header receiving organization in the outbound HL7 message created in a template.

MSH|^\&~|Sender|{p:org}|

However, the org is always null in the outbound message.

Am I using the source table lookup correctly ? (currently have m:/Organization') - here is the JSON snippet for Organization that I am recieving:

{
   "Organization": "14",
or is there another reason the output is null.

 

Thanks.

1 Answer

0 votes

The doTableLookup does not support nodeTags: 

This line: 

var tableOrg = qie.doTableLookup('m:/Organization', '', 'Org', 'source', 'destination');

Needs to look like this:

var tableOrg = qie.doTableLookup(message.getNode('Organization'), '', 'Org', 'source', 'destination');

And on the evaluate template function make sure you need to pass the map name. Here is an example script:

var map = qie.newParameterMap();
map.put('test', 'test1');
var test123 = qie.evaluateTemplate('{p:test}', map);
message.setNode('/', test123);

 

by brandon-w-8204 (34.1k points)
edited by brandon-w-8204
...