1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
573 views
by michael-f-4439 (120 points)
retagged by michael-f-4439

I am trying to use a table lookup to transfom the values contained in OBR-16.1. The source and message are both HL7 ORM messages.

The code I have so far is:


var value = source.getNode("OBR-16.1");
value = qie.doTableLookup(value, value, 'Centricity Username To NPI Crossreference', 'Username', 'NPI Number');
message.setNode("OBR-16.1", value);


The lookup table is a simple two column crossreference set up as a sytem variable. The not found action is set to 'use source value'.

It works great on the first instance of OBR-16.1, but any subsequent instances are not transformed. No error is generated, with the original values remaining.

by michael-f-4439 (120 points)
It works perfectly. And I am now one point farther along in learning QIE.

Thanks, Brandon. Hugely appreciated.

1 Answer

+1 vote

You will need to loop through each record. The code in the question only looks at the first value:

for (var i = 1; i <= message.getCount('OBR'); i++) {
   var value = source.getNode("OBR-16.1", i);
   value = qie.doTableLookup(value, value, 'Centricity Username To NPI Crossreference', 'Username', 'NPI Number');
   message.setNode("OBR-16.1", value, i);
}

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