I'm trying to evaluate the HAPI API for a project that I"m currently working 
on.  I'm having difficulty understanding how to get the information out of the 
ca.uhn.hl7v2.model.Message 
object.  It's resulting class is a 
ca.uhn.hl7v2.model.v231.message.ORU_R01

here is a code exerpt ...
---------------------------------------------
Parser p = new GenericParser();
Message hapiMsg = null;
try {
// The parse method performs the actual parsing
hapiMsg = p.parse(msg);
if (!hapiMsg.getVersion().equals("2.3.1")) {
// throw an exception ...
}
ORU_R01 oru = (ORU_R01)hapiMsg;
MSH msh = oru.getMSH();
---------------------------------------------
and it works fine.  I'm just having a hard time understanding how to access the 
PID, OBR elements and how to obtain a list of the OBX's.

btw: here is the top portion of the message I'm trying to parse ...
-----------------------------------------------------------
MSH|^~\&||LABONE||DDU5|20060901064300||ORU^R01|H|P|2.3.1||||||||
PID|1|161543|26319083|14568-1|ARMSTRONG^GARY^^^^||19470718|M||^|^^^UT^|||||||||||||||||||
PV1|1||||||131313^ROBERTS
OBR|1|161543|26319083|2001^CBC (COMPLETE BLOOD COUNT) WITH 
DIFF^L|||20060831035000||||N||||~~~||||||||||F
OBX|1|ST|2908^NEUTROPHILS^L||51|^%^L|42 - 77|||||

thanks in advance.
Chad


 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367
-------------------------------------------------------------------------
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
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to