Filename capture during BPL process
Need to capture filename during BPL process, then set it to MSH-6 in the HL7 message.
Please advice, if this can be done.
Comments
Yes, filename capture during a Business Process (BPL) process and setting it to MSH-6 in an HL7 message can be performed as described below:
Access the Original Filename: To access the original filename in BPL, you can use the property
request.OriginalFilenameif the message contains theEns.StreamContainerobject, which holds metadata like the original filename [1].Modify the HL7 Message: Using a DTL transformation within the BPL, you can set the value of MSH-6 in the HL7 message to the retrieved filename:
Sequence of Actions:
- Retrieve the filename from the incoming data and store it in a context variable within the BPL.
- Pass the HL7 message and the context variable to the DTL.
- The DTL should include logic to map the context variable (e.g.,
context.Filename) totarget.{MSH:6}.
This approach ensures the filename is correctly embedded in the MSH-6 segment of the HL7 message [1][3].
If further customization or examples are required, please share more details.
Sources:
Please define "capture filename", I don't understand.
I need to read HL7 message filename, add first 6 characters in MSH-6 segment
I guess that you are using a Enslib.HL7.Service that uses EnsLib.File.InboundAdapter as Adapter. The problem is that the name of the file is not a property of Enslib.HL7.Message class, so you have to follow these steps:
- Create your own service that extends to Enslib.HL7.Service.
- Overwritte OnProcessInput process to get the name of the readed stream:
Set tFileName=pInput.Attributes("Filename") set sessionID = $$$JobSessionIdset^GlobalName("Session", sessionID) = tFileName do##super() - From DTL use code to get the global that you created before getting the ID session from Enslib.HL7.Message and assign it to MSH property:
-
Set globalValue = $GET(^GlobalName("Session", sessionID)) - And finally assign globalValue variable to the MSH propery (using SET from the DTL):
target.{MSH.PropertyName} = globalValue