web stats
ACKGenerator.generateAckResponse 2.4 ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2016, 02:15 PM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 929
StickyBandit is on a distinguished road
Question ACKGenerator.generateAckResponse 2.4 ?

I noticed that we were getting back...

MSH|^~\&|990||||20160512152233||ACK^^ACK|201605121 52233|T|2.4
MSA|AA|1| etc...

from the following message

MSH|^~\&|||990||||||T||

and the following mirth connect code sets the MSH-12 to 2.4
ACKGenerator.generateAckResponse(message.getConnec torMessages().get(0).getRawData(), false, "AA", "", "yyyyMMddHHmmss", "");

The question is why? In our case it is totally the wrong version since the message came through our 2.5.1 port.

Last edited by StickyBandit; 05-16-2016 at 10:11 AM.
Reply With Quote
  #2  
Old 05-16-2016, 10:16 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 929
StickyBandit is on a distinguished road
Question

I want to change this line of code to grab the message that I modified in the source connector filter with msg['MSH']['MSH.12']['MSH.12.1'] = '2.5.1';

return ACKGenerator.generateAckResponse(message.getConnec torMessages().get(0).getRawData(), false, ....etc....


but the problem is that there does not seem to be a message because the filter returned false.

ANY HELP?

Last edited by StickyBandit; 05-16-2016 at 10:24 AM.
Reply With Quote
  #3  
Old 05-16-2016, 10:26 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

The version set in the auto-generated ACK comes from the version in the original message. The message you posted does not have a version at all, so the ACK generator defaults to 2.4.

The code you posted works fine for me in the postprocessor. If you're using a custom response returned from the postprocessor, make sure you select that on the source response settings.
__________________
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
  #4  
Old 05-16-2016, 10:52 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 929
StickyBandit is on a distinguished road
Default

Thanks for the reply. So I understand that mirth connect will default to version 2.4.

I did not explain very well that I want to set the version to 2.5.1 before the post-processor generates the NACK, so that it will have 2.5.1 instead of 2.4 in the response.
But, the channel processing ends at the source filter.

Last edited by StickyBandit; 05-16-2016 at 10:54 AM. Reason: typo
Reply With Quote
  #5  
Old 05-16-2016, 10:56 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,116
narupley is on a distinguished road
Default

The ACK generator acts on the raw data before it hits the preprocessor. However technically you can do that in a JavaScript attachment script:

Code:
var serializer = SerializerFactory.getSerializer('HL7V2');
var msg = new XML(serializer.toXML(message));
msg.MSH['MSH.12']['MSH.12.1'] = '2.5.1';
return serializer.fromXML(msg);
__________________
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
  #6  
Old 05-17-2016, 09:36 AM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 929
StickyBandit is on a distinguished road
Arrow

I found a spot in our code to utilize this toXML and then make change..
then ..fromXML so it is working now. But I am wondering why Mirth Connect defaults to version 2.4? It might be better if it just threw an error or something.

As far as I know there is no default in the HL7 standard for version.

Last edited by StickyBandit; 05-17-2016 at 09:39 AM.
Reply With Quote
Reply

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:56 AM.


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