Using AND OR logic in custom rules

Situation

  1. creating custom rules with alerts
  2. trying to create rules in which one of multiple (but not all criteria) is required to trigger an alert

for example, older than 65 AND younger than 75 AND (previous smoker OR currently smoking)

Is it even possible to require either of two criteria to be fulfilled, for example Either younger than 65 or older than 75? When choosing “optional,” alert appears only if both fulfilled and when choosing “not optional” alert appears even if neither fulfilled. Can do so with a separate rule but attempting to avoid extra work.

OpenEMR Version
I’m using OpenEMR version 7.02 + patch

Browser:
I’m using: firefox

Operating System
I’m using: ubuntu

Search
Did you search the forum for similar questions?
Yes.

Logs
Did you check the logs?
No

Hi @sunny -
Re: your term ‘custom rules’, are you talking about CDR rules?
Can’t tell how you have built your rules but have you looked in the wiki for the tutorial on making them?
https://www.open-emr.org/wiki/index.php/CDR_in_OpenEMR_5_-_Survey_of_CDRs

That’s a multi-page guide on the topic, written for OpenEMR v5 but the mechanics are the same for v7. Can’t say where but I suspect AND and OR rules are mentioned in there.

It also has a mention of a forum topic from a while ago that may be of assistance:

Good luck!
Best- Harley