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
.png)
.png)
Comments
I got with the resource and this is clarified, with when, only the first true condition will be executed. any other condition after the first one won't be executed.
I ended up writing a function with some help from the Developer community to do this. The function basically iterates through the the HL7 message and check it against a Data Lookup Table. I am in the office in two week and will share it once I am back in the office.
Thank you Scott.
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 = 1Set tFound = 0//get new valuesset 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 '= "")
{
Q1
}
quit0
}An example.....png)