Hi James,
I'd like to clarify for my own understanding - I normally consider AE and 
AR to be reversed from the way you describe. The way I think of it 'AR' 
means "Resend" as in message may be OK but something else went wrong. From 
HL7 2.5 chapter 2:

2.9.2.2 Accept and validate/process the message in the receiving 
application
Upon successful validation by the responding system, the message is passed 
to the receiving application,
which performs one of these functions:
a) process the message successfully, generating the functional response 
message with a value of AA in
MSA-1-acknowledgment code.
b) send an error response, providing error information in functional 
segments to be included in the
response message with a value of AE in MSA-1-acknowledgment code.
c) fail to process (reject) the message for reasons unrelated to its 
content or format (system down,
internal error, etc.). For most such problems it is likely that the 
responding system will be able to
accept the same message at a later time. The implementers must decide on 
an application-specific
basis whether the message should be automatically sent again. The response 
message contains a
value of AR in MSA-1-acknowledgment code.


Cheers and thanks for a great product! 

Tom Bonavia



NOTICE TO RECIPIENT:  If you are not the intended recipient of this 
e-mail, you are prohibited from sharing, copying, or otherwise using or 
disclosing its contents.  If you have received this e-mail in error, 
please notify the sender immediately by reply e-mail and permanently 
delete this e-mail and any attachments without reading, forwarding or 
saving them.  Thank you.




From:   James Agnew <ja...@jamesagnew.ca>
To:     Eugene Berman <eugene.ber...@mulesoft.com>
Cc:     "hl7api-devel@lists.sourceforge.net" 
<hl7api-devel@lists.sourceforge.net>
Date:   10/22/2012 10:58 AM
Subject:        Re: [HAPI-devel] HL7 Error Handling and ACK



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

------------------------------------------------------------------------------
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