web stats
Get SENT data - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2018, 07:43 AM
mlarcelet mlarcelet is offline
What's HL7?
 
Join Date: Feb 2016
Posts: 1
mlarcelet is on a distinguished road
Default Get SENT data

Hi everyone,
My goal here is to take a MD5 checksum of the data that actually go out of my channel.

So I search a way to access the "SENT" data in my destination connector.

i tried this in postProcessor script (Mirth 3.5.2)

Code:
//get destination immutable connector message
var destinationConnectorMessage = message.getConnectorMessages().get(2);	

//for example, get ENCODED message : this works perfectly
var encoded = destinationConnectorMessage.getMessageContent(ContentType.ENCODED); 

//try to get SENT message : always returns null because getSent() method is deprecated
var sent = destinationConnectorMessage.getMessageContent(ContentType.SENT); 

logger.debug("encoded : " + encoded.getContent());
logger.debug("sent : " + sent); // 'sent' is alwyays null because getSent() method is deprecated

return;
result in stdout :

[2018-11-07 04:06:44,840] ERROR (com.mirth.connect.userutil.ImmutableConnectorMess age:189): The getSent() and getSentData() methods have been deprecated and will soon be removed. Please use map variables to retrieve post-replacement data instead. This method will always return null for the SENT content type.

In most cases, encodedData will be exactly what I actually send. But in some cases, i can have some replacements in destination connector's output template. For example :

Code:
${message.encodedData}
${someAdditionalData}
How can I, in this case, get the actual SENT data and not only the ENCODED one ?

Thanks a lot !
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 08:25 PM.


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