Hi Vasu,
It looks to me like you have an extra line in your code:
pid.getBirthPlace().setValue("Mbmr");
That line seems like your most likely cause.
James
On Tue, Jan 20, 2009 at 9:00 AM, vasu sreenivas <[email protected]>wrote:
>
> Hi,
>
> I am running the CreateAMessage Example but the output is not exactly
> as mentioned in the example file
>
> here is code
> ------------
>
> import ca.uhn.hl7v2.HL7Exception;
> import ca.uhn.hl7v2.model.v24.message.ADT_A01;
> import ca.uhn.hl7v2.model.v24.segment.MSH;
> import ca.uhn.hl7v2.model.v24.segment.PID;
> import ca.uhn.hl7v2.parser.DefaultXMLParser;
> import ca.uhn.hl7v2.parser.Parser;
> import ca.uhn.hl7v2.parser.PipeParser;
>
> /**
> * Example transmitting a message
> *
> * @author <a href="mailto:[email protected]">James
> Agnew</a>
> * @version $Revision: 1.1 $ updated on $Date: 2007/02/19 02:24:46 $
> by $Author: jamesagnew $
> */
> public class CreateAMessage
> {
>
> /**
> * @param args
> * @throws HL7Exception
> */
> public static void main(String[] args) throws HL7Exception {
>
> ADT_A01 adt = new ADT_A01();
>
>
> // Populate the MSH Segment
> MSH mshSegment = adt.getMSH();
> mshSegment.getFieldSeparator().setValue("|");
> mshSegment.getEncodingCharacters().setValue("^~\\&");
>
> mshSegment.getDateTimeOfMessage().getTimeOfAnEvent().setValue("2009010
> 11539");
>
> mshSegment.getSendingApplication().getNamespaceID().setValue("CreateHL
> 7");
> mshSegment.getSequenceNumber().setValue("123");
> mshSegment.getMessageType().getMessageType().setValue("ADT");
> mshSegment.getMessageType().getTriggerEvent().setValue("A01");
>
> mshSegment.getMessageType().getMessageStructure().setValue("ADT A01");
>
> // Populate the PID Segment
>
> PID pid = adt.getPID();
>
> pid.getPatientName(0).getFamilyName().getSurname().setValue("Doe");
> pid.getPatientName(0).getGivenName().setValue("John");
> pid.getPatientIdentifierList(0).getID().setValue("123456");
> pid.getBirthPlace().setValue("Mbmr");
>
> /*
> * In a real situation, of course, many more segments and
> fields would be populated
> */
>
> PipeParser pipeParser = new PipeParser();
>
> // Now, let's encode the message and look at the output
> String encodedMessage = pipeParser.encode(adt);
> System.out.println(encodedMessage);
>
>
>
> /*
> * Prints:
> *
> * MSH|^~\&|TestSendingSystem||||200701011539||ADT^A01^ADT
> A01||||123
> * PID|||123456||Doe^John
> */
>
>
>
>
>
> }
>
> }
>
> here is the output what i am getting
> ---------------------
> PID|||123456||Doe^John||||||||||||||||||MbmrADT A01||||123
>
>
> please help me .
>
> Thanks
> Vasu
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Hl7api-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel