From: Praveen K. <pra...@ya...> - 2005-06-24 08:42:48
|
Hi , Go thru this code String str =obx.getValueType().getValue(); System.out.println("str: "+str); logger.info("STR : "+str); if(str.equals("ST")){ ST st= (ST) obx.getObservationValue(0).getData(); String bloodGroup=st.getValue(); bloodGroup=(bloodGroup == null)?"":bloodGroup; patInfoTo.setBloodGroup(bloodGroup); // st.get } else if(str.equals("DT")){ DT dt= (DT) obx.getObservationValue(0).getData(); String LMPDateString= MessageGenerator.parseLMPDate(dt.getValue()); patInfoTo.setLMPDate(LMPDateString); logger.info("patInfoTo.setLMPDate"+ dt.getValue()); } } Explaination : OBX 2nd field is ValueType which may have any of the HL7 datatypes. (eg : ST or DT etc...) .Based on the Values u typecast it to ST or DT. Then you will not face any problems. In case of any clarifications,Please rever back to me. Regards Praveen Kumar.A hl7...@li... wrote:Send Hl7api-devel mailing list submissions to hl7...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/hl7api-devel or, via email, send a message with subject or body 'help' to hl7...@li... You can reach the person managing the list at hl7...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Hl7api-devel digest..." Today's Topics: 1. [Fwd: [HAPI-devel] Problem with MDM_T02 Message] (Davide Antoni) 2. RE: [Fwd: [HAPI-devel] Problem with MDM_T02 Message] (Tripp, Bryan) --__--__-- Message: 1 Date: Thu, 23 Jun 2005 15:45:19 +0200 From: Davide Antoni Organization: Tesan To: hl7...@li... Subject: [Fwd: [HAPI-devel] Problem with MDM_T02 Message] This is a multi-part message in MIME format. --------------090606040907060003030706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit i have find that MDM_T02 is a group and i have initialized in this way: MDM_T02 mdm_t02 = (MDM_T02) in; MDM_T02_OBX mdm_t02_obx = mdm_t02.getMDM_T02_OBX(); System.out.println("prova "+mdm_t02_obx.getOBX().getObservationValue() .getObservationValue() return "varies" datatype, and no getValue method is available, how to get field 5-5 from obx segment? --------------090606040907060003030706 Content-Type: message/rfc822; name="[HAPI-devel] Problem with MDM_T02 Message" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="[HAPI-devel] Problem with MDM_T02 Message" X-Account-Key: account2 Return-Path: Received: from lists-outbound.sourceforge.net (lists-outbound.sourceforge.net [66.35.250.225]) by mercurio.ifc.cnr.it (8.12.10/8.12.10/IFC 2.1) with ESMTP id j5KAaMUW008224 for ; Mon, 20 Jun 2005 12:36:23 +0200 Received: from projects.sourceforge.net (sc8-sf-list1-b.sourceforge.net [10.3.1.7]) by sc8-sf-spam1.sourceforge.net (Postfix) with ESMTP id 7071288697; Mon, 20 Jun 2005 03:36:16 -0700 (PDT) Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.11] helo=sc8-sf-mx1.sourceforge.net) by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) id 1DkJdD-0005w7-QK for hl7...@li...; Mon, 20 Jun 2005 03:35:55 -0700 Received: from hermes.ifc.cnr.it ([146.48.68.24]) by sc8-sf-mx1.sourceforge.net with esmtp (TLSv1:AES256-SHA:256) (Exim 4.41) id 1DkJdD-0000KA-1r for hl7...@li...; Mon, 20 Jun 2005 03:35:55 -0700 Received: from [127.0.0.1] (potenza-port.ifc.cnr.it [146.48.70.160]) by hermes.ifc.cnr.it (8.12.10/8.12.10/IFC-o 2.1) with ESMTP id j5KAZklL015683 for ; Mon, 20 Jun 2005 12:35:48 +0200 Message-ID: <42B...@if...> From: Davide Antoni Organization: Tesan User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hl7...@li... Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-h-ifc-cnr-MailScanner-Information: Contact pos...@if... for info X-h-ifc-cnr-MailScanner: No virus found X-h-ifc-cnr-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.3, required 5.1, autolearn=not spam, ALL_TRUSTED -3.30) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 Subject: [HAPI-devel] Problem with MDM_T02 Message Sender: hl7...@li... Errors-To: hl7...@li... X-BeenThere: hl7...@li... X-Mailman-Version: 2.0.9-sf.net Precedence: bulk List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: X-Original-Date: Mon, 20 Jun 2005 12:35:38 +0200 Date: Mon, 20 Jun 2005 12:35:38 +0200 X-m-ifc-cnr-MailScanner-Information: Contact pos...@if... for info X-m-ifc-cnr-MailScanner: Found to be clean X-m-ifc-cnr-MailScanner-SpamCheck: not spam, SpamAssassin (score=-2.599, required 5.1, BAYES_00 -2.60) Hi to all I'm newbie and i have a probelm with parse message MTM_T02, my message it's compose of this segment : MSH PID PV1 TXA OBX OBX OBX I have tersed the message with this: Terser tIn = new Terser(in); and all work fine, when i get some field of MSH, EVN, PID, PV1, TXA i don't have any problem and i use a code like this : String Field = tIn.get("/EVN-2") When i try to obtain e 1 field of OBX segment : String Field = tIn.get("/OBC-5-5") i have this error: ca.uhn.hl7v2.HL7Exception: Can't find MDM_T02 as a direct child In particular i have the necessity to take the 5.5 field of obx segment for refert. Probably i make an'error in a code , how to get this field from my message? Many Thanks to all. ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel --------------090606040907060003030706-- --__--__-- Message: 2 Subject: RE: [Fwd: [HAPI-devel] Problem with MDM_T02 Message] Date: Thu, 23 Jun 2005 10:10:12 -0400 From: "Tripp, Bryan" To: "Davide Antoni" , Hi, =20 You can call Varies.getData(), which will return a Type. If you know = that this is a Primitive, based on the value of OBX-2, you can cast it to Primitive (or to the concrete subclass) and call getData() on that. =20 Bryan=20 ________________________________ From: hl7...@li... on behalf of Davide = Antoni Sent: Thu 23/06/2005 9:45 AM To: hl7...@li... Subject: [Fwd: [HAPI-devel] Problem with MDM_T02 Message] i have find that MDM_T02 is a group and i have initialized in this way: =20 MDM_T02 mdm_t02 =3D (MDM_T02) in; MDM_T02_OBX mdm_t02_obx =3D mdm_t02.getMDM_T02_OBX(); System.out.println("prova "+mdm_t02_obx.getOBX().getObservationValue() .getObservationValue() return "varies" datatype, and no getValue method is available, how to get field 5-5 from obx segment? --__--__-- _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel End of Hl7api-devel Digest --------------------------------- Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. |