You don't need forall to solve your problem. The following rule prints all<br>patient names which don't have problem 4711; omitting the 'not' prints<br>those suffering from Colognitis.<br><br>rule lookJoe<br>
when<br> $patient: Patient()<br> not ( Problem( code == "4711" ) from $patient.problemList )<br> then<br> System.out.println( $patient.getName() );<br>end<br><br>'not' implies quantification (or exhaustive search over the domain).<br>
Without 'not' also searches all Problem entries of the current Patient<br>so it would fire again if the patient has a problem stored more than<br>once.<br>
<br>-W<br><br><div class="gmail_quote">2009/3/20 howard goldberg <span dir="ltr"><<a href="mailto:goldberg.howard@gmail.com">goldberg.howard@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Trying to check whether a patient has a particular problem on their problem list:<br><br> when<br><br> $patient : Patient()<br> forall ( Problem( code != "195967001") from $patient.problemList)<br>
<br>but I get the following parsing error--<br><br>[29,41]: [ERR 101] Line 29:41 mismatched input 'FROM' expecting ')' in rule "Dumb no asthma Rule"<br>[29,66]: [ERR 101] Line 29:66 mismatched input ')' expecting '(' in rule "Dumb no asthma Rule" in pattern $patient.problemList<br>
<br>What is the correct way to check for this condition?<br><br>Thanks,<br><font color="#888888">Howard<br> <br>
</font><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>
<br></blockquote></div><br>