Sidebar

How to search for multiple values in the Messages tab?

0 votes
349 views
asked Sep 28, 2023 by amanda-w-3695 (4,840 points)
edited Sep 28, 2023 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;

 

answered Sep 28, 2023 by amanda-w-3695 (4,840 points)
...