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

Rules between 2 grids

Hi All

I want to compare 2 grid CRFs with a rule. One grid has a list of normal ranges (NR) for a subject, the other grid has a list of lab results. I want to write rules to compare between the 2 grids matching on various items. For example a check for "unit in lab result does not match unit in normal range".  I managed to get this to work, but it only seems to work on whatever is on the first row in the normal range table. So if I have normal ranges for Albumin, AST and Calcium in the normal range table in that order. When I enter data into the Lab result CRF for these parameters, all with units that don't match, the only one that will fire is the Albumin. If I change the order of the data in the normal range table so AST is first, then when I enter data into the lab result CRF, only the unit for AST will fire etc.  Is there a way to compare items in two grids? What I want to test is:

(labname in RESULTS eq labname in NR) and (labunit in RESULTS ne labunit in NR).  I also want to do similar checks on the result and whether it is out of range or not comparing to the NR etc 

Any help would be greatly appreciated. Thanks

 

 

Comments

  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    I think you will need to specify the ordinal of the row that you want to
    compare to, like ITEM_GROUP_OID[5].ITEM_OID to refer to an item in the 5th
    row.

    When a row ordinal is not specified, the default comparison is to the first
    row.

    So if your ranges for ALT are in the first row, a rule might look like:

    Target
    IG_VALUES.I_VALUE

    Expression
    (I_TESTNAME = "ALT") and ((I_VALUE lt IG_RANGES[1].I_LOWER) or (I_VALUE gt
    IG_RANGES[1].I_UPPER))

    Similarly if AST is in the second row, the rule expression might look like:

    (I_TESTNAME = "AST") and ((I_VALUE lt IG_RANGES[2].I_LOWER) or (I_VALUE gt
    IG_RANGES[2].I_UPPER))

    Unfortunately it is not possible to refer to a grid as a collection, for
    example it won't be possible to write a single rule to do the check if you
    couldn't guarantee that the ALT range is going to be in row 1 and the AST
    range is going to be in row 2. In that case you'd need to write a rule to
    check against all possible rows, which might mean 40 copies of each test
    name rule, if you have 40 different test types.
  • MSmithMSmith Posts: 12
    Thanks Lindsay, that is really helpful. I should be able to use this.
This discussion has been closed.