How to change the autogenerated ACK in Mirth #6481
Unanswered
jayteecollins
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm new to mirth. I tried to search everywhere but I could not find the answer to my question. I'm trying to make a change for the basic first for testing before i go further. When ADT message is received, I would like to change the ACK response.
for simple change, I'm trying to replace MIRTH name in MSH header as DUMMY

MSH|^~&|MIRTH||VGHIS|VGHIS|20250715161140.690||ACK|20250715161140.690|D|2.3.1
MSA|AA|SDAEFCG4PU1S5V8
I did the following.
var msh = msg['MSH'];
var controlId = (msh && msh['MSH.10'] && msh['MSH.10']['MSH.10.1']) ? msh['MSH.10']['MSH.10.1'].toString() : 'UNKNOWN';
var timestamp = DateUtil.getCurrentDate('yyyyMMddHHmmss.SSS');
var msh = msg['MSH'];
var controlId = (msh && msh['MSH.10'] && msh['MSH.10']['MSH.10.1']) ? msh['MSH.10']['MSH.10.1'].toString() : 'UNKNOWN';
var timestamp = DateUtil.getCurrentDate('yyyyMMddHHmmss.SSS');
var ack =
'MSH|^~\&|DUMMY||VGHIS|VGHIS|' + timestamp + '||ACK|' + timestamp + '|D|2.3.1\r' +
'MSA|AA|' + controlId;
return ack;
Kindly advise on how to do it properly.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions