Filtering messages based on OBX:3.1 being valued
We have a customer that is not able to accept HL7 result messages that are missing OBX:3.1. I have been trying to create a function that could return a boolean value of 0 if the message didn't meet the expectations of the function.
{
#dim tSeg as EnsLib.HL7.Segment
set tSegCount = pHL7Msg.SegCountGet()
set i = 1
Set tFound = 0
while ((i <= tSegCount) && (tval="")) {
set tSeg = pHL7Msg.GetSegmentAt(i)
if (tSeg.Name = pSegment) {
set tID = tSeg.GetValueAt(pField)
if ($LENGTH(tID)> 0)
{
set tFound = 1
}
set i = i + 1
}
set i = i + 1
}
if (tFound '= "")
{
Q 1
}
quit 0
}
Am I missing something in my function? Is there a better way to do this?
Thanks
Scott
You don't need a function.
Length(HL7.{PIDgrpgrp().ORCgrp().OBXgrp().OBX:ObservationIdentifier.identifier},)=0
Best Regards.
When I feed a lab result through with OBX:3.1 valued, it is not being identified in this WHEN statement. Any other suggestions?
That was my mistake I needed to replace tVal with tFound.
You forget that : PIDgrpgrp().
I don't have a PIDGrp in my structure...
I didn't notice that you have your "personal" schema category : ORUBeakerLAB
Where is the "tval" variable defined?