3

I need to respond to a system that requires messages with all fileds even id they are empty.

I think I have to use the Parser.Configuration.addForcedEncode but I don't know how to add the rules (path) to say "write all fields of the MSH and MSA messages".

Now when I send a response I have this:

MSH|^~\&|||Dazerolab|ViLMA Box|20160202110346||ACK^R01|4|P|2.3.1||||0||ASCII
MSA|AA|4|Message accepted|||0

and I would like obtain this:

MSH|^~\&|||Dazerolab|ViLMA Box|20160202110346||ACK^R01|4|P|2.3.1||||0||ASCII|||
MSA|AA|4|Message accepted|||0|

Can you help me?

Thank you

aGO
  • 1,263
  • 14
  • 30

1 Answers1

2

I solved this problem in this way

    mContext = new DefaultHapiContext();
    mContext.getParserConfiguration().addForcedEncode("MSH-21");
    mContext.getParserConfiguration().addForcedEncode("MSA-7");
aGO
  • 1,263
  • 14
  • 30