Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Recovering messages not filtered (http://www.mirthcorp.com/community/forums/showthread.php?t=218267)

riven974 05-17-2018 03:35 AM

Recovering messages not filtered
 
Hi all
I have done a channel which filter messages. I have 23000 messages processed ok, and 30 that have been stopped by the filter. Is it possible to recover those 30 messages in a directory for example?
Thanks
Vero

MIRTH 3.5

kirbykn2 05-17-2018 05:12 AM

export the source message.

AlexNeiva 05-17-2018 05:17 AM

Hello,

or on your Channel Filter you can mention that if it is filtered then write in a file on a specific directory.
Just select JavaScript type and you can put something like this example:

Code:

if (msg['MSH']['MSH.9']['MSH.9.1'].toString() != "ADT")
{
    FileUtil.write('D:\\Test\\message_' + msg['MSH']['MSH.10']['MSH.10.1'].toString() + '.hl7', false, connectorMessage.getRawData());
    return false;
}
else
    return true;


riven974 05-21-2018 11:00 PM

Hello Alex
thanks for the reply. Unfortunately, the code I added is not working, nothing appears in the directory. The test is on the presence of the patient name :
if (msg['PID']['PID.5']['PID.5.1'].toString().length > 0)
{
return true;
}
else
{
FileUtil.write('F:\\LOGICIELS\\Mirth\\ERROR\\messa ge_' + msg['MSH']['MSH.10']['MSH.10.1'].toString() + '.hl7', false, connectorMessage.getRawData());
return false;
}

AlexNeiva 05-22-2018 03:35 AM

Hello,


that is strange because i just test with your code and it changes perfectly!
This path exists? F:\\LOGICIELS\\Mirth\\ERROR

agermano 05-22-2018 09:42 AM

It might be cleaner to set up a second destination with a file writer to write the files only when the name does not exist than to do it in a filter.

You could have a DestinationSet filter that only runs the relevant destination based on the presence of the name.

riven974 05-23-2018 09:26 PM

Hi Alex
the code is working. It's another part of the code that was blocking the process.
And you are right @agermano. I changed that too
Many thanks for the help !
Véronique


All times are GMT -8. The time now is 11:28 AM.

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