Re: [HAPI-devel] Problem with misplaced NTE segment

2009-08-08 Thread Johnny2R
Ah, your 'most obvious' method should have been obvious to me, too. I'll give it a go. But yes, I think having access to the raw original text of the message would be a useful convenience. -- View this message in context: http://www.nabble.com/Problem-with-misplaced-NTE-segment-tp24808667p248765

Re: [HAPI-devel] Problem with misplaced NTE segment

2009-08-07 Thread James Agnew
Hmm, I can see two ways of doing this. The obvious one is to have the receiving application reencode the message: String messageText = new PipeParser().encode(message); The less obvious way, which I've used in the past, is to just use MinLlpWriter and MinLlpReader directly. This method gives you

Re: [HAPI-devel] Problem with misplaced NTE segment

2009-08-07 Thread Johnny2R
Yes, makes good sense, thanks. What would be handiest, though, is if the raw message text could be passed to the registered handling application. How could that happen? -- View this message in context: http://www.nabble.com/Problem-with-misplaced-NTE-segment-tp24808667p24865727.html Sent from th

Re: [HAPI-devel] Problem with misplaced NTE segment

2009-08-07 Thread James Agnew
Good to hear! If you want access to the raw string for some kind of pre-processing as you mention (like reordering an out of place segment for instance), one easy way to do this is to subclass PipeParser and override the parse(String) method. You can then modify the string that is passed in and th

Re: [HAPI-devel] Problem with misplaced NTE segment

2009-08-07 Thread Johnny2R
James, Thanks for that, it's really useful to know how it works. I established in the end that the segment was in fact in the right place, I had just been misinformed about it in the spec (it was part of the patient group, not an order level NTE), so it's probably just as well I didn't find a way

Re: [HAPI-devel] Problem with misplaced NTE segment

2009-08-06 Thread James Agnew
Hi Johnny, You are probably running up against one of the more unusual features of the parser. If it detects a segment it doesn't expect, it will move to the end of the current group, and add a non standard segment there. Unfortunately, this often has the by-product of causing it to skip past the