Spacing Out Inbound Source Files #6239
-
I have a two channel process I am using to process CSV Files into HL7 Files. The first channel reads in a csv file to split out the individual records into multiple unique files and the second channel reads in the split out csv files to format and output HL7 files. The csv file has a header and trailer record that I filter out. However, I do pull required data from the Header record into a global variable to apply to each of the detail records for that csv file: data type and region. The process works great as long as the files are processed consecutively - one csv file at a time and the HL7 messages are all created prior to the next csv file starting. However, if the CSV-2 file begins processing before the HL7-1 messages are completed for the CSV-1 file, then inbound messages in the 2nd Channel begin to overlap. When this happens, the header record from CSV-2 is read in the 2nd Channel, changing the value of the global variable before the messages from CSV-1 have completed processing. This puts the Header information from CSV-2 on the remaining HL7-1 messages. My ask: Is there a way to spread out the timing of the inbound CSV files to allow the HL7 creation process to complete for the first file? All I need is to space them out an hour or so, but I'm not seeing a way to do that. OR Are there suggestions for how delay the second file from starting in the 2nd Channel if I haven't seen a Trailer record from the previous file first? OR any other suggestions to allow to prevent the potential overlap of the messages being processed. Any suggestions would be most appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There is no need for two channels for this. |
Beta Was this translation helpful? Give feedback.
https://forums.mirthproject.io/forum/mirth-connect/general-discussion/176728-how-to-convert-database-record-into-hl7-v2-message-format
Start there. It is CSV thread also even though the topic has database in it.