'Mirth Connect Filename sent needs original file name and date sent

I have tried a few different things when sending filename. It seems like it does not like using $OriginalFilename)$(date.get('yyyy-MM-dd'). It wants to add date after file extention. Is it possible in Mirth to even do this? Thank you in advance:)



Solution 1:[1]

Add this in your message transformer. (can be either source or destination side)

var newfilename = sourceMap.get('originalFilename').replace('.txt','') + DateUtil.getCurrentDate('yyyy-MM-dd') + '.txt';

channelMap.put('newfilename',newfilename);

After that, just put ${newfilename} in for the destination file name.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gavin Perkins