Question
· Dec 23, 2024

in business rule , it cannot valuate the value in iteration?

We have a customized doctype with iterated PIDgrp, so I have a rule that needs to evaluate the pv1:3.1 value to decide which operation the HL& message should go, so I debugged the value in the rule and it definitely should go to the when #2 but it just won't.  so did I do anything wrong or it is just the InterSystems doesn't like the iteration value here? I only need to evaluate the first pv1:3.1

Product version: IRIS 2024.3
Discussion (4)2
Log in or sign up to continue
ClassMethod GroupIDExists(pHL7Msg As EnsLib.HL7.Message, pSegment As %String, pField As %String, pLookupTable As %String) As %Boolean
{
            #dim tSeg as EnsLib.HL7.Segment
            
            set tSegCount = pHL7Msg.SegCountGet()
            set i = 1
            Set tFound = 0
            //get new values
            set tval=""
            while ((i <= tSegCount) && (tval="")) {
                         
                        set tSeg = pHL7Msg.GetSegmentAt(i)
                        if (tSeg.Name = pSegment) {
                                    set tID = tSeg.GetValueAt(pField)
                                    set tval= ..Lookup(pLookupTable, tID)
                                                            
                        }
                        set i = i + 1 
            }
            if (tval '= "")
            {
                        Q 1 
            }
            quit 0
}

An example....