# Using AND OR logic in custom rules

**URL:** <https://community.open-emr.org/t/using-and-or-logic-in-custom-rules/23239>\
**Category:** Support\
**Created:** [August 29, 2024, 4:00pm UTC](https://community.open-emr.org/t/using-and-or-logic-in-custom-rules/23239 "2024-08-29T16:00:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![htuck](https://community.open-emr.org/user_avatar/community.open-emr.org/htuck/32/15185_2.png) [@htuck](https://community.open-emr.org/u/htuck)\
**Post date:** [September 3, 2024, 7:53pm UTC](https://community.open-emr.org/t/using-and-or-logic-in-custom-rules/23239/2 "2024-09-03T19:53:46Z")

</div>

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](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:

> [@Flummoxed by cds rule logic](https://community.open-emr.org/t/flummoxed-by-cds-rule-logic/4148):
>
> [harleytuck](https://sourceforge.net/u/harleytuck/) wrote on [Friday, January 29, 2016](https://sourceforge.net/p/openemr/discussion/202504/thread/c9366c5d/#1270): Hi Folks- Can somebody please explain the logic behind the filters and criteria in the Rule Detail panel? I’ve been studying the existing rules but they don’t seem to apply very directly. I’m trying to make a rule that pops an active alert if a pt’s allergies issue still has the original “[checkbox] None” showing. I figure that looking in lists\_touch.type to see if ‘allergies’ does NOT appear captures what I’m looking for. One of the most prom…

Good luck!  
Best- Harley

---

_[View the full topic](https://community.open-emr.org/t/using-and-or-logic-in-custom-rules/23239)._
