web stats
Recovering messages not filtered - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2018, 03:35 AM
riven974 riven974 is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Reunion Island
Posts: 10
riven974 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 05-17-2018, 05:12 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 535
kirbykn2 is on a distinguished road
Default

export the source message.
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.10.4
Mirth Connect Version 3.5.0.8232
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_79-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.4.5
Reply With Quote
  #3  
Old 05-17-2018, 05:17 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 244
AlexNeiva is on a distinguished road
Default

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;
__________________
Best Regards,
Alex Neiva
Reply With Quote
  #4  
Old 05-21-2018, 11:00 PM
riven974 riven974 is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Reunion Island
Posts: 10
riven974 is on a distinguished road
Default

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;
}
Reply With Quote
  #5  
Old 05-22-2018, 03:35 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 244
AlexNeiva is on a distinguished road
Default

Hello,


that is strange because i just test with your code and it changes perfectly!
This path exists? F:\\LOGICIELS\\Mirth\\ERROR
__________________
Best Regards,
Alex Neiva
Reply With Quote
  #6  
Old 05-22-2018, 09:42 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 252
agermano is on a distinguished road
Default

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.
Reply With Quote
  #7  
Old 05-23-2018, 09:26 PM
riven974 riven974 is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Reunion Island
Posts: 10
riven974 is on a distinguished road
Default

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
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 03:04 AM.


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