Have traced in more detail and the rules appear to be firing, but the
facts are not being properly updated, as you suspect. But not sure why,
as I have not worked on the rules file for several months and this used
to append the advice and rationale text appropriately.
In the following two rules, the first one is intended to tell the user
to give glucose to someone with very low glucose, calculate a
recommended dose, and provide a reasonable explanation. The second one
is intended to tell the user to turn off insulin, IF it is running.
When I run the program with a low glucose but no insulin being given,
the fact is altered to include the text "Administer glucose....". When
I run the program with a low glucose and insulin IS being given, then
the fact is not actually modified to include the Administer glucose
text, but is modified to include the text "Turn OFF the insulin ...".
In both situations, interestingly, the glucose bolus (dose) IS properly
updated in the fact.
(defrule give-glucose-extreme
"Give glucose for extreme hypoglycemia"
(extremeHypoglycemia)
?decision <- (GlucoseDecision (patientWeight ?weight))
=>
(assert(recommendedGlucoseBolus))
(modify ?decision (recommendedGlucoseBolus (* ?weight
?*highGlucoseDosePerKg*)))
(modify ?decision (adviceText (append-text
(fact-slot-value ?decision adviceText)
"Administer glucose (0.50 gm/kg = " (format nil "%.2f" (*
?weight ?*highGlucoseDosePerKg*)) " grams).")))
)
(defrule recommend-off-insulin
"If we need the insulin off, then recommend it be turned off."
(needInsulinOff)
?decision <- (GlucoseDecision)
=>
(assert (recommendedInsulinOff))
(modify ?decision (recommendedInsulinDripRate 0.0))
(modify ?decision (adviceText (append-text (fact-slot-value
?decision adviceText)
"Turn OFF the insulin drip.")))
(modify ?decision (rationaleText (append-text (fact-slot-value
?decision rationaleText)
"The patient is receiving insulin despite being
hypoglycemic.")))
)
J. Michael Dean, M.D., M.B.A.
H.A. and Edna Benning Presidential Professor of Pediatrics
Professor of Family and Preventive Medicine
Professor of Biomedical Informatics
Chief, Division of Pediatric Critical Care
Vice Chairman, Department of Pediatrics
University of Utah School of Medicine
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------