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