You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried the below code in a response transformer, but it doesn't seem to ever enter the if statement:
for each(org in msg..MSH['MSH.6'])
{
if(org != 'DNANC' && org != 'ENANC' & org != 'CKCNC')
{
// Retrieve the original response message
var response = responseMap.get('responseMessage');
//logger.info('Response: ' + response.toString());
// Check if the response is a NACK
if (response && response.startsWith('MSA|AE'))
{ // Adjust condition based on actual NACK structure
logger.info("Received NACK, converting to ACK...");
// Construct an ACK message based on the original NACK
var ackMessage = response.replace('MSA|AE', 'MSA|AA'); // Change 'AR' (Application Reject) to 'AA' (Application Accept)
// Set the modified message as the final response
responseMap.put('responseMessage', ackMessage);
break;
}
}
}
If MSH-6 isn't one of those values that I will get an ack back with an MSA|AE| in it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to convert a MSA|AE response to one accepted (MSA|AA)
A bad one looks like this:
I tried the below code in a response transformer, but it doesn't seem to ever enter the if statement:
If MSH-6 isn't one of those values that I will get an ack back with an MSA|AE| in it.
Would appreciate any advice.
Beta Was this translation helpful? Give feedback.
All reactions