web stats
Help In Setting Response Message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2014, 07:15 AM
Newb Newb is offline
What's HL7?
 
Join Date: May 2014
Posts: 3
Newb is on a distinguished road
Default Help In Setting Response Message

I am using Mirth 3.0 and i have to store messages from a lab machine into a MySQL database.

I have created my channel and have been able to test sending messages from one laptop to another, and it works okay. i.e. the message is stored in the database.

The issue is that initially, there was an error in the dashboard of the machine i was using to send the message.

The error was [CODE]"Blank or empty response". [CODE]

I now tried to send a "custom response" and so went to the postprocessor script and wrote this :

Code:
  var ackString = "It works";
 var ackResponse =ResponseFactory.getSuccessResponse(ackString);
 responseMap.put("Custom ACK", ackResponse);
return;
On the source page of the channel i now set "Custom ACK" as the response.

When i now tried sending the message again...the error i got was:
Code:
  Invalid HL7 v2.x acknowledgement received.
How can i send a response that will be accepted.
I also do not know if the lab machine requires a response, but i just want to be on the safe side. Thanks
Reply With Quote
  #2  
Old 06-11-2014, 08:28 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

You're getting that because your TCP Sender has an inbound response data type of HL7 v2.x and you have "Process HL7 ACK" enabled. If you're not going to be returning a valid HL7 ACK, you can disable that option.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 06-11-2014, 11:52 PM
Newb Newb is offline
What's HL7?
 
Join Date: May 2014
Posts: 3
Newb is on a distinguished road
Default Generating ACK Response

Thanks for your earlier reply. It worked.
As i mentioned in the earlier post, i am not sure if the lab machine expects a response or not...so i want to be able to generate an ACK response.

I did the following in the postprocessor:
[CODE]
var ackHL7 = ACKGenerator.generateAckResponse(response,true,"AA ","Solved","yyyyMMddHHmmss","Error Occurred" );
responseMap.put("customResponse",ResponseFactory.g etSuccessResponse(ackHL7));

return;
[CODE]

but got this error in the response:
[CODE]
Java class "com.mirth.connect.server.userutil.ACKGenerato r" has no public instance field or method named "generateAckResponse".
[CODE]

How can i generate a valid HL7 ACK?..thanks
Reply With Quote
  #4  
Old 06-12-2014, 04:57 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

You'll need to do "new ACKGenerator()" first, and then call the methods on the instantiated object. Also see: MIRTH-3338
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #5  
Old 06-12-2014, 07:58 AM
Newb Newb is offline
What's HL7?
 
Join Date: May 2014
Posts: 3
Newb is on a distinguished road
Default

Hi...i did the following

Code:
ACKGenerator myack=new ACKGenerator();
var ackHL7 = myack.generateAckResponse(response,true,"AA","Solved","yyyyMMddHHmmss","Error Occurred" );
responseMap.put("customResponse",ResponseFactory.getSuccessResponse(ackHL7));

return;
But it refused to validate stating that :
Code:
missing ; before statement
I am bewildered. Thanks for your help
Reply With Quote
  #6  
Old 06-12-2014, 07:59 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

Quote:
Originally Posted by Newb View Post
Hi...i did the following

Code:
ACKGenerator myack=new ACKGenerator();
var ackHL7 = myack.generateAckResponse(response,true,"AA","Solved","yyyyMMddHHmmss","Error Occurred" );
responseMap.put("customResponse",ResponseFactory.getSuccessResponse(ackHL7));

return;
But it refused to validate stating that :
Code:
missing ; before statement
I am bewildered. Thanks for your help
Do not do "ACKGenerator myack". Do "var myack" instead.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
mirth 3.0, response message

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:45 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation