-   Programming (
-   -   hapi - is it possible to create messages by hand? (

eantoranz 04-17-2012 11:21 AM

hapi - is it possible to create messages by hand?

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:

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

Or something along those lines.

Thanks in advance.

ntubski 04-24-2012 02:05 PM

Have you looked at CreateAMessage?

All times are GMT -5. The time now is 11:41 AM.