<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML DIR=ltr><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"></HEAD><BODY><DIV><FONT face='Arial' color=#000000 size=2><SPAN class=postbody>I have what I think is a very simple 
rule to implement, but I can't find a way to do it without "cheating" by using 
an eval/function. Here's the basic rule in English: <BR></SPAN>
<TABLE cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
  
  <TR>
    <TD><SPAN class=genmed><B></B></SPAN></TD></TR>
  <TR>
    <TD class=code><PRE>Reject a claim if it contains a treatment that has already been claimed more than 70 times 
in the same calendar month.        </PRE></TD></TR></TABLE><SPAN 
class=postbody><BR>In other words, I need to count the number of instances of 
the treatment that have already been paid. <BR><BR>Assume for the sake of this 
discussion, my facts are instances of the <SPAN 
style="COLOR: darkred">Treatment</SPAN> class. <BR><BR>If I replace "70" with, 
say, "2" in this rule I could do this: <BR></SPAN>
<TABLE cellSpacing=1 cellPadding=3 width="90%" align=center border=0>
  
  <TR>
    <TD><SPAN class=genmed><B></B></SPAN></TD></TR>
  <TR>
    <TD class=code><PRE>rule
    when
        Treatment(id=="t1", status=="pending")
        Treatment(id=="t1", status=="paid")
        Treatment(id=="t1", status=="paid")
    then
        assert ( new Rejection("reason"));
end
        </PRE></TD></TR></TABLE><SPAN class=postbody>Unfortunately, I can't 
simply replace "70" with "2", and using the same strategy to check for 70 
instances doesn't seem quite right. <BR><BR>Am I missing something very simple 
here? Are there standard strategies to deal with this type of 
rule?</SPAN></FONT></DIV></BODY></HTML>