1
votes

I have configured mirth database reader channel and LLP sender channel. I am able to send messages and updating the details in the database. I want to update the database if any of the acknowledgement is failed. How can i achieve this? Any suggestions will be of great help.

1

1 Answers

1
votes

The On-Update statement will run after a message is processed, even if it errored on a destination. If you want to conditionally update based on an HL7 NACK, you can do that in the On-Update statement, but it would probably have to use JavaScript. Or, you can do this in a postprocessor:

if ($r('Destination 1').getStatus() == 'FAILURE' && /.*MSA.[AC][RE].*/.test($r('Destination 1').getMessage())) {
    // Update the database here
}