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

eantoranz 04-17-2012 12:21 PM

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 03:05 PM

Have you looked at CreateAMessage?

All times are GMT -5. The time now is 06:29 AM.