Iterate on table in OBX

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate on table in OBX

  • Creator
    Topic
  • #48127
    Anonymous
    Participant

    Hi,

    I am iterating on a table. OBX 3 and OBX 5. First I do is Iterate on OBX 5. If the value is found, I want to copy the table lookup value to OBX 3. If the value is not found, I want to leave the OBX 3 value (whatever it was) to be left alone.

    So my next iterate will be on OBX 3. If the value is found (which it will), I am using the table to complete the translation and send the resulting HL7 to receiving system.

    But how do I make the “Leave me alone” thing with the table.

    Hope someone has done this before. If it comes to a point where I wld have to write the If statements for all those “Leave me alone” values, I can do that. I want that to be last option.

    Thanks,

Viewing 3 reply threads
  • Author
    Replies
    • #57730
      Ryan Spires
      Participant

      If I am understanding correctly,  Then I would do a Table lookup of OBX5 and store the result in a temporary variable @obx5 or something.

      Then you could do if logic on the @obx5 and if the result is NOT @null — or your Table default value (if your using a default value)

      Then you can map @obx5 to Obx3.

      I hope this makes sense.

      Ryan Spires

    • #57731
      Anonymous
      Participant

      I am not able to get to “Leave me alone” part.

      When I first do, translate OBX3 to value from table based on OBX5, it is nulling the OBX3 part if it doesnot have a table mapping.

      Like,

      OBX3 = leavemealone

      OBX5 = test. I donot have mapping for test in the table.

      When I iterate over OBX5 using the table, since test is not available in the table,

      my HL7 at this time has OBX3 as null or no value.

      I don’t want that to happen.

      So in other words, if I don’t find words in the table for OBX5, I want OBX3 to be left as is which in this case is “leavemealone”

      Let me know.

      Thanks,

    • #57732
      Anonymous
      Participant

      Hari,

      You could make the destination field of the table lookup a temporary field and make the default value of the table “NOTFOUND” (or your favorite alternative).  Then put an if action to test for not found.  If not found then leave alone (actually you’ll probably just move the field from source to dest), else make the change.

      Hope this helps.

    • #57733
      Anonymous
      Participant

      Ryan’s logic should work:

      copy @null -> @obx5

      table 1(%?).1(%?).OBX(0).#5 -> @obx5

      if @obx5 ne @null

       copy @obx5 -> 1(%?).1(%?).OBX(0).#3

      note: %? = your group iterate variables

Viewing 3 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,297
Replies
34,440
Topic Tags
287
Empty Topic Tags
10