Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread Jake C
Adding my 2 cents... I stuck with the Java Object-Oriented way (I like compile-time checks and my IDE's auto-completion), and wrote conversion methods to our classes for Segments and Data Types. I end up having a Message method for each unique ADT message, but they are all VERY short. All the

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread Ian Vowles
013 8:20 AM To: Laurent Hasson Cc: [email protected] Subject: Re: [HAPI-devel] reading HL7 generically Thank you all, very helpful. On Thu, Jan 10, 2013 at 7:55 AM, Laurent Hasson wrote: This is the kind of code we have been using for that purpose: try { _PID = new HL

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread LDH
; Laurent Hasson; Subject: Re: [HAPI-devel] reading HL7 generically Hi Steven, The model actually is- There is an ADT_Axx Java type for each HL7 message type, which has all of the segments in reusable Java types as well. The method suggested below by Laurent (and others) is taking advantage of that

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread steven touw
gt; >>> On Thu, Jan 10, 2013 at 9:48 AM, Carlos Oliva wrote: >>> >>>> How would you examine repetitive segments with the Preparser? To carry >>>> out a completely generic parsing, one could retrieve data with the >>>> preparser like Christian mentioned

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread James Agnew
examine repetitive segments with the Preparser? To carry >>> out a completely generic parsing, one could retrieve data with the >>> preparser like Christian mentioned. >>> >>> ** ** >>> >>> One problem might be with several instances

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread steven touw
t;> >> ** ** >> >> One problem might be with several instances of the same segment in one >> message. How would you retrieve the fields from all these segments? >> >> ** ** >> >> *From:* steven touw [mailto:[email protected]] >> *Sent:* Thursday, January 10, 201

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread James Agnew
ssage. How would you retrieve the fields from all these segments? > > ** ** > > *From:* steven touw [mailto:[email protected]] > *Sent:* Thursday, January 10, 2013 8:20 AM > *To:* Laurent Hasson > > *Cc:* [email protected] > *Subject:* Re: [HAPI-devel] reading HL7 generi

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread Carlos Oliva
all these segments? From: steven touw [mailto:[email protected]] Sent: Thursday, January 10, 2013 8:20 AM To: Laurent Hasson Cc: [email protected] Subject: Re: [HAPI-devel] reading HL7 generically Thank you all, very helpful. On Thu, Jan 10, 2013 at 7:55 AM, Laurent Hasson

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread steven touw
re prohibited without proper authorization. If you are > not the intended recipient (or have received this e-mail in error) please > notify the sender immediately and destroy this e-mail. Any unauthorized > copying, disclosure or distribution of the material in this e-mail is > strictly forbidden

Re: [HAPI-devel] reading HL7 generically

2013-01-10 Thread Laurent Hasson
rom: Christian Ohr [mailto:[email protected]] Sent: Thursday, January 10, 2013 2:58 AM To: steven touw Cc: [email protected] Subject: Re: [HAPI-devel] reading HL7 generically Forgot to mention that you currently still need to include the hapi-structure jar(s) in yo

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