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

Hide an item set value for hidden item

Dear Openclinica Users and Developers,

I'm just wondering if I can hide items using the simple conditional display and if it is No / hidden set a value of the hidden fields.
Ok let me elaborate. I'm trying to take the average of 10 items. Each item will only show with a simple yes/no conditional display. Here lies my problem, when it is a no the score is null (because it's hidden). How do I make this item 0 when the conditional display is a No? Cheers

Kevin

Comments

  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    The main tools are insertaction rules and JavaScript, both of which would
    work for this. There quite a few examples in the official docs, previous
    posts on this forum, and trialdatasolution's how to pages
  • kevintehkevinteh Posts: 32
    Lindsay

    Thank you for your response. I'm having a trouble with insert action. My question is for destination property Value, I'm trying to set an integer of zero. However when it comes summing this item up using the RESPONSE_VALUES_OR_CALCULATIONS it does not recognise it and think it's null.  Below is the rule I wrote for reference. I might have done something silly. Cheers.

    <!--
    VARIABLES:
    Study event OID: SE_INITIALVISIT
    CRF version OID: F_NEUROPSYCHOL
    Group OID: IG_NEURO_NEUROPSYCHIATRICINVENTORYN
    Item OID: I_NEURO_NPI_DELUSION  is No
    I_NEURO_NPI_DELUSION_SEVERESS & I_NEURO_NPI_DELUSION_FREQSS & I_NEURO_NPI_DELUSION_SCORASSS = 0
    -->

    <RuleImport>
    <!-- [rule label] -->
    <RuleAssignment>
    <Target Context="OC_RULES_V1">SE_INITIALVISIT.F_NEUROPSYCHOL.IG_NEURO_NEUROPSYCHIATRICINVENTORYN.I_NEURO_NPI_DELUSION</Target>
    <RuleRef OID="R_I_TDSDE_SCANDONE_1">
                <InsertAction IfExpressionEvaluates="true">
                    <Run AdministrativeDataEntry="true" InitialDataEntry="true" DoubleDataEntry="true" ImportDataEntry="false" Batch="false"/>
    <DestinationProperty OID="I_NEURO_NPI_DELUSION_FREQSS" Value="0"></DestinationProperty>
    <DestinationProperty OID="I_NEURO_NPI_DELUSION_SEVERESS" Value="0"></DestinationProperty>
    <DestinationProperty OID="I_NEURO_NPI_DELUSION_SCORASSS" Value="0"></DestinationProperty>
                </InsertAction>
    </RuleRef>
    </RuleAssignment>
    <!-- ************** -->
    <!-- [rule label] -->
    <RuleDef OID="R_I_TDSDE_SCANDONE_1" Name="Show and set">
    <Description>NPI Delusion score default to 0</Description>
    <Expression>I_NEURO_NPI_DELUSION eq 0</Expression>
    </RuleDef>
    </RuleImport>



  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    The rule looks fine, probably the calculation doesn't work because rules
    run after calculations when you save. So I think you'll need JavaScript for
    this.
This discussion has been closed.