From: Tripp, B. <Bry...@uh...> - 2003-08-12 14:11:54
|
> I'm seriously considering a name-indexed method that will do > a tree traversal on an entire parsed message from the root. > It would be pretty inefficient, but as long as a user of my > app isn't watching an hour glass while i tool around in a > message's basement, it would save lazy me some coding time. > > Has someone already done this ? Check out ca.uhn.hl7v2.util.MessageIterator. It iterates through a message without regard to whether each structure exists yet (it creates groups and segments on the fly as needed). It's meant to help with parsing. It needs a name index to decide where to iterate next, because of infinitely repeatable segments, etc. (it always tries to go in the "direction" of the name). This may not be exactly what you want, but if you want to iterate only through structures that exist, or that have content, maybe you could write a FilterIterator for that purpose? Bryan This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. Opinions, conclusions or other information contained in this e-mail may not be that of the organization. |