I know Java and I know C#.
I am a noobie with the JBoss Drools "Guvnor" and just their DRL rules language in general. I need a little help on how to use dates and times correctly in the LHS of rules.
For example, I have to assure data quality in a health care system. Obviously, each patient has a DOB in their record and it is of type java.util.Date.
Okay, so say I want to ensure that the DOB in the data passed as Facts is indeed before today's date. I know, for instance, in C#, you can get the current date/time by saying DateTime.Now.
I want to add a rule in Guvnor that says (and this is pseudo-code):
WHEN patient DOB is before NOW THEN mark patient as valid
My Patient fact is:
declare Patient patientID: integer firstName: text lastName: text dateOfBirth: java.util.Date end
I also have a Dose fact, with a patientID field to link it to what patient got what dose:
declare Dose doseID: integer patientID: integer administeredDate: java.util.Date amount: integer end
Also, say a medication is released on a certain year, 1995, and I want to also check that a dose for a given patient is not administered prior to that year.
How do I do these two? I've tried Googling and Googling but all I get is links to the (utterly-useless) Guvnor User Guide which is pretty badly-written in that it doesn't contain this basic information, i.e., how dates and times work and are written in DRL syntax.
Thank you.