1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
536 views
by amanda-w-3695 (5.1k points)
edited by amanda-w-3695
The hospital changed OBX-3.1 values and I need to resend messages downstream, but don't want to have the same message sent through multiple times. How can this be accomplished in the Messages tab?

1 Answer

0 votes

Yes, you can used the Advanced Search option to achieve this.

From the Messages tab click on the magnifine glass then the Advanced Search button. Then press Insert, change the Type from Standard to Custom and give the search a name in Desc field. Below is sample code that will loop through the OBX-3.1 segments. Once the code is in place, press Ok and Search. 

var value = source.getAllNodes('OBX-3.1');
var found = false;

for (var i = 0; i < value.length; i++) {
   if (StringUtils.equalsIgnoreCase(value[i], '123')||
      StringUtils.equalsIgnoreCase(value[i], '456') ||
      StringUtils.equalsIgnoreCase(value[i], '789') ||
      StringUtils.equalsIgnoreCase(value[i], '111') ||
      StringUtils.equalsIgnoreCase(value[i], '222')) {
      found = true;
   }
   if (found) {
      break;
   }
}
return found;

 

by amanda-w-3695 (5.1k points)
...