Fun one with Accumulate:
(deftemplate encounter
(slot date)
(slot code))
(reset)
(assert (encounter (date 2005-10-31) (code 440)))
(assert (encounter (date 2005-10-31) (code 440)))
(assert (encounter (date 2005-10-31) (code 777.1)))
(assert (encounter (date 2005-10-31) (code 468.1)))
(assert
I think Roger Studner wrote:
(defrule count-icd9-codes
?c - (accumulate (bind ?count 0) ;; initializer
(bind ?count (+ ?count 1)) ;; action
?count ;; result
(encounter (code ?c : (eq ?c 440)))
)
...
This (and anything in the accumlates match
Thanks so much!
I wanted to say.. that what made me think something was 'amiss'.. is that
the accumulate example from the web page:
(deftemplate employee
(slot salary))
(deffacts employee-facts
(employee (salary 1007700))
(employee (salary 1002347700))
(employee (salary 107712000))
)
(watch all)
I think Roger Studner wrote:
(deftemplate employee
(slot salary))
(deffacts employee-facts
(employee (salary 1007700))
(employee (salary 1002347700))
(employee (salary 107712000))
)
(watch all)
(reset)
(defrule count-highly-paid-employees
?c - (accumulate (bind ?count 0) ;;
This might be a simple question but I have not been able to find the
solution by myself. I need to assert some ordered facts dynamically and I
have to assess the head of the list by concatenating two strings. The Java
concat function returns a string value, but the Jess assert function needs
its
I think [EMAIL PROTECTED] wrote:
How can I convert a string into a symbol?
In Java,
String string = whatever;
Value symbol = new Value(string, RU.SYMBOL);
In Jess,
(bind ?string whatever)
(bind ?symbol (sym-cat ?string))
-
I am sorry, I should have been more detailed. What I want to do is
somethink like this:
(bind ?string (call string1 concat string2))
(bind ?symbol (sym-cat ?string))
(assert ?symbol 10)
This code does not work because the first argument of the assert function
is expected to be a symbol, and not
How about:
(bind ?string (call string1 concat string2))
(bind ?symbol (sym-cat ?string))
(build (str-cat (assert ( ?symbol 10
Henrique
---
[EMAIL PROTECTED] wrote:
I am sorry, I should have been more detailed. What I want to do is
somethink like this:
(bind ?string (call string1 concat