We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Problems in understanding how to deal with rules

Hi there!

I'm setting up a study in OpenClinica for the first time and I'm having some problems in working with rules. I can't understand what kind of programming language is used to perform validations. Is it javascript? The language is different for xml-rules and for the excel file with the CRF?

For instance, I would like to perform a validation for dates, so they can't be in the future. When I try the "ITEM_OID gt now()" it gives me an error. I also haven't figured how to implement visibility rules based on events (for instance, some items of a single CRF should only be visible on certain Study Events).

I would also like to have some feedback on working with automatic validations in OpenClinica. Does anyone here had any troubles using this kind of discrepancy management strategy?

Thank's in advance.

Kindest regards,



  • lkeitalkeita Posts: 50
    Hi David,

    Simple validations can be done in the Excel template. These allow you to do simple functions on an individual item. The Instructions worksheet of the template lists the functions that are available.

    More complex (cross-field, cross-form, cross-event) edit checks can be written in XML and then uploaded to OpenClinica. For more information on these rules, see https://docs.openclinica.com/3.1/rules. There is an XML template available for download from the Tasks-->Build Study page. Click on the + for Rules and then download the template for "All actions without comments".

    To compare against the current date, you must use an XML rule (the CRF template does not allow date validations), and in the rule you would use the variable _CURRENT_DATE for the current date. Note that it must be all upper case.

    I hope this helps!

  • sookeyosookeyo Posts: 75
    via Email
    Hi david,
    Welcome to openclinica.. that format you are using in xml is java. My easiest way i used to understand rules design is to use the rule designer (available there) then see the XML codes to understand the format.

    Sent from Samsung mobile
This discussion has been closed.