No announcement yet.

Stop Batch processing on error (tab delimited to HL7)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Stop Batch processing on error (tab delimited to HL7)

    I am converting a tab delimited file to HL7 message and send it to LIS as TCP sender. each file contain multiple lines and each line will become separate HL7 message for same patient ID. I am trying to see if its possible to stop the rest of the batch processing if the first record was rejected from LIS due to invalid patient ID and if the result was rejected move the file to C:\error and create new logfile with name as abc_error.txt and message as "File abc.txt rejected due to invalid patient ID" under same C:\error directory. The intention is to reduce processing in mirth as if LIS rejects 1st result it will reject all the results from file for same reason.

    I am using 3.6.1 and know that i can use edit response to capture if LIS response with AE (error message) but am not sure how to terminate the batch process and do the rest mentioned above.

  • #2
    In theory this is what you can do -

    a) In the destination response transformer, have a boolean flag defined such that, if the current message fails the flag is set to true, else it is false.

    b) pass that flag to globalChannelMap for it is needed to persist across messages but within the same channel.

    c) If you have batching enabled then preprocessor is not useful (i think). So in that case, you can use this flag as a source filter, to stop any subsequent message from being processed if the current message has failed. This will still record message as filtered. If you want silent filter, you can make use of destination Set Filter.

    Try it.
    HL7v2.7 Certified Control Specialist!