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

Skip Pattern (Dynamic Logic) and Item Data Type Integer

Hi,
As a part of a skip pattern, I am attempting to create a rule to confirm that an item that has data type integer is not null. So this item should be completed when someone answers 'Yes' to a previous question.

If the answer to the previous question is 'No' then the item should remain blank. 

Originally I tried to develop the rule to state when the answer to question A is 'Yes' and I_HEALT_JCRCNONE eq "" evaluates to true, then the rule should trigger, creating a discrepancy that the item I_HEALT_JCRCNONE has been left null. 

However, when I did this, I received an error message that my form has errors.  The rule validates as ok, but I later receive the message that an error exists in the form when I test the rule. I think this may be occurring because the item data type is integer, but am not certain.

When I tried to write a rule only using one condition without the skip pattern, I still receive the same error noting that my form has errors. 

How can one write a rule looking for an integer that has been left null when the item should have been completed? 

Rule without the skip pattern (limiting to one version of CRF):

Target: I_HEALT_JCRCNONE

Rule OID: RL0076_JCRCNONE

Rule Expression: F_HEALTHCHECK_06.IG_HEALT_BLDGRP.I_HEALT_JCRCNONE eq ""

Warning from OC: Incorrect F_HEALTHCHECK_06.IG_HEALT_BLDGRP.I_HEALT_JCRCNONE

Alert: Form has errors..

Rule with the skip pattern:

Target: I_HEALT_JCRCNONE

Rule OID: RL0076_JCRCNONE

I_HEALT_BLOOD eq 1 and I_HEALT_JCRCNONE eq ""

Warning from OC: Incorrect F_HEALTHCHECK_06.IG_HEALT_BLDGRP.I_HEALT_JCRCNONE

Alert: Form has errors..

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns3:Rules xmlns:ns2="http://www.openclinica.org/ns/odm_ext_v130/v3.1" xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:ns4="http://www.w3.org/2000/09/xmldsig#" xmlns:ns3="http://www.openclinica.org/ns/rules/v3.1" xmlns:ns5="http://www.openclinica.org/ns/response/v3.1" xmlns:ns6="http://www.openclinica.org/ns/RulesTest/v3.1">
    <ns3:RuleAssignment>
        <ns3:Target>I_HEALT_JCRCNONE</ns3:Target>
        <ns3:RuleRef OID="TEST">
            <ns3:DiscrepancyNoteAction IfExpressionEvaluates="true">
                <ns3:Run Batch="true" ImportDataEntry="false" DoubleDataEntry="true" InitialDataEntry="true" AdministrativeDataEntry="true"/>
                <ns3:Message>JCRC Serial Number is required.</ns3:Message>
            </ns3:DiscrepancyNoteAction>
        </ns3:RuleRef>
    </ns3:RuleAssignment>
    <ns3:RuleDef Name="TEST" OID="TEST">
        <ns3:Description>TEST</ns3:Description>
        <ns3:Expression>I_HEALT_BLOOD eq 1 and I_HEALT_JCRCNONE eq ""</ns3:Expression>
    </ns3:RuleDef>
</ns3:Rules>

Rule triggers when JCRCNONE is not null and evaluates false.  However, form alert issued indicating error if JCRCNONE is null during testing.

Thank you,
LaShaunda


Comments

  • llm19.case.edullm19.case.edu Posts: 31
    Hi,
    As an update to this post, someone sent me a resolution to the issue though I am not certain of why the resolution was effective. 

    I had 4 variables in a group called BLDGRP.  The 1st variable was not hidden.  The other three variables are hidden and part of the skip pattern. 

    Variable 1 (Data type: ST): BLOOD (Question: Was blood draw performed? Yes/No)
    Variable 2 (Data type: ST): BLDRES (Question: If No, why blood draw not performed? blank=(Select One),0=Not Scheduled,1=Failed to find vein,99=Other... etc.)
    Variable 3 (Data type: ST): OTHBLDRES (Question: If other reason why blood not drawn, specify.)
    Variable 4 (Data type: INT): JCRCNONE (Question: If 'Yes' blood drawn, provide lab serial number.)

    For the variable BLDRES, originally the variable had (Select One) as a response_options_text with response_value=null. 

    I am new to OpenClinica, I obtained this idea of using (Select One) as a response_option_text from reading a past post on the forum - that this method may be used as an alternative to adding (Select One) to the default value column within the CRF design (or at least that was my understanding of the post).

    However, when I used Rule Designer to write the rule to evaluate for a null JCRCNONE variable and post a discrepancy when JCRCNONE=null, I obtained an error during testing within Rule Designer ("Alert: Form errors"). 

    When "(Select One)" for the variable BLDRES was changed from being a response_options_text to the default value column within the CRF Design Excel file, the rule targeting JCRCNONE began to work without an error alert. 

    I'm not certain of why this may have occurred, especially since the rule targeted JCRCNONE and the variable with the "(Select One)" response_option_text was BLDRES.  May be because they were all hidden variables within the same skip pattern/item group? 

    I'm not certain, but the rule is working now. 

    Rule which is currently working when I import it into OC:

    <?xml version="1.0" encoding="UTF-8"?>
    <RuleImport>
        <RuleAssignment>
            <Target>I_HEALT_JCRCNONE</Target>
            <RuleRef OID="RL0082_BLDRES">
                <DiscrepancyNoteAction IfExpressionEvaluates="true">
                    <Run AdministrativeDataEntry="true"
                        InitialDataEntry="true" DoubleDataEntry="true"
                        ImportDataEntry="false" Batch="true"/>
                    <Message>If Blood was drawn, please provide JCRC Serial Number.</Message>
                </DiscrepancyNoteAction>
            </RuleRef>
        </RuleAssignment>
        <RuleDef OID="RL0082_BLDRES" Name="RL0082_BLDRES">
            <Description>JCRC Serial Number Missing</Description>
            <Expression>I_HEALT_BLOOD eq 1 and I_HEALT_JCRCNONE eq &quot;&quot;</Expression>
        </RuleDef>
    </RuleImport>
     
    Thank you for sending the solution,
    LaShaunda

This discussion has been closed.