You get this error because the procedure, getHL7Segment is not available.
IMHO, this is a poor way to parse an HL7 message. Everytime the routine is called, it re-parses the message and loops till it gets the wanted segment.
The ACK message is very easy to parse in-place. No fancy routines are needed. I also don’t understand the ACKFLAG thing. I guess its another case of make one size fit all. Another thing I am not in favor of.
Charlie