Batch header and footer in Ensemble File Operation
Hello community,
I am receiving a HL7 message over TCP connection.
I have to set up a process/operation to produce a daily file with this HL7 messages to be created in a directory using EnsLib.File.OutboundAdapter
and EnsLib.HL7.Operation.FileOperation. The file needs to have a header line added each time it is created and a footer .I did not find any standard class file under File Adapter which will create header/footer.
Any suggestion will be greatly appreciated.
Thanks,
Jimmy Christian
Are these standard HL7 batch headers and footers (BHS/BTS, FHS/FTS, etc) or something custom to your organization?
If they are one of the HL7 standards, have a look at these docs on HL7 batches:
https://docs.intersystems.com/healthconnect20191/csp/docbook/Doc.View.cl...
One tricky part will be triggering when an old batch ends/new batch begins -- this will depend on your local requirements.
If they are custom, there are a few approaches you can consider:
Thank you Marc for the detailed information.
I earlier tried the approach using the Record Mapper but it did not seam feasible in this scenario.
So i have done is
Created a CUSTOM operation class which extends Ens.BusinessOperation, EnsLib.HL7.Operation.Standard
It uses the file adapter.
Then I overided the oninit and outputDocument method.
We have a similar need. We have to enclose the HL7 ORU messages within the FHS, BHS, and BTS, and FTS segments (with the counts of the total transactions in the BTS, and FTS segments).
Is writing custom code the only option for this?
Hello Pankaja,
Seems like for now custom code is the only option. I was not able to find any out of the box functionality for writing the counts of the total transactions without a custom code.
Here are few strategies for custom code i looked into.
1) In the File Operation , write the messages to a "Temp" File. At a certain time through a task or some other logic read from the temp file and collect all details you need and then write to another File.
2) I yet have to explore this option. At a point in time when you want your file, read from the Enslib.Hl7.Msg and create a file per your needs.
3) Write the live messages to a temp database. Generate necessary file from it when needed. Delete the messages from the DB and copy it to a Archive DB if needed.
4) As live messages are coming write to a Global and then run a task to create messages from the Globals.
Thanks,
Jimmy Christian.