Hi Eugene,

Re. multiple errors:
The HL7 "ACK" message type actually allows you to specify the details of
more than one error in your response, using the repeatable ERR segment. The
*generateAck(String, HL7Exception)* method only populates the first one,
since this is a common use case, but there is nothing stopping you from
grabbing multiple reps and populating each one with the details.
E.g.
firstException.populate(ackMessage.getERR(0), null);
secondException.populate(ackMessage.getERR(1), null);
// etc....

Really, we should probably have a varargs (HL7Exception...) version of the
generateAck method. I've filed an enhancement request to that effect. I
think it would make sense..

Re. non-HL7 errors:
This is generally handled by using specific acknowledgement codes. I don't
have HL7 chapter 2 handy right now, so I'll paraphrase a bit, but this is
how the ACK code is generally used:
AA - Message was successfully processed
AR - Message was not successful because of an issue with the message (bad
contents, etc.)
AE - Message was not successful because of an issue with the server
(unexplained exceptions, IO errors, etc.)

This is only a guideline though. Every sending system will have it's own
interpretation of how these ack codes should be interpreted, so in the end
your best bet is to be flexible and let things be configured by specific
implementations.

Cheers,
James

On Fri, Oct 19, 2012 at 10:14 AM, Eugene Berman
<eugene.ber...@mulesoft.com>wrote:

> I'm very new to HAPI, so sorry for the stupid questions :)
> I'm trying to figure out what is the best way to generate ACK message in
> case I have multiple processing errors. E.g. I receive a message and then
> validation fails, producing multiple errors. The generateACK() method only
> accepts one HL7Exception as a parameter, so how do I handle the situation
> when there are multiple errors? Or should I just pick the first one?
>
> Also, what is the best way to handle the non-HL7 error - e.g. general
> system error which is not related to any HL7-specific problem?
>
> Thanks a lot,
>
> Eugene
>
> --
> Eugene Berman
> Sr. Enterprise Solutions Engineer
> ----
> MuleSoft Inc.
> 77 Geary Street, Ste. 400
> San Francisco, CA 94108
> Office: 415 229 2063
> Website: http://www.mulesoft.com <http://www.mulesoft.com/>
> ---
> Entia non sunt multiplicanda praeter necessitatem!
>
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to