On Thu, Jun 21, 2007 at 07:51:52AM -0700, NovaMan wrote:
>
> Here is some more background on what I am doing...simply reading in an HL7
> v2.3.1 file and trying to get its components, like MSH segment information,
> PID segment information, OBR segment information, OBX segment information,
> ZU1 segment information, ZU2 segment information, etc.
>
> I'm using HL7 v2.3.1 and it seems that these methods you kindly write about
>
> >msg.getPATIENT_RESULT().getORDER_OBSERVATION().getOBSERVATION(n).getOBX()
>
> to extract multiple OBX segments only exist for v2.4 and higher.
See the javadocs (you'll need to build them yourself) for the v231
classes:
msg.getMSH()
msg.getPIDPD1NK1NTEPV1PV2ORCOBRNTEOBXNTECTI().getORCOBRNTEOBXNTECTI().
getOBXNTE(n).getOBX()
> I then tried to move everything to v2.4 just to try to get the above line to
> work
> but it seems that the way I am getting, for example, the MSH segment like:
>
> ORU_R01 oruMsg = (ORU_R01)hapiMsg;
> MSH msh = oruMsg.getMSH();
>
> causes a fatal runtime error regarding the casting mechanism(s) of HAPI v2.4
> code:
>
> java.lang.ClassCastException
>
> Do you know the way that v2.4 code approves of for, say, getting the MSH
> which does not violate this ClassCastException?
You'd have to change the version number in the message and then
reparse in order to use classes from another versio - see the example
I posted a couple days ago.
Cheers,
Ronald
> Life is hard, and then you die wrote:
> >
> > On Wed, Jun 20, 2007 at 04:17:33PM -0700, NovaMan wrote:
> >>
> >> My question is the following:
> >>
> >> Is it possible (even easy?) to extract multiple OBX segments (and OBR
> >> segments) from ORU_R01 HL7 files that might look something like:
> >>
> >> MSH| ...
> >> PID| ...
> >> NTE| ...
> >> PV1| ...
> >> OBR| ...
> >> OBX|1| ...
> >> OBX|2| ...
> >> OBX|3| ...
> >> .
> >> .
> >> .
> >> OBX|n| ...
> >> ZU1| ...
> >> ZU2| ...
> >>
> >> If so, how is this done?
> >
> > Follow the groups:
> >
> >
> > msg.getPATIENT_RESULT().getORDER_OBSERVATION().getOBSERVATION(n).getOBX()
> >
> >
> > Cheers,
> >
> > Ronald
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Hl7api-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/hl7api-devel
> >
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel