Hi Nicholas,

I have created an issue in the HAPI bug tracker to track this issue. Thanks
for reporting!

https://sourceforge.net/tracker/?group_id=38899&atid=423835

Cheers,
James

On Fri, Jun 17, 2011 at 5:38 AM, Nicolas Lefebvre <[email protected]
> wrote:

>  Hi Brian,
>
> I am Nicolas Lefebvre and I am working in the IHE-development team at INRIA
> with Eric Poiseau.
>
> We are successfully using Hapi in our tools and we appreciate the quality
> of the project.
>
> I have found a problem with the Responder.java class of Hapi-Base since
> release 1.1, in the "ca.uhn.hl7v2.app" package. One Hl7Exeption is not
> handle. To correct this, I suggest this improvement (in bold) in the
> Responder.java file :
>
>
> protected String processMessage(String incomingMessageString) throws
> HL7Exception {
>         HapiLog rawOutbound =
> HapiLogFactory.getHapiLog("ca.uhn.hl7v2.raw.outbound");
>         HapiLog rawInbound =
> HapiLogFactory.getHapiLog("ca.uhn.hl7v2.raw.inbound");
>
>         log.info( "Responder got message: " + incomingMessageString );
>         rawInbound.info(incomingMessageString);
>
>         Message incomingMessageObject = null;
>         String outgoingMessageString = null;
>         try {
>             incomingMessageObject = parser.parse(incomingMessageString);
>         }
>         catch (HL7Exception e) {
>             *try {*
> *                outgoingMessageString = logAndMakeErrorMessage(e,
> parser.getCriticalResponseData(incomingMessageString), parser,
> parser.getEncoding(incomingMessageString));                *
>             } catch (HL7Exception e2) {
>                 outgoingMessageString = null;
>             }
>             for (Object app : apps) {
>                 if (app instanceof ApplicationExceptionHandler) {
>                     ApplicationExceptionHandler aeh =
> (ApplicationExceptionHandler) app;
>                     outgoingMessageString =
> aeh.processException(incomingMessageString, outgoingMessageString, e);
>                 }
>             }
>         }
>
>         if (outgoingMessageString == null) {
>             try {
>                 //optionally check integrity of parse
>                 try {
>                     if (checkWriter != null)
>                         checkParse(incomingMessageString,
> incomingMessageObject, parser);
>                 }
>                 catch (IOException e) {
>                     log.error( "Unable to write parse check results to
> file", e );
>                 }
>
>                 //message validation (in terms of optionality, cardinality)
> would go here ***
>
>                 Application app = findApplication(incomingMessageObject);
>                 Message response =
> app.processMessage(incomingMessageObject);
>
>                 //Here we explicitly use the same encoding as that of the
> inbound message - this is important with GenericParser, which might use a
> different encoding by default
>                 outgoingMessageString = parser.encode(response,
> parser.getEncoding(incomingMessageString));
>             }
>             catch (Exception e) {
>                 outgoingMessageString = logAndMakeErrorMessage(e, (Segment)
> incomingMessageObject.get("MSH"), parser,
> parser.getEncoding(incomingMessageString));
>             }
>         }
>
>         log.info( "Responder sending message: " + outgoingMessageString );
>         rawOutbound.info(outgoingMessageString);
>
>         return outgoingMessageString;
>     }
>
>
> I tested this modification and it is solving that problem.
>
> I hope you can take it into account before your next release of Hapi.
>
> I worked about this bug with one of my colleague, Gabriel Landais.
>
> Thanks a lot in advance,
>
>
> *Nicolas Lefebvre*
>
> Engineer in the *IHE-Development **Project
> *
>
> *
> *
>
> *INRIA Rennes
> Campus Universitaire de Beaulieu
> F-35042 Rennes Cedex FRANCE*
>
>
> *Cell : *(+33)6 72 05 40 18
>
> Phone : (+33)2 99 84 74 56* */ Fax: (+33)2 99 84 71 71
> Mail : [email protected] <[email protected]>
>
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to