Hi,
I don't think Drools supports this directly, but would this not be as
accomplishable with DSL?
Your Drools rule could then be written something like this (bare in mind I'm
no DSL expert):-
DSL:
[when]There is a hemoglobin lab result with=LabResult(type==hemoglobin)
[when]- a value less than {v}=value<{v}
Rule:
There is a hemoglobin lab result with
- a value less than 42
With kind regards,
Mike
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Yoni Mazar
Sent: 26 June 2008 15:29
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Package parameters
Hi all,
We are at the begining of a new clinical decision-support project. We are
considering using a BRMS to manage and execute our business logic. As part
of our research, we evaluated JRules and Drools. JRules has a nice feature
that we could not find in Drools. We'd like to know if we are
misunderstanding something, or maybe this feature is missing.
In JRules, one can define a ruleset (corresponds to a package) with
parameters. Each parameter has a datatype (a class), a direction
(in/out/inout), and an alias. Then, within the rules, the user can refer to
the parameter alias. For example, a user can define a ruleset with the
following parameters:
*class=LabResult, direction=in, alias=hemoglobin
*class=LabResult, direction=in, alias=creatinin
Then, within a rule, one can write:
when hemoglobin.value<10 and creatinin.value>34
then...
Now, the application retrieves the patient data accordingle (hemoglobin and
creatinine data separetly) and sets the ruleset parameters:
ruleset.parameters.add("hemoglobin",hemoglobinFact)
ruleset.parameters.add("creatinin",creatininFact)
This approach simplifies the rule authoring process significantly!
Writing this logic in Drools will be:
package cdss
import LabResult;
rule
when
LabResult(type=hemoglobin && value <10)
LabResult(type=creatinin&& value <34)
then...
workingMemory.Assert(hemoglobinFact);
workingMemory.Assert(creatininFact);
Does someone has an idea how to bridge this gap using Drools?
Im not sure if using parameters JRule complies with JSR94 specification.
Thanks,
Yoni
--
View this message in context:
http://www.nabble.com/Package-parameters-tp17979190p17979190.html
Sent from the drools - user mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users