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.