We are currently working on the forum. For the short-term, all forum content will be in read-only format. We apologize for the interruption and look forward to collaborating with you shortly. All the best in your research!

contextual statements in rules

In chapter 6.4.2 of the OpenClinica documentation it's written:

Now OpenClinica utilizes what is known as contextual statements, meaning as in the examples above you can put ITEM_OID and OpenClinica will automatically complete the statement so to make it legal. Let’s use an example


<Expression> ITEM_OID eq 50</Expression>

What will actually happen here when this expression is being evaluated is that ITEM_OID will be substituted by


So I tried to setup this:


    <Target Context="OC_RULES_V1">MyEventOID.MyFormOID.MyGroupOID.MyDateFieldOID</Target>
    <RuleRef OID="R1">

  <RuleDef OID="R1" Name="R1">
    <Description>Test date not being in the future</Description>
    <Expression>ITEM_OID gt _CURRENT_DATE</Expression>


When trying to import this XML file OpenClinica does reject it with the following error messages:

Invalid Rules

Rule OID Rule Name Description   Potential Import Errors
R1   R1 Test date not being in the future   OCRERR_0013 : The following : ITEM_OID is not valid.

Invalid Rule Assignments

Target  Rules Errors
 RuleOID  ActionMessage 
OCRERR_0025: The Rule you are trying to reference does not exist or is invalid. OCRERR_0027: The contextual expression in one of the Rules does not validate against the target expression in the current Rule assignment.

The field is of type 'date'.

Do I misunderstand the documentation or what am I doing wrong here? Finally I would like to use the one rule to check multiple date fields against future date which will only be possible if ITEM_OID can be used as placeholder for the actual item.



Best Answer

This discussion has been closed.