web stats
Blocking sending messages when any exception occured - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2019, 05:26 AM
prakashjoy prakashjoy is offline
Mirth Newb
 
Join Date: Sep 2016
Posts: 18
prakashjoy is on a distinguished road
Default Blocking sending messages when any exception occured

I am using mirth version 3.4.2.8129


My channel source will read from the database and destination will construct message to sent to one tcp port.


In the channel destination tab i created one destination named as ADT_A01. Inside the destination i created several steps as seen in the attachment.

In script i am catching the exception.


how to block sending messages if any exception catch occured? .
Attached Images
File Type: jpg destiantion.jpg (449.3 KB, 3 views)

Last edited by prakashjoy; 10-23-2019 at 06:30 AM.
Reply With Quote
  #2  
Old 10-23-2019, 06:42 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,310
cory_cole is on a distinguished road
Default

I would set a flag in the exception then in the filter, filter based on that flag.
Reply With Quote
  #3  
Old 10-23-2019, 06:42 AM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 246
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

I believe
Code:
throw('insert message here')
will "ERROR" the message and stop it.
__________________

-= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines
Reply With Quote
  #4  
Old 10-23-2019, 07:45 AM
prakashjoy prakashjoy is offline
Mirth Newb
 
Join Date: Sep 2016
Posts: 18
prakashjoy is on a distinguished road
Arrow Exception

I made the changes and the message


catch(e){
logger.error("catch-error -> DEST-ADT_A01->TRFM-STEP-INITPROCS -> " + e);
//db script for updating tje failed status
throw('PROC ERR')

}


Here If the destination is catches its not going to next destinations.
Thank you

How to access message constructed from previous destinations from other destinations.
Reply With Quote
  #5  
Old 10-23-2019, 08:04 AM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 246
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

"How to access message constructed from previous destinations from other destinations."

If you mean "FOR other destinations", you can use something like {d4.message} (the d4 refers to the destination #) or you can save the message into a channelMap using the transformer.
__________________

-= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines
Reply With Quote
  #6  
Old 10-24-2019, 05:32 AM
prakashjoy prakashjoy is offline
Mirth Newb
 
Join Date: Sep 2016
Posts: 18
prakashjoy is on a distinguished road
Default

My channel i have few destinations as below.

Destination-1 - Constructing message and send to one ip address and port.

Destination 2 - Writing the messages constructed in Destination-1 to a file.

How can i achieve this using javascript.
Reply With Quote
  #7  
Old 10-24-2019, 05:59 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,310
cory_cole is on a distinguished road
Default

Destination-1 - Constructing message send to one ip address and port.

Destination 1 transformer - Constructing message and Writing the messages constructed in Destination-1 to a file.

transformer...

Construct message and write message. msg = constructed message.
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 07:08 AM.


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