web stats
creating a filter with 2 conditions - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-10-2014, 04:49 AM
cgbullock cgbullock is offline
OBX.2 Kenobi
 
Join Date: Aug 2007
Location: Greenville, NC
Posts: 63
cgbullock
Default creating a filter with 2 conditions

I need to create one filter with two conditions.
I need one for :

if (msg['ORC']['ORC.5']['ORC.5.1'].toString() == "R") {
return false;
} else {
return true;
}

and also one for
if (msg['OBR']['OBR.2']['OBR.2.1'].toString().search(/RMS/i) != -1 || msg['OBR']['OBR.2']['OBR.2.1'].toString().search(/RAD.PMI/i) != -1) {
return false;
} else {
return true;
}


The latter filter we routinely change depending if we are working for the site or not.
Reply With Quote
  #2  
Old 11-10-2014, 06:29 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

If you just want two conditions, that's easy. Just create two filter steps, and set the operator accordingly (AND/OR). If the second condition should somehow be dynamic, you can put it in a code template and decide in there what condition to use (e.g. based on the channel ID, etc.).
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 11-10-2014, 08:10 AM
cgbullock cgbullock is offline
OBX.2 Kenobi
 
Join Date: Aug 2007
Location: Greenville, NC
Posts: 63
cgbullock
Default

Maybe I am confused. I had them both with an OR condition, and they didn't seem to work. My thoughts with the AND condition, was that they both must meet the criteria. These are two independent streams coming from one source.
Reply With Quote
  #4  
Old 11-10-2014, 08:15 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

Quote:
Originally Posted by cgbullock View Post
Maybe I am confused. I had them both with an OR condition, and they didn't seem to work. My thoughts with the AND condition, was that they both must meet the criteria. These are two independent streams coming from one source.
I tried it out and it works fine for me. Do you have a sample message?
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 10:04 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation