<div dir="ltr"><br>&nbsp;&nbsp;&nbsp; What about:<br><br>Number( intValue &gt; 1 ) from accumulate(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LabEvent( eval( dateWithinLastMonths(effectiveTime,1)), results : laboratoryResult ) and<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LabResult( value &gt; 1.8 ) from results,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count( 1 ) )<br><br>&nbsp;&nbsp; Accumulate supports multiple patterns and has the count() function.<br><br>&nbsp;&nbsp; Try it out and let us know.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/7/29 Yoni Mazar <span dir="ltr">&lt;<a href="mailto:y.mazar@gmail.com">y.mazar@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi all,<br>
<br>
Our object deals with the clinical domain. We have a class LabEvent that<br>
represents a visit in the laboratory. Each event is associated (using the<br>
laboratoryResult association) with one or more LabResult objects (children),<br>
each represents the results of a particular test.<br>
in the rule LHS we want to express the following condition:<br>
&quot;At least two LabEvents in the last month, with a LabResult with value<br>
greater than 1.8&quot;<br>
of note, the application asserts the LabEvent objects to the workingMemory.<br>
<br>
in DRL we tried to write it as:<br>
ArrayList(size&gt;1) from collect(<br>
LabEvent(eval( dateWithinLastMonths(effectiveTime,1)),<br>
results:laboratoryResult)<br>
LabResult( value &gt;1.8) from results)<br>
<br>
Of course, the problem is that collect expects a single pattern...<br>
<br>
Does anyone has a simple idea how to express this business logic?<br>
<br>
Thanks, Yoni<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/count-with-nested-condition-tp18710506p18710506.html" target="_blank">http://www.nabble.com/count-with-nested-condition-tp18710506p18710506.html</a><br>
Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>