From: Tripp, B. <Bry...@uh...> - 2005-02-22 15:47:31
|
Hi Sarah,=20 Yes, like this ...=20 //1. create a Message object with the structure you need, e.g. ADT_A01 ADT_A01 message =3D new ADT_A01();=20 //2. Set its values using getters/setters message.getMSH().getSendingApplication().getNamespaceID().setValue("my app");=20 // ... or using Terser ...=20 Terser terser =3D new Terser(message); terser.set("/MSH-3-1", "my app"); //3. Encode the message using a Parser PipeParser parser =3D new PipeParser(); String encodedMessage =3D parser.encode(message); //4. Then you can send it somewhere=20 Connection conn =3D new Connection(parser, new MinLowerLayerProtocol(), = new Socket(host, port)); Message response =3D conn.getInitiator().sendAndReceive(message); Bryan=20 -----Original Message----- From: hl7...@li... on behalf of fan yue Sent: Tue 2/22/2005 1:47 AM To: hl7...@li... Subject: [HAPI-devel] Building message =20 Hi, I just started using HAPI and am not very farmiliar with it. My = question=20 is, except for parsing an HL7 message, can we also build or construct an = HL7 message using HAPI? Which package should I look into? Thank you very much, Sarah ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel |