Question
· 9 hr ago

Data Transform - If OBX 5 contains text Abnormal Flag populates

Hi,

I am trying to include in my Data Transform, if OBX 5.1 (Observation Value) Contains certain text i.e. DETECTED then populate the Abnormal Flag field with a certain letter.

Sometimes the text can be uppercase, lowercase or a multiple of both.

Any help would be much appreciated.

Thanks

Jason

Product version: IRIS 2023.1
Discussion (4)3
Log in or sign up to continue

To implement data transformation where OBX 5.1 contains certain text (e.g., "DETECTED") and then sets the Abnormal Flag field accordingly while handling case sensitivity:

  1. Create a Custom Function: Consider creating a utility class function like SetAbnormalFlag() to check the ObservationValue (OBX 5) and set the flag based on a conditional logic. This can handle both uppercase and lowercase occurrences by normalizing the text using $ZCONVERT or equivalent functions with case-insensitive checks [1][2].

  2. Setup Data Transformation Logic:

    • Use a foreach loop on all the repeating OBX segments within the message structure.
    • Within the loop, retrieve the value from OBX 5 using GetValueAt.
    • Check if this value contains "DETECTED" (you can use $FIND or $ZCONVERT for case-insensitivity).
    • If detected, set the Abnormal Flag in OBX 8 using SetValueAt [1].
  3. Example Structure:

    Set segmentCount = source.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp(*)")
    For segmentIndex = 1:1:segmentCount {
       Set observationValue = source.GetValueAt("PIDgrpgrp(1).ORCgrp(1).OBXgrp("_segmentIndex_").OBX:5")
       If ($FIND($ZCONVERT(observationValue, "U"), "DETECTED")) {
           Do source.SetValueAt("ABNORMAL", "PIDgrpgrp(1).ORCgrp(1).OBXgrp("_segmentIndex_").OBX:8", "set")
       }
    }
    

This process ensures that the text comparison is conducted without being affected by its case, and the Abnormal Flag is appropriately set for each relevant OBX segment [1][2][3].

Let me know if additional assistance is needed!

Sources: