LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   hapi - is it possible to create messages by hand? (http://www.linuxquestions.org/questions/programming-9/hapi-is-it-possible-to-create-messages-by-hand-940282/)

eantoranz 04-17-2012 12:21 PM

hapi - is it possible to create messages by hand?
 
Hi!


I just created a question about hapi a while ago and another question crossed my mind that is not exactly the same but related:

Is it possible to create messages and not just read them?

I mean, something like this:
Code:

Message ack = new AbstractMessage();
Segment msh = new AbstractSegment("MSH");
// setting the values for the fields of the MSH segment
msh.getField(1).setValue("whatever");
.
.
.
msh.getField(12).setValue("2.3"); // setting the version to 2.3
ack.setSegment("MSH", msh);
Segment msa = new AbstractSegment("MSA");
msa.getField(1).setValue("AA");
ack.setSegment("MSA", msa);

Or something along those lines.

Thanks in advance.

ntubski 04-24-2012 03:05 PM

Have you looked at CreateAMessage?


All times are GMT -5. The time now is 01:07 AM.