From: Tripp, B. <Bry...@uh...> - 2003-04-22 15:59:04
|
Hi Pat, If you want to move data from message A to message B, you have to copy it. This is easiest if you use ca.uhn.hl7v2.util.DeepCopy, which copies Types. I also just added a method for copying whole Segments (I'm surprised no one asked for this sooner). You can get the latest version from the CVS, or just recycle the source for now. Here it is: public static void copy(Segment from, Segment to) throws HL7Exception { int n = from.numFields(); for (int i = 1; i <= n; i++) { Type[] reps = from.getField(i); for (int j = 0; j < reps.length; j++) { ca.uhn.hl7v2.util.DeepCopy.copy(reps[j], to.getField(i, j)); } } } Bryan -----Original Message----- From: Pat Stadler [mailto:Pat...@Ac...] Sent: April 21, 2003 12:19 PM To: 'hl7...@li...' Subject: [HAPI-devel] HAPI question Hi, I am working with version .3 of the parser, using version 2.3.1 messages with 'VB' encoding and I am trying to do a couple of things. Is there a method that I can use to pull out one whole segment from an instantiated Message class? What I am trying to do is execute an ADT import and if the import of some of the required data (required for our system) fails, I want to pull out that segment to use in rebuilding a new message. I cannot figure out how to do it. Please any help would be appreciated. Thanks Pat Stadler _____ The information contained in this message is confidential and is intended for the addresses only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies. Opinions, conclusions or other information contained in this e-mail may not be that of the organization. |