Is there a tool which can take 1000 Seperate HL7 Messages and combine them into a single document for 7edit? I need to run a test, and if I can do one document and choose send all, it will be better than me running it manually for each of these 1000 messages.
-
You should define what is "take" for you, is opening files and appending the contents? If that is the case, just create a script in any modern programming language, it is maybe 10 lines of code. – Pablo Pazos Aug 04 '15 at 01:19
4 Answers
Yes, There exist a way to combine those messages in a single file. You can do that using any integration engine, I will take Mirth
in this case.
Follow these steps in sequential order
- Download Mirth Connect from here using the
.exe
installer (in case you don't have it). - Setup your account and do initial configuration on your local system.
- Create a Channel called
Appending Channel
, put Source inbound and outbound connector asHL7v2.x
. - Go to Source Tab, Put Connector type as File Reader. Give the location of the directory where your messages will reside(
D:\x\read
in my case). Make sure you have the directory shared - You can make Delete file after read as a Yes, which will prune the files after they are read from this location.If you do a NO, then specify where you want to move those files to.
- Put Process Batch files as a No.
- Go to Destinations tab, create a Destination called as Appender and make it a File Writer type.
- Give the directory(
D:\x\Output
in my case) where your final file will be placed.Give the file name asfinal.txt
. - Choose Append on the file exists tab.
- In Template, Drag Raw Data from the list on the right hand side, and put it here or else what you can do is type
${message.rawData}
in the template section. - Save Channel and Deploy it.
- Place all your messages in the read folder (mentioned above), and wait for Mirth to poll the folder (default setting is
1000 ms
). - Once that is done, go to
final.txt
to see all the messages appended in the same file.
The downside is that even though this process is 100 percent working, the message thus appended will not be seperated by any means. So it will look like below
|2688684|||||||||||||||||||||||||199912271408||||||002376853MSH|^~\&|EPIC|EPICADT|
^ End of first message

- 988
- 8
- 27
You could also try to use HL7Browser (www.nule.org), a tool that is similar to 7Edit, with less features but free.
You should be able to open many single HL7 messages files, HL7Browser will cache them in its viewer and should allow you to save them all to a single file.
Hope helps
Davide

- 95
- 1
- 8
You don't need any tool for that. 7edit is able to read multi-message files. You just need to append each message into one single text file like this (two ADT messages):
MSH|^~\&|SystemA|CompanyA|SystemB|CompanyB|20121116122025||ADT^A01|101|T|2.5||||||UNICODE UTF-8
EVN|A01|20130823080958
PID|||1000||Lastname^Firstname
PV1||I
MSH|^~\&|SystemA|CompanyA|SystemB|CompanyB|20121116122026||ADT^A01|102|T|2.5||||||UNICODE UTF-8
EVN|A01|20130823080958
PID|||1000||Lastname^Firstname
PV1||I
Open this file with 7edit and you will see this (multiple messages):
Now you can send all messages at once by pressing on Send
and then select All Messages
:
It is that simple - no other tool necessary (just to make the append in one file maybe)

- 4,645
- 3
- 47
- 80
-
"You just need to append each message into one single text file like this (two ADT messages)"-In order to append those seperate messages in one file, Mirth will be required. – Sid Aug 26 '13 at 09:47
-
We all see that you want to advertise for Mirth on Stackoverflow, but to be honest, a file append can be done with dozens of applications... – Philipp Aug 26 '13 at 10:41
-
I am not advertising about Mirth, what makes you think so. I am just a user and fairly comfortable with it. Considering the fact that this question was tagged HL7 and Mirth is an Integration Engine that is widely used, I used it for illustration. Also, if it had to append contents of 1000 file, i bet one can also do it programmatically. I am not from marketing business my friend :) – Sid Aug 26 '13 at 11:16
if you have multiple HL7 files in one folder and want to combine them into 1 hl7 file, you can do following:
- create a batch file in this folder named combine.cmd
write following into this batch file
del combined.hl7
for %%f in (*.hl7) do type "%%f" >> combined.hl
move combined.hl combined.hl7
- run this batch file
result: all hl7 files in this folder are combined into a single file called "combined.hl7"