Re: [HAPI-devel] reading HL7 generically

2013-01-09 Thread Christian Ohr
Forgot to mention that you currently still need to include the hapi-structure jar(s) in your classpath, depending on the HL7 version(s) you expect. You can also use the CanonicalModelClassFactory with your parser, then you only need the latest structure jar. In HAPI 2.1 (not released yet), you will

Re: [HAPI-devel] reading HL7 generically

2013-01-09 Thread Christian Ohr
In general, you don't have to cast to a specific message structure class: the parser returns a Message object, and you can obtain segments using message.get("segment-name") , and from a Segment you can obtain a field using segment.getField(field-number). If that's not generic enough, take a look at

[HAPI-devel] reading HL7 generically

2013-01-09 Thread steven touw
Hello, I am new to HL7 as well as it's contents. I hope this question isn't too stupid. I'm trying to read from messages generically - is there any way to grab particular segments without having to cast the Message object into ADT_A05 for example? I could have various ADT_* and trying to find the