Subject Error with Rules

I finally got all my rules created and imported without error. I have added a few test subjects. When I run the rules, I get the following message: "No subjects meet the criteria for the selected rule(s). Click 'Cancel' to go
back"

I can't figure out what's wrong. Anyone else expereince this issue?

Comments

  • GerbenRienkGerbenRienk Posts: 791 ✭✭✭
    That does not necessarily mean there is something wrong. When you run a Rule in batch, first the number of Subjects that meet the criteria is counted. But only the Subjects that have no Discrepancy yet. 
    Or did you indicate that the Rule should not run on dataentry, and only on batch?
    If this is so, take one example of a Subject for which you know the Rule must fire and fill in the value(s) that you provided in the CRF, but then in the Rule-test-screen. If the test indicates that Actions will be fired but you do not see any Discrepancies in real OpenClinica-life, then please upload the rule to the forum, so we can have a look.
    Kind regards,
    Gerben Rienk
  • romalyndaromalynda Posts: 12
    Thanks for you response Gerben,

    I am new to OpenClinica and all of the nuances. I wrote an InsertAction Rule. I simply want to take a value entered into one crf and display it on a second one in the same Event. The rule is as follows:
    <RuleImport>
    <RuleAssignment>
        <Target Context="OC_RULES_V1">SE_VISIT1.F_NEWIMAGEENTR_13_5005.IG_NEWIM_SITEIMAGES.I_NEWIM_IMAGENO</Target>
        <RuleRef OID="R_GETIMAGENO">
            <InsertAction IfExpressionEvaluates="true">
            <Run AdministrativeDataEntry="true" InitialDataEntry="true" DoubleDataEntry="true" ImportDataEntry="false" Batch="false"/>
            <DestinationProperty OID="F_HAWK_GRADER_13_6304.IG_HAWK__UNGROUPED.I_HAWK__IMAGENO">
                    <ValueExpression Context="OC_RULES_V1">I_NEWIM_IMAGENO</ValueExpression>
            </DestinationProperty>
             </InsertAction>
            </RuleRef>
    </RuleAssignment>
        <RuleDef OID="R_GETIMAGENO" Name="ImageNumber">
                    <Description>Insert the ImageNo</Description>
                    <Expression>(I_NEWIM_IMAGENO ne "") and (I_HAWK__IMAGENO eq "")</Expression>
    </RuleDef>
    </RuleImport>

    The rule tests OK. However, the values don't appear on the 2nd CRF and under the Manage Rules when I run it, I get the error/alert mentioned.

    What am I doing wrong?

  • GerbenRienkGerbenRienk Posts: 791 ✭✭✭
    You defined in your Run-tag that the InsertAction should not run on Batch, so that explains the message "No subjects meet etc".
    Now just to make sure: are CRFs F_NEWIMAGEENTR_13_5005 and F_HAWK_GRADER_13_6304 both in Event Visit 1? Because otherwise the InsertAction will not work.
    Then: if you check that source-item must not be null and target-item must be null, you create a difficult situation, because if the target CRF F_HAWK_GRADER_13_6304 does not exist (yet) at the moment of clicking Save in the Source CRF, then the expression will never be evaluated, so the InsertAction will never fire.
    I would suggest that just for testing you rewrite the expression to 
    I_NEWIM_IMAGENO ne ""
    and see if I_HAWK__IMAGENO gets the value of I_NEWIM_IMAGENO after clicking Save. (It should create F_HAWK_GRADER_13_6304  if it doesn't exist.)
    Could you try that?
    Many thanks.
  • romalyndaromalynda Posts: 12
    Gerben,

    Thank you for your help. Both CRFs are in the same event, Visit 1. I re-wrote the expression as suggested and still nothing. I even tried changing the Batch Run-tag to true and the rule had an error on import.

    Anymore suggestions?


  • GerbenRienkGerbenRienk Posts: 791 ✭✭✭
    Thank you for trying.
    Is IG_NEWIM_SITEIMAGES a Grid or a non-repeating-item-group?
    If it is repeating, you should specify of which row you want to insert I_NEWIM_IMAGENO, for example IG_NEWIM_SITEIMAGES[1].I_NEWIM_IMAGENO
    Kind regards,
    Gerben Rienk
  • romalyndaromalynda Posts: 12
    Gerben,

    I have revisited this issue with fresh eyes (tried all your suggestions) and to no avail, I still cannot get the item entered on the NewImages form (F_NEWIMAGEENTR_13_5005.IG_NEWIM_SITEIMAGES.I_NEWIM_IMAGENO) to appear on the Grader form (F_HAWK_GRADER_13_6304.IG_HAWK__UNGROUPED.I_HAWK__IMAGENO). Is there something I'm missing? Do I need to redesign my CRF to reference the 1st form somehow? If so, please advise.

    Thanks for your time


  • GerbenRienkGerbenRienk Posts: 791 ✭✭✭
    Sorry to be not clear enough: what I meant was: is there just one I_NEWIM_IMAGENO or are there more than one? If you defined IG_NEWIM_SITEIMAGES as GRID, you should use for inserting the first row:
    <ValueExpression Context="OC_RULES_V1">IG_NEWIM_SITEIMAGES[1].I_NEWIM_IMAGENO</ValueExpression>
    If your problem still isn't solved, please upload the two CRFs.
    Many thanks,
    Gerben Rienk
  • romalyndaromalynda Posts: 12
    I re-wrote the rule, after making changes to the HAWK Grader form and re-uploading it. Here's the rule:
    <RuleImport>
    <RuleAssignment>
        <Target Context="OC_RULES_V1">SE_VISIT1.F_NEWIMAGEENTR_13_5005.IG_NEWIM_SITEIMAGES[1].I_NEWIM_IMAGENO</Target>
        <RuleRef OID="R_GETIMAGENO">
            <InsertAction IfExpressionEvaluates="true">
            <Run AdministrativeDataEntry="true" InitialDataEntry="true" DoubleDataEntry="true" ImportDataEntry="false" Batch="false"/>
            <DestinationProperty OID="F_HAWK_GRADER2_2.IG_HAWK__UNGROUPED_2784.I_HAWK__IMAGENO2">
                    <ValueExpression Context="OC_RULES_V1">IG_NEWIM_SITEIMAGES[1].I_NEWIM_IMAGENO</ValueExpression>
            </DestinationProperty>
             </InsertAction>
            </RuleRef>
    </RuleAssignment>
        <RuleDef OID="R_GETIMAGENO" Name="ImageNumber">
                    <Description>Insert the ImageNo</Description>
                    <Expression>IG_NEWIM_SITEIMAGES[1].I_NEWIM_IMAGENO ne ""</Expression>
    </RuleDef>
    </RuleImport>

    I have also attached both CRFs

    Thanks for your help!
  • romalyndaromalynda Posts: 12
    Gerben Rienk,

    Have you had the opportunity to review my rule and CRFs?

    Reagrds,
    romalynda
  • GerbenRienkGerbenRienk Posts: 791 ✭✭✭
    Hi Romalynda,
    You've ran into OC-3009 I'm afraid
    It was closed but I re-opened it.
    Kind regards,
    Gerben Rienk
This discussion has been closed.